﻿/* 定義 CSS 變數 / กำหนดตัวแปร CSS สำหรับสี เพื่อให้เปลี่ยน Theme ได้แบบ Real-time */
:root {
    --color-primary: #1e3a8a; /* blue-900 */
    --color-secondary: #3b82f6; /* blue-500 */
    --color-accent: #eff6ff; /* blue-50 */
}

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');
html,
body {
    background-color: #f3f4f6;
}

/* Student exam answer choices */
#exam-options-area {
    display: block;
}

.student-exam-question-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.student-exam-question-number {
    color: #2563eb;
    font-weight: 950;
}

.student-exam-question-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 230px;
    margin: 0 auto 22px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 4px;
    background: #ffffff;
    object-fit: contain;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.07);
}

.student-exam-options-list {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 10px;
}

.student-exam-option {
    appearance: none;
    display: grid;
    width: 100%;
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    border: 2px solid #dbe3ee;
    border-radius: 8px;
    padding: 12px 14px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.student-exam-option-marker {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 2px;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.student-exam-option-marker i {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #16a34a;
    color: #ffffff;
    font-size: 0.55rem;
}

.student-exam-option-content {
    display: block;
    min-width: 0;
}

.student-exam-option-meta {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
}

.student-exam-option-main {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.student-exam-option-answer {
    min-width: 0;
    flex: 1 1 auto;
    color: #172033;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.student-exam-option-answer.is-empty {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
}

.student-exam-option-image {
    display: block;
    width: auto;
    max-width: min(42%, 180px);
    max-height: 92px;
    flex: 0 1 auto;
    border: 1px solid #dbe3ee;
    border-radius: 7px;
    padding: 3px;
    background: #ffffff;
    object-fit: contain;
}

.student-exam-option.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 8px 18px rgba(37, 99, 235, 0.09);
}

.student-exam-option.is-selected .student-exam-option-marker {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.student-exam-option.is-selected .student-exam-option-meta {
    color: #2563eb;
}

.student-exam-option:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.28);
    outline-offset: 2px;
}

@media (hover: hover) {
    .student-exam-option:hover {
        border-color: #7dd3fc;
        background: #f8fdff;
        box-shadow: 0 7px 16px rgba(14, 165, 233, 0.09);
        transform: translateY(-1px);
    }
}

@media (min-width: 768px) {
    .student-exam-question-title {
        gap: 10px;
        margin-bottom: 22px;
        font-size: 1.5rem;
    }

    .student-exam-question-image {
        max-height: 290px;
        margin-bottom: 26px;
    }

    .student-exam-options-list {
        gap: 12px;
    }

    .student-exam-option {
        min-height: 82px;
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 15px;
        padding: 14px 18px;
    }

    .student-exam-option-marker {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .student-exam-option-meta {
        font-size: 0.72rem;
    }

    .student-exam-option-answer {
        font-size: 1.4rem;
    }

    .student-exam-option-image {
        max-height: 112px;
    }
}

@media (max-width: 480px) {
    #active-exam-container {
        padding: 10px !important;
    }

    #active-exam-container > div {
        padding: 15px !important;
        border-radius: 10px !important;
    }

    .student-exam-option-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .student-exam-option-image {
        width: auto;
        max-width: min(100%, 180px);
        max-height: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-exam-option,
    .student-exam-option-marker {
        transition: none;
    }
}

/* Subject manager */
#view-subjects {
    --subject-border: #d8e3ec;
    --subject-ink: #172033;
    --subject-muted: #64748b;
    --subject-blue: #0284c7;
}

#view-subjects *,
.subject-form-modal * {
    letter-spacing: 0;
}

.subject-manager-shell {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--subject-border);
    border-top: 4px solid #0891b2;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.subject-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 21px;
    border-bottom: 1px solid var(--subject-border);
    background: #f8fbfd;
}

.subject-manager-title-wrap {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.subject-manager-title-icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.25rem;
}

.subject-manager-eyebrow,
.subject-manager-title-wrap h2,
.subject-manager-subtitle {
    margin: 0;
}

.subject-manager-eyebrow {
    color: #0284c7;
    font-size: 0.66rem;
    line-height: 1.2;
    font-weight: 900;
}

.subject-manager-title-wrap h2 {
    margin-top: 2px;
    color: var(--subject-ink);
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 950;
}

.subject-manager-subtitle {
    margin-top: 3px;
    color: var(--subject-muted);
    font-size: 0.74rem;
    line-height: 1.35;
    font-weight: 700;
}

.subject-manager-add-button {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #0369a1;
    border-radius: 7px;
    padding: 9px 15px;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(2, 132, 199, 0.2);
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.subject-manager-add-button:hover {
    background: #0369a1;
    box-shadow: 0 7px 15px rgba(2, 132, 199, 0.24);
    transform: translateY(-1px);
}

.subject-manager-add-button:focus-visible,
.subject-manager-search:focus-within,
.subject-card button:focus-visible,
.subject-form-modal button:focus-visible,
.subject-form-field input:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.2);
    outline-offset: 2px;
}

.subject-manager-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--subject-border);
    background: #ffffff;
}

.subject-manager-summary-item {
    display: grid;
    min-width: 0;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-right: 1px solid #e2e8f0;
}

.subject-manager-summary-item:last-child {
    border-right: 0;
}

.subject-manager-summary-item > i {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 7px;
    background: var(--summary-soft);
    color: var(--summary-color);
    font-size: 0.92rem;
}

.subject-manager-summary-item > span,
.subject-manager-summary-item small,
.subject-manager-summary-item strong {
    display: block;
    min-width: 0;
}

.subject-manager-summary-item small {
    color: #64748b;
    font-size: 0.64rem;
    line-height: 1.25;
    font-weight: 750;
}

.subject-manager-summary-item strong {
    margin-top: 2px;
    color: #334155;
    font-size: 0.76rem;
    line-height: 1.25;
    font-weight: 850;
}

.subject-manager-summary-item strong b {
    margin-right: 2px;
    color: var(--summary-color);
    font-size: 1.15rem;
    font-weight: 950;
}

.subject-manager-summary-item.tone-blue { --summary-color: #0369a1; --summary-soft: #e0f2fe; }
.subject-manager-summary-item.tone-green { --summary-color: #047857; --summary-soft: #dcfce7; }
.subject-manager-summary-item.tone-amber { --summary-color: #b45309; --summary-soft: #fef3c7; }

.subject-manager-controls {
    padding: 15px 18px 0;
    background: #f8fafc;
}

#view-subjects #subject-owner-filter-panel:empty {
    display: none;
}

#view-subjects #subject-owner-filter-panel:not(:empty) {
    margin-bottom: 11px;
}

#view-subjects .admin-subject-owner-panel {
    border: 1px solid #bae6fd !important;
    border-radius: 8px !important;
    padding: 11px 12px !important;
    background: #f0f9ff !important;
    box-shadow: none !important;
}

#view-subjects .admin-subject-owner-panel > div {
    gap: 10px !important;
}

#view-subjects .admin-subject-owner-panel button {
    min-height: 40px;
    border: 1px solid #0284c7;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
}

.subject-manager-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--subject-border);
    border-radius: 8px;
    background: #ffffff;
}

.subject-manager-search {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: 22px minmax(0, 1fr) 34px;
    min-height: 44px;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 0 6px 0 12px;
    background: #f8fafc;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.subject-manager-search:focus-within {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.subject-manager-search > i {
    color: #64748b;
    font-size: 0.9rem;
}

.subject-manager-search input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 750;
}

.subject-manager-search input::placeholder {
    color: #94a3b8;
}

.subject-manager-search button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #e2e8f0;
    color: #64748b;
    cursor: pointer;
}

.subject-manager-result-count {
    display: flex;
    min-height: 44px;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    border-left: 1px solid #e2e8f0;
    padding: 8px 8px 8px 18px;
    color: #64748b;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 750;
}

.subject-manager-result-count strong {
    color: #0369a1;
    font-size: 1.08rem;
    font-weight: 950;
}

.subject-manager-content {
    padding: 17px 18px 20px;
    background: #f8fafc;
}

.subject-manager-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.subject-manager-list-heading h3,
.subject-manager-list-heading p {
    margin: 0;
}

.subject-manager-list-heading h3 {
    color: var(--subject-ink);
    font-size: 0.98rem;
    line-height: 1.25;
    font-weight: 950;
}

.subject-manager-list-heading p {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 700;
}

.subject-manager-table-wrap,
.subject-manager-table,
.subject-manager-grid {
    display: block;
    width: 100%;
}

.subject-manager-table-wrap {
    overflow: visible;
}

.subject-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-items: stretch;
    gap: 12px;
}

.subject-manager-grid-item,
.subject-manager-grid-item > td {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
}

.subject-card {
    --subject-accent: #0284c7;
    --subject-soft: #e0f2fe;
    --subject-accent-ink: #075985;
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d8e3ec;
    border-top: 3px solid var(--subject-accent);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 13px rgba(15, 23, 42, 0.06);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.subject-card:hover {
    border-color: #b8c8d6;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.subject-card.tone-1 { --subject-accent: #0284c7; --subject-soft: #e0f2fe; --subject-accent-ink: #075985; }
.subject-card.tone-2 { --subject-accent: #059669; --subject-soft: #dcfce7; --subject-accent-ink: #047857; }
.subject-card.tone-3 { --subject-accent: #7c3aed; --subject-soft: #ede9fe; --subject-accent-ink: #6d28d9; }
.subject-card.tone-4 { --subject-accent: #d97706; --subject-soft: #fef3c7; --subject-accent-ink: #92400e; }
.subject-card.tone-5 { --subject-accent: #e11d48; --subject-soft: #ffe4e6; --subject-accent-ink: #be123c; }
.subject-card.tone-6 { --subject-accent: #0891b2; --subject-soft: #cffafe; --subject-accent-ink: #0e7490; }

.subject-card-header {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fbfdff;
}

.subject-card-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--subject-accent) 24%, white);
    border-radius: 8px;
    background: var(--subject-soft);
    color: var(--subject-accent-ink);
    font-size: 1.08rem;
}

.subject-card-heading {
    min-width: 0;
}

.subject-card-code {
    display: inline-flex;
    max-width: 100%;
    min-height: 22px;
    align-items: center;
    overflow: hidden;
    border-radius: 5px;
    padding: 3px 7px;
    background: var(--subject-soft);
    color: var(--subject-accent-ink);
    font-family: Tahoma, "Leelawadee UI", sans-serif;
    font-size: 0.62rem;
    line-height: 1.1;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-card-heading h3 {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: #172033;
    font-size: 1.02rem;
    line-height: 1.3;
    font-weight: 950;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.subject-card-access {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    gap: 5px;
    border: 1px solid;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 0.59rem;
    line-height: 1.1;
    font-weight: 900;
    white-space: nowrap;
}

.subject-card-access.is-owner {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #047857;
}

.subject-card-access.is-shared {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.subject-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 11px;
    padding: 12px 14px 13px;
}

.subject-card-owner {
    display: grid;
    min-width: 0;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.subject-card-owner-icon {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 7px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.76rem;
}

.subject-card-owner > div {
    min-width: 0;
}

.subject-card-owner small,
.subject-card-owner strong {
    display: block;
    min-width: 0;
}

.subject-card-owner small {
    color: #94a3b8;
    font-size: 0.56rem;
    line-height: 1.15;
    font-weight: 800;
}

.subject-card-owner strong {
    margin-top: 2px;
    overflow: hidden;
    color: #334155;
    font-size: 0.72rem;
    line-height: 1.25;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-card-co-teachers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #ddd6fe;
    border-radius: 5px;
    padding: 4px 6px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 0.57rem;
    font-weight: 850;
    white-space: nowrap;
}

.subject-card-room-section {
    min-width: 0;
}

.subject-card-section-title {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.subject-card-section-title span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 850;
}

.subject-card-section-title span i {
    color: var(--subject-accent);
}

.subject-card-section-title strong {
    color: #172033;
    font-size: 0.7rem;
    font-weight: 950;
    white-space: nowrap;
}

.subject-card-room-list {
    display: flex;
    min-height: 28px;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
}

.subject-card-room-chip {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.64rem;
    line-height: 1.15;
    font-weight: 850;
}

.subject-card-room-chip.is-more {
    border-style: dashed;
    color: #64748b;
}

.subject-card-room-empty {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 750;
}

#view-subjects .subject-card-schedule {
    display: grid;
    min-height: 44px;
    grid-template-columns: 29px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    margin: auto 0 0;
    border: 1px solid #fcd34d;
    border-radius: 7px;
    padding: 7px 8px;
    background: #fffbeb;
}

#view-subjects .subject-card-schedule > i {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.7rem;
}

#view-subjects .subject-card-schedule > div {
    gap: 4px 7px;
}

#view-subjects .subject-card-schedule > div span {
    font-size: 0.6rem;
}

#view-subjects .subject-card-schedule > em {
    width: 23px;
    height: 23px;
    font-size: 0.56rem;
}

#view-subjects .subject-card-schedule > small {
    font-size: 0.56rem;
}

#view-subjects .subject-card-schedule.is-empty {
    grid-template-columns: 29px minmax(0, 1fr);
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 800;
}

.subject-card-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fbfdff;
}

.subject-card-main-actions,
.subject-card-utility-actions {
    display: grid;
    gap: 6px;
}

.subject-card-main-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subject-card-main-actions.is-four,
.subject-card-utility-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.subject-card-utility-actions {
    margin-top: 6px;
    padding-top: 7px;
    border-top: 1px solid #e2e8f0;
}

.subject-card-main-actions button,
.subject-card-utility-actions button {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.subject-card-main-actions button {
    min-height: 51px;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    font-size: 0.64rem;
}

.subject-card-main-actions button i {
    font-size: 0.92rem;
}

.subject-card-utility-actions button {
    min-height: 42px;
    gap: 4px;
    padding: 6px 3px;
    font-size: 0.58rem;
}

.subject-card-main-actions button:hover,
.subject-card-utility-actions button:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
    box-shadow: 0 4px 9px rgba(15, 23, 42, 0.1);
}

.subject-card-main-actions .is-chart { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.subject-card-main-actions .is-schedule { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.subject-card-main-actions .is-media { border-color: #a5f3fc; background: #ecfeff; color: #0e7490; }
.subject-card-main-actions .is-excel,
.subject-card-utility-actions .is-excel { border-color: #bbf7d0; background: #f0fdf4; color: #047857; }
.subject-card-utility-actions .is-teacher { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.subject-card-utility-actions .is-edit { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.subject-card-utility-actions .is-delete { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.subject-manager-empty-row,
.subject-manager-empty-row > td {
    display: block;
    width: 100%;
    grid-column: 1 / -1;
}

.subject-manager-empty {
    display: flex;
    min-height: 245px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    background: #ffffff;
    text-align: center;
}

.subject-manager-empty > span {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.15rem;
}

.subject-manager-empty h3 {
    margin: 12px 0 0;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 950;
}

.subject-manager-empty p {
    max-width: 100%;
    margin: 4px 0 0;
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-manager-empty button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    border: 1px solid #0284c7;
    border-radius: 6px;
    padding: 8px 13px;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

/* Add and edit subject dialogs */
.subject-form-modal {
    padding: 16px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(7px);
}

.subject-form-modal.hidden {
    display: none;
}

.subject-form-dialog {
    display: flex;
    width: min(620px, 100%);
    max-height: min(90dvh, 760px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d8e3ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.subject-form-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-top: 4px solid var(--form-accent, #0284c7);
    border-bottom: 1px solid #d8e3ec;
    background: #f8fbfd;
}

.subject-form-modal.is-add { --form-accent: #0284c7; --form-soft: #e0f2fe; --form-ink: #0369a1; }
.subject-form-modal.is-edit { --form-accent: #d97706; --form-soft: #fef3c7; --form-ink: #92400e; }

.subject-form-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.subject-form-heading-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--form-accent) 24%, white);
    border-radius: 8px;
    background: var(--form-soft);
    color: var(--form-ink);
    font-size: 1rem;
}

.subject-form-heading p,
.subject-form-heading h3 {
    margin: 0;
}

.subject-form-heading p {
    color: var(--form-ink);
    font-size: 0.6rem;
    line-height: 1.2;
    font-weight: 900;
}

.subject-form-heading h3 {
    margin-top: 2px;
    color: #172033;
    font-size: 1.1rem;
    line-height: 1.25;
    font-weight: 950;
}

.subject-form-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
}

.subject-form-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 17px 18px;
    background: #ffffff;
}

.subject-form-field-grid {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
    gap: 12px;
}

.subject-form-field {
    display: block;
    min-width: 0;
}

.subject-form-field > span,
.subject-form-room-heading > div:first-child > span {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 900;
}

.subject-form-field b,
.subject-form-room-heading b {
    color: #dc2626;
}

.subject-form-field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 9px 11px;
    outline: 0;
    background: #f8fafc;
    color: #172033;
    font-size: 0.8rem;
    font-weight: 800;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.subject-form-field input:focus {
    border-color: var(--form-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--form-accent) 15%, transparent);
}

.subject-form-room-section {
    margin-top: 15px;
    border: 1px solid #d8e3ec;
    border-radius: 8px;
    background: #f8fafc;
}

.subject-form-room-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border-bottom: 1px solid #d8e3ec;
    background: #ffffff;
}

.subject-form-room-heading > div:first-child > span {
    margin: 0;
}

.subject-form-room-heading small {
    display: block;
    margin-top: 2px;
    color: var(--form-ink);
    font-size: 0.61rem;
    font-weight: 850;
}

.subject-form-room-tools {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.subject-form-room-tools button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}

.subject-form-room-tools button:first-child {
    border-color: color-mix(in srgb, var(--form-accent) 35%, white);
    background: var(--form-soft);
    color: var(--form-ink);
}

.subject-form-room-picker {
    display: grid;
    max-height: min(42dvh, 340px);
    gap: 9px;
    overflow-y: auto;
    padding: 10px;
}

.subject-form-room-group {
    border: 1px solid #dbe4ec;
    border-radius: 7px;
    padding: 8px;
    background: #ffffff;
}

.subject-form-room-group h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 7px;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 950;
}

.subject-form-room-group h4 span {
    color: #94a3b8;
    font-size: 0.56rem;
    font-weight: 800;
}

.subject-form-room-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.subject-form-room-option {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 41px;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    border: 1px solid #d8e3ec;
    border-radius: 6px;
    padding: 6px 7px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.subject-form-room-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.subject-form-room-check {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: transparent;
    font-size: 0.55rem;
}

.subject-form-room-option strong {
    min-width: 0;
    overflow: hidden;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-form-room-option:has(input:checked) {
    border-color: var(--form-accent);
    background: var(--form-soft);
    box-shadow: inset 0 0 0 1px var(--form-accent);
}

.subject-form-room-option input:checked + .subject-form-room-check {
    border-color: var(--form-accent);
    background: var(--form-accent);
    color: #ffffff;
}

.subject-form-room-option:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--form-accent) 18%, transparent);
    outline-offset: 2px;
}

.subject-form-room-empty {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
}

.subject-form-room-empty i {
    font-size: 1.2rem;
}

.subject-form-footer {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #d8e3ec;
    background: #f8fafc;
}

.subject-form-footer button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid;
    border-radius: 7px;
    padding: 8px 15px;
    font-size: 0.74rem;
    font-weight: 900;
    cursor: pointer;
}

.subject-form-cancel {
    border-color: #cbd5e1 !important;
    background: #ffffff;
    color: #475569;
}

.subject-form-submit {
    border-color: var(--form-accent) !important;
    background: var(--form-accent);
    color: #ffffff;
}

@media (max-width: 640px) {
    .subject-manager-header {
        align-items: stretch;
        flex-direction: column;
        padding: 14px 13px;
    }

    .subject-manager-title-icon {
        width: 46px;
        height: 46px;
    }

    .subject-manager-title-wrap h2 {
        font-size: 1.12rem;
    }

    .subject-manager-subtitle {
        font-size: 0.66rem;
    }

    .subject-manager-add-button {
        width: 100%;
    }

    .subject-manager-summary-item {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 5px;
        padding: 9px 4px;
        text-align: center;
    }

    .subject-manager-summary-item > i {
        width: 30px;
        height: 30px;
        font-size: 0.76rem;
    }

    .subject-manager-summary-item small {
        font-size: 0.56rem;
    }

    .subject-manager-summary-item strong {
        font-size: 0.64rem;
    }

    .subject-manager-summary-item strong b {
        font-size: 0.95rem;
    }

    .subject-manager-controls {
        padding: 10px 9px 0;
    }

    #view-subjects .admin-subject-owner-panel > div {
        align-items: stretch !important;
    }

    #view-subjects .admin-subject-owner-panel button {
        width: 100% !important;
    }

    .subject-manager-toolbar {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        padding: 8px;
    }

    .subject-manager-result-count {
        min-height: 32px;
        border-top: 1px solid #e2e8f0;
        border-left: 0;
        padding: 6px 4px 0;
    }

    .subject-manager-content {
        padding: 13px 9px 14px;
    }

    .subject-card-header {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 9px;
        padding: 12px;
    }

    .subject-card-icon {
        width: 41px;
        height: 41px;
    }

    .subject-card-heading h3 {
        font-size: 0.94rem;
    }

    .subject-card-access {
        grid-column: 2;
        justify-self: start;
    }

    .subject-card-body {
        padding: 11px 12px 12px;
    }

    #view-subjects .subject-card-schedule {
        grid-template-columns: 29px minmax(0, 1fr) auto;
    }

    #view-subjects .subject-card-schedule > small {
        display: none;
    }

    .subject-card-main-actions button {
        min-height: 54px;
    }

    .subject-form-modal {
        align-items: flex-end !important;
        padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    }

    .subject-form-dialog {
        width: 100%;
        max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    }

    .subject-form-header {
        padding: 13px 12px;
    }

    .subject-form-heading-icon {
        width: 39px;
        height: 39px;
    }

    .subject-form-heading h3 {
        font-size: 1rem;
    }

    .subject-form-body {
        padding: 12px;
    }

    .subject-form-field-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .subject-form-room-section {
        margin-top: 12px;
    }

    .subject-form-room-picker {
        max-height: 42dvh;
        padding: 8px;
    }

    .subject-form-room-group {
        padding: 7px;
    }

    .subject-form-room-options {
        gap: 5px;
    }

    .subject-form-room-option {
        min-height: 39px;
        grid-template-columns: 18px minmax(0, 1fr);
        gap: 5px;
        padding: 5px;
    }

    .subject-form-room-check {
        width: 18px;
        height: 18px;
    }

    .subject-form-room-option strong {
        font-size: 0.62rem;
    }

    .subject-form-footer {
        display: grid;
        grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .subject-form-footer button {
        width: 100%;
        min-width: 0;
        padding: 8px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .subject-manager-add-button,
    .subject-card,
    .subject-card button,
    .subject-form-room-option {
        transition: none !important;
    }
}

/* School documents */
.quick-school-documents-button {
    isolation: isolate;
    border-color: #c4b5fd !important;
    background: #f8fafc !important;
}

.quick-school-documents-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(rgba(99, 102, 241, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.055) 1px, transparent 1px),
        linear-gradient(145deg, rgba(224, 231, 255, 0.75), rgba(240, 253, 250, 0.72));
    background-size: 15px 15px, 15px 15px, auto;
}

.quick-school-documents-paper {
    position: relative;
    z-index: 2;
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #4f46e5;
    color: #fff;
    font-size: 1.55rem;
    box-shadow: 0 7px 16px rgba(79, 70, 229, 0.24);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-school-documents-pen {
    position: absolute;
    z-index: 3;
    top: calc(50% - 13px);
    left: calc(50% + 9px);
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 0.65rem;
    box-shadow: 0 4px 10px rgba(180, 83, 9, 0.28);
    transform: rotate(-12deg);
}

.quick-school-documents-button:hover .quick-school-documents-paper {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.quick-school-documents-button:hover .quick-school-documents-pen {
    animation: schoolDocumentPenWrite 650ms ease-in-out;
}

@keyframes schoolDocumentPenWrite {
    0%, 100% { transform: translate(0, 0) rotate(-12deg); }
    35% { transform: translate(-7px, 4px) rotate(-12deg); }
    70% { transform: translate(5px, 7px) rotate(-12deg); }
}

.school-documents-root {
    min-height: calc(100vh - 92px);
    background: #f4f7fb;
}

.school-documents-root,
.school-documents-root * {
    box-sizing: border-box;
}

.school-documents-page,
.school-document-editor {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 20px;
}

.school-documents-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.school-documents-hero-title,
.school-document-template-band {
    display: flex;
    align-items: center;
    min-width: 0;
}

.school-documents-hero-title { gap: 16px; }

.school-documents-hero-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border-radius: 8px;
    background: #0284c7;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.22);
}

.school-documents-hero-title p,
.school-documents-hero-title h2,
.school-documents-hero-title span { margin: 0; }
.school-documents-hero-title p { color: #0284c7; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.school-documents-hero-title h2 { color: #0f172a; font-size: clamp(1.25rem, 2vw, 1.8rem); line-height: 1.25; }
.school-documents-hero-title div > span { display: block; margin-top: 3px; color: #64748b; font-size: 0.88rem; font-weight: 650; }

.school-documents-create-button,
.school-document-template-band > button,
.school-documents-empty button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 0;
    border-radius: 7px;
    background: #0284c7;
    color: #fff;
    font-weight: 850;
    box-shadow: 0 8px 16px rgba(2, 132, 199, 0.2);
    transition: transform 160ms ease, background 160ms ease;
}

.school-documents-create-button:hover,
.school-document-template-band > button:hover,
.school-documents-empty button:hover { background: #0369a1; transform: translateY(-1px); }

.school-document-template-band {
    gap: 16px;
    margin-top: 16px;
    padding: 18px 20px;
    border: 1px solid #a7f3d0;
    border-left: 5px solid #10b981;
    border-radius: 8px;
    background: #ecfdf5;
}

.school-document-template-mark {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    border-radius: 8px;
    background: #059669;
    color: #fff;
    font-size: 1.45rem;
}

.school-document-template-band > div:nth-child(2) { min-width: 0; flex: 1; }
.school-document-template-band > div:nth-child(2) > span { color: #047857; font-size: 0.72rem; font-weight: 900; }
.school-document-template-band h3 { margin: 1px 0 2px; color: #064e3b; font-size: 1.08rem; }
.school-document-template-band p { margin: 0; color: #4b5563; font-size: 0.83rem; font-weight: 600; }
.school-document-template-band > button { flex: 0 0 auto; background: #059669; box-shadow: 0 8px 16px rgba(5, 150, 105, 0.18); }
.school-document-template-band > button span { color: #fff; font-size: 0.72rem; font-weight: 900; }
.school-document-template-action-short { display: none; }
.school-document-template-band > button:hover { background: #047857; }

.school-document-template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.school-document-template-grid .school-document-template-band { min-width: 0; margin-top: 0; }
.school-document-template-band.tone-travel { border-color: #bfdbfe; border-left-color: #2563eb; background: #eff6ff; }
.school-document-template-band.tone-travel .school-document-template-mark,
.school-document-template-band.tone-travel > button { background: #2563eb; }
.school-document-template-band.tone-travel > div:nth-child(2) > span { color: #1d4ed8; }
.school-document-template-band.tone-travel h3 { color: #1e3a8a; }
.school-document-template-band.tone-leave { border-color: #fed7aa; border-left-color: #ea580c; background: #fff7ed; }
.school-document-template-band.tone-leave .school-document-template-mark,
.school-document-template-band.tone-leave > button { background: #ea580c; }
.school-document-template-band.tone-leave > div:nth-child(2) > span { color: #c2410c; }
.school-document-template-band.tone-leave h3 { color: #7c2d12; }
.school-document-template-grid .school-document-template-band { align-items: flex-start; flex-wrap: wrap; }
.school-document-template-grid .school-document-template-band > div:nth-child(2) { min-height: 76px; }
.school-document-template-grid .school-document-template-band > button { width: 100%; }

.school-documents-records {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.school-documents-records-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.school-documents-records-toolbar h3,
.school-documents-records-toolbar p { margin: 0; }
.school-documents-records-toolbar h3 { color: #0f172a; font-size: 1.05rem; }
.school-documents-records-toolbar p { color: #64748b; font-size: 0.75rem; font-weight: 700; }

.school-documents-search {
    display: flex;
    width: min(420px, 100%);
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #f8fafc;
    color: #64748b;
}

.school-documents-search:focus-within { border-color: #38bdf8; background: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14); }
.school-documents-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #0f172a; font-weight: 650; }

.school-documents-record-list { display: grid; gap: 10px; margin-top: 14px; }
.school-document-record {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.school-document-record:hover { border-color: #7dd3fc; box-shadow: 0 8px 18px rgba(14, 165, 233, 0.09); transform: translateY(-1px); }
.school-document-record-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 8px; background: #e0f2fe; color: #0284c7; font-size: 1.25rem; }
.school-document-record.tone-travel .school-document-record-icon { background: #dbeafe; color: #2563eb; }
.school-document-record.tone-travel .school-document-record-type { color: #2563eb; }
.school-document-record.tone-leave .school-document-record-icon { background: #ffedd5; color: #ea580c; }
.school-document-record.tone-leave .school-document-record-type { color: #ea580c; }
.school-document-record-body { min-width: 0; }
.school-document-record-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.school-document-record-type { color: #0284c7; font-size: 0.68rem; font-weight: 900; }
.school-document-record-heading h3 { margin: 1px 0 0; overflow: hidden; color: #0f172a; font-size: 0.98rem; text-overflow: ellipsis; white-space: nowrap; }
.school-document-record-sequence { flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 0.7rem; font-weight: 800; }
.school-document-record-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: #64748b; font-size: 0.71rem; font-weight: 650; }
.school-document-record-meta span { display: inline-flex; align-items: center; gap: 5px; }
.school-document-record-actions { display: flex; gap: 6px; }
.school-document-record-actions button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 800;
}
.school-document-record-actions button:hover { border-color: #38bdf8; color: #0369a1; }
.school-document-record-actions button.danger:hover { border-color: #fca5a5; background: #fff1f2; color: #be123c; }

.school-documents-empty,
.school-documents-loading,
.school-documents-error {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    text-align: center;
    color: #64748b;
}
.school-documents-empty > span { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: #e0f2fe; color: #0284c7; font-size: 1.65rem; }
.school-documents-empty h3,
.school-documents-empty p,
.school-documents-error p { margin: 0; }
.school-documents-empty h3 { color: #0f172a; font-size: 1.08rem; }
.school-documents-empty p { margin-bottom: 8px; font-size: 0.84rem; }
.school-documents-loading { min-height: 65vh; gap: 12px; color: #0284c7; }
.school-documents-loading i { font-size: 2rem; }
.school-documents-error { min-height: 60vh; color: #b91c1c; }
.school-documents-error > i { font-size: 2.2rem; }
.school-documents-error button { min-height: 42px; margin-top: 8px; padding: 0 15px; border: 0; border-radius: 7px; background: #0284c7; color: #fff; font-weight: 800; }

.school-document-editor { padding-top: 16px; }
.school-document-editor-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.school-document-back-button { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; font-weight: 800; }
.school-document-editor-toolbar > div:nth-child(2) { min-width: 0; }
.school-document-editor-toolbar > div:nth-child(2) > span { color: #0284c7; font-size: 0.68rem; font-weight: 900; }
.school-document-editor-toolbar h2 { margin: 0; overflow: hidden; color: #0f172a; font-size: 1.12rem; text-overflow: ellipsis; white-space: nowrap; }
.school-document-editor-toolbar p { margin: 1px 0 0; color: #64748b; font-size: 0.7rem; font-weight: 650; }
.school-document-editor-actions { display: flex; gap: 7px; }
.school-document-editor-actions button,
.school-document-preview-toolbar button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 6px;
    font-weight: 850;
}
.school-document-editor-actions button.secondary { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.school-document-editor-actions button.primary { border: 1px solid #0284c7; background: #0284c7; color: #fff; box-shadow: 0 7px 14px rgba(2, 132, 199, 0.18); }
.school-document-editor-actions button:disabled { cursor: wait; opacity: 0.65; }

.school-document-mobile-tabs { display: none; }
.school-document-editor-layout { display: grid; grid-template-columns: minmax(360px, 450px) minmax(0, 1fr); align-items: start; gap: 16px; margin-top: 16px; }
.school-document-form-panel,
.school-document-preview-panel { border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; box-shadow: 0 9px 24px rgba(15, 23, 42, 0.05); }
.school-document-form-panel { overflow: hidden; }
.school-document-form-section { padding: 18px; border-bottom: 1px solid #e2e8f0; }
.school-document-form-section:last-child { border-bottom: 0; }
.school-document-form-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.school-document-form-heading > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 7px; background: #e0f2fe; color: #0369a1; font-size: 0.78rem; font-weight: 900; }
.school-document-form-heading h3,
.school-document-form-heading p { margin: 0; }
.school-document-form-heading h3 { color: #0f172a; font-size: 0.94rem; }
.school-document-form-heading p { color: #64748b; font-size: 0.68rem; font-weight: 600; }
.school-document-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.school-document-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.school-document-form-grid .wide { grid-column: span 2; }
.school-document-form-grid .full { grid-column: 1 / -1; }
.school-document-form-grid.compact .half { grid-column: span 1; }
.school-document-field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.school-document-field > span { color: #475569; font-size: 0.68rem; font-weight: 800; }
.school-document-field input,
.school-document-field select,
.school-document-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: 0;
    background: #fff;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 650;
}
.school-document-field textarea { min-height: 72px; padding-top: 9px; padding-bottom: 9px; resize: vertical; line-height: 1.45; }
.school-document-field input:focus,
.school-document-field select:focus,
.school-document-field textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); }
.school-document-field.total input { border-color: #86efac; background: #f0fdf4; color: #166534; font-size: 0.95rem; font-weight: 900; }
.school-document-field.service-auto input {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: default;
}
.school-document-auto-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 9px 0 0;
    border-left: 3px solid #6366f1;
    padding: 8px 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.4;
}
.school-document-auto-note.invalid { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.school-document-date-group { margin-bottom: 12px; padding: 11px; border-left: 3px solid #7dd3fc; background: #f8fafc; }
.school-document-date-group > strong { display: block; margin-bottom: 8px; color: #0369a1; font-size: 0.72rem; }
.school-document-date-group > div { display: grid; grid-template-columns: 0.7fr 1.5fr 0.8fr; gap: 8px; }
.school-document-previous-leave { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #cbd5e1; }
.school-document-stat-editor { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; margin-bottom: 12px; }
.school-document-stat-editor > strong { align-self: center; color: #334155; font-size: 0.72rem; }

.school-document-preview-panel { position: sticky; top: 88px; overflow: hidden; }
.school-document-preview-toolbar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.school-document-preview-toolbar > div { display: flex; align-items: center; gap: 8px; color: #334155; font-size: 0.8rem; font-weight: 850; }
.school-document-preview-toolbar > div i { color: #e11d48; }
.school-document-preview-toolbar button { min-height: 36px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font-size: 0.72rem; }
.school-document-preview-stage { display: flex; min-height: calc(100vh - 180px); justify-content: center; overflow: hidden auto; padding: 12px; background: #dbe3ed; }
.school-document-preview-scale { width: 794px; flex: 0 0 794px; transform-origin: top center; }

@font-face { font-family: "SchoolDocumentTHSarabun"; src: url("assets/fonts/THSarabunNew-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; }
@font-face { font-family: "SchoolDocumentTHSarabun"; src: url("assets/fonts/THSarabunNew-Bold.ttf") format("truetype"); font-style: normal; font-weight: 700; }

.school-document-paper {
    display: flex;
    width: 794px;
    height: 1123px;
    flex-direction: column;
    overflow: hidden;
    padding: 49px 64px 42px;
    background: #fff;
    color: #000;
    font-family: "SchoolDocumentTHSarabun", Tahoma, sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 18.9px;
    line-height: 1.35;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.2);
}
.school-document-paper p { margin: 0; }
.school-document-paper-header { text-align: center; font-weight: 700; line-height: 1.25; }
.school-document-paper-header h1 { margin: 0; font-size: 24px; }
.school-document-paper-header h2 { margin: 0; font-size: 22px; }
.school-document-paper-meta { width: 52%; margin: 27px 0 19px auto; font-weight: 600; transform: translateX(15px); }
.school-document-paper-meta p { display: flex; align-items: baseline; margin: 3px 0; white-space: nowrap; }
.school-document-dotted { position: relative; display: inline-block; min-height: 1em; padding: 0 4px 2px; border-bottom: 0; line-height: 1; vertical-align: baseline; text-align: center; font-weight: 400; }
.school-document-dotted::after { content: ""; position: absolute; right: 0; bottom: 2px; left: 0; border-bottom: 1px dotted #000; }
.school-document-dotted.tiny { min-width: 60px; }
.school-document-dotted.meta-long { min-width: 208px; }
.school-document-dotted.day { min-width: 57px; }
.school-document-dotted.month { min-width: 110px; }
.school-document-dotted.year { min-width: 72px; }
.school-document-dotted.grow { flex: 1; }
.school-document-dotted.money { min-width: 147px; }
.school-document-dotted.money-wide { min-width: 193px; }
.school-document-dotted.service { min-width: 83px; }
.school-document-dotted.signature-line { width: 212px; }
.school-document-dotted.signature-name { width: 185px; }
.school-document-dotted.signature-position { width: 163px; }
.school-document-paper-body { font-weight: 600; }
.school-document-paper-line { display: grid; grid-template-columns: 64px 1fr; margin: 15px 0; }
.school-document-paper-line strong { font-weight: 700; }
.school-document-paper-paragraph { display: flex; align-items: baseline; margin: 8px 0; white-space: nowrap; }
.school-document-paper-paragraph.indent { padding-left: 57px; }
.school-document-paper-consider { margin-top: 19px !important; text-align: center; }
.school-document-paper-signature { width: 235px; margin: 11px 53px 0 auto; text-align: center; }
.school-document-paper-signature .signature-space { height: 38px; }
.school-document-paper-signature > p { margin: 4px 0; white-space: nowrap; }
.school-document-paper-footer { margin-top: auto; font-size: 15.3px; line-height: 1.28; font-weight: 600; }
.school-document-paper-footer > strong,
.school-document-personnel-contact strong { font-size: 16.7px; }
.school-document-paper-footer > p,
.school-document-personnel-contact p { margin: 1px 0; }
.school-document-personnel-contact { margin-top: 19px; }

.school-document-dotted.medium { min-width: 125px; }
.school-document-dotted.wide { min-width: 250px; }
.school-official-paper .school-document-dotted.day { min-width: 34px; }
.school-official-paper .school-document-dotted.month { min-width: 76px; }
.school-official-paper .school-document-dotted.year { min-width: 48px; }
.school-official-paper .school-document-dotted.medium { min-width: 92px; }
.school-official-paper .school-document-dotted.tiny { min-width: 44px; }
.school-official-paper .school-document-dotted.grow {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.school-official-paper { position: relative; display: block; padding: 36px 52px 34px; font-size: 17px; line-height: 1.24; }
.school-official-paper strong { font-weight: 800; }
.school-official-memo-header { position: relative; height: 104px; text-align: center; }
.school-official-garuda { position: absolute; top: 0; left: 10px; width: 88px; height: auto; }
.school-official-memo-header h1 { margin: 0; padding-top: 57px; font-size: 27px; font-weight: 800; }
.school-official-memo-meta { display: grid; gap: 6px; font-size: 18px; }
.school-official-memo-meta p { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.school-official-memo-meta p strong { flex: 0 0 auto; }
.school-official-memo-meta p > span:not(.school-document-dotted) { min-width: 0; }
.school-official-separator { margin: 7px 0 10px; border-bottom: 2px dotted #000; }
.school-official-line { display: grid; grid-template-columns: 62px 1fr; align-items: baseline; margin: 8px 0; }
.school-official-fill { display: flex; align-items: baseline; gap: 4px; margin: 6px 0; white-space: nowrap; }
.school-official-fill.indent { padding-left: 52px; }
.school-official-choice-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 6px 0; }
.school-official-choice { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.school-official-choice-mark { display: inline-grid; width: 17px; height: 17px; place-items: center; border: 1.6px solid #000; border-radius: 50%; font: 800 12px/1 Arial,sans-serif; }
.school-official-consider { margin: 12px 0 0; text-align: center; }
.school-official-requester-signature { width: 290px; margin: 7px 24px 0 auto; text-align: center; }
.school-official-requester-signature p { margin: 3px 0; }
.school-official-comment { min-height: 44px; margin: 5px 0; border-bottom: 1px dotted #000; white-space: pre-wrap; }
.school-official-comment.short { min-height: 28px; }
.school-official-director-comment { min-height: 25px; margin: 3px 0; border-bottom: 1px dotted #000; }

.school-travel-body { font-size: 16.2px; }
.school-travel-choice-title { margin: 8px 0 4px; }
.school-travel-option-list { display: grid; gap: 5px; padding-left: 24px; font-size: 15px; }
.school-travel-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.school-travel-private { display: flex; align-items: baseline; min-width: 0; }
.school-travel-approvals { display: grid; grid-template-columns: 1fr 1fr; gap: 45px; margin-top: 12px; font-size: 15px; text-align: center; }
.school-travel-approvals h3,
.school-travel-director h3 { margin: 0 0 4px; font-size: 15.5px; }
.school-travel-approvals p,
.school-travel-director p { margin: 2px 0; }
.school-travel-director { width: 340px; margin: 13px auto 0; text-align: center; font-size: 15px; }
.school-travel-director .school-official-choice { margin: 0 10px; }

.school-leave-sequence { position: absolute; top: 28px; right: 50px; width: 230px; font-size: 16px; }
.school-leave-sequence p { display: flex; align-items: baseline; margin: 3px 0; }
.school-leave-header { margin-top: 58px; text-align: center; }
.school-leave-header h1 { margin: 0 0 22px; font-size: 22px; }
.school-leave-header h2 { margin: 2px 0; font-size: 18px; }
.school-leave-header p { margin: 15px 0 10px; }
.school-leave-body { font-size: 16.4px; }
.school-leave-body > p { margin: 5px 0; }
.school-leave-type-list { display: grid; gap: 3px; margin: 7px 0 9px 82px; }
.school-leave-type-list p { display: flex; align-items: baseline; gap: 8px; }
.school-leave-signature { margin-top: 8px; }
.school-leave-bottom { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; margin-top: 13px; font-size: 14px; }
.school-leave-bottom h3 { margin: 0 0 5px; font-size: 15.5px; text-align: center; }
.school-leave-statistics > p { margin: 3px 0; text-align: center; }
.school-leave-statistics table { width: 100%; margin: 7px 0; border-collapse: collapse; text-align: center; }
.school-leave-statistics th,
.school-leave-statistics td { height: 27px; padding: 2px 4px; border: 1px solid #000; }
.school-leave-statistics .school-leave-officer { margin-top: 14px; }
.school-leave-approvals { text-align: center; }
.school-leave-approvals > p { margin: 3px 0; }
.school-leave-approvals h3:not(:first-child) { margin-top: 12px; }
.school-leave-acting { margin-top: 8px !important; line-height: 1.3; }

@media (max-width: 1023px) {
    .school-document-template-grid { grid-template-columns: 1fr; }
    .school-document-template-grid .school-document-template-band { align-items: center; flex-wrap: nowrap; }
    .school-document-template-grid .school-document-template-band > div:nth-child(2) { min-height: 0; }
    .school-document-template-grid .school-document-template-band > button { width: auto; }
    .school-document-editor-layout { grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); }
    .school-document-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-document-form-grid .wide { grid-column: span 1; }
}

@media (max-width: 820px) {
    .school-documents-page,
    .school-document-editor { padding: 12px; }
    .school-documents-hero { align-items: center; padding: 14px; }
    .school-documents-hero-title { align-items: center; }
    .school-documents-create-button { width: 44px; min-width: 44px; padding: 0; }
    .school-documents-create-button span { display: none; }
    .school-document-template-grid .school-document-template-band {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 13px 14px;
    }
    .school-document-template-grid .school-document-template-band > button {
        width: auto;
        min-width: 92px;
        min-height: 42px;
        gap: 6px;
        padding: 0 11px;
        color: #fff;
        font-size: 0.72rem;
    }
    .school-document-template-band > button i { font-size: 0.86rem; }
    .school-documents-records { padding: 14px; }
    .school-documents-records-toolbar { align-items: stretch; flex-direction: column; }
    .school-documents-search { width: 100%; }
    .school-document-record { grid-template-columns: auto minmax(0, 1fr); }
    .school-document-record-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .school-document-record-heading { display: block; }
    .school-document-record-sequence { display: inline-block; margin-top: 5px; }

    .school-document-editor-toolbar { grid-template-columns: auto minmax(0, 1fr); }
    .school-document-back-button { width: 42px; padding: 0; justify-content: center; }
    .school-document-back-button span { display: none; }
    .school-document-editor-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-document-mobile-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-top: 10px; padding: 3px; border: 1px solid #cbd5e1; border-radius: 7px; background: #e2e8f0; }
    .school-document-mobile-tabs button { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: #64748b; font-size: 0.78rem; font-weight: 850; }
    .school-document-mobile-tabs button.active { background: #fff; color: #0369a1; box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08); }
    .school-document-editor-layout { display: block; margin-top: 10px; }
    .school-document-editor-layout[data-mobile-tab="form"] .school-document-preview-panel,
    .school-document-editor-layout[data-mobile-tab="preview"] .school-document-form-panel { display: none; }
    .school-document-preview-panel { position: static; }
    .school-document-preview-stage { min-height: calc(100vh - 250px); }
}

@media (max-width: 520px) {
    .school-documents-root { min-height: calc(100vh - 72px); }
    .school-documents-page,
    .school-document-editor { padding: 9px; }
    .school-documents-hero { gap: 9px; padding: 11px 12px; }
    .school-documents-hero-title { gap: 10px; }
    .school-documents-hero-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 1.12rem; }
    .school-documents-hero-title p { display: none; }
    .school-documents-hero-title h2 { font-size: 1rem; line-height: 1.2; }
    .school-documents-hero-title div > span { margin-top: 2px; font-size: 0.64rem; line-height: 1.3; }
    .school-documents-create-button { width: 40px; min-width: 40px; min-height: 40px; }
    .school-document-template-grid { gap: 8px; margin-top: 10px; }
    .school-document-template-grid .school-document-template-band {
        min-height: 70px;
        grid-template-columns: 40px minmax(0, 1fr) 64px;
        gap: 9px;
        padding: 9px 10px;
        border-left-width: 4px;
    }
    .school-document-template-mark { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.05rem; }
    .school-document-template-band > div:nth-child(2) > span,
    .school-document-template-band p { display: none; }
    .school-document-template-band h3 { margin: 0; font-size: 0.84rem; line-height: 1.25; }
    .school-document-template-grid .school-document-template-band > button {
        width: 64px;
        min-width: 64px;
        min-height: 40px;
        gap: 5px;
        padding: 0 7px;
        border-radius: 6px;
        font-size: 0.66rem;
        box-shadow: 0 5px 11px rgba(15, 23, 42, 0.14);
    }
    .school-document-template-band > button span { color: #fff; font-size: 0.66rem; }
    .school-document-template-action-full { display: none; }
    .school-document-template-action-short { display: inline; }
    .school-document-template-band > button i { font-size: 0.76rem; }
    .school-document-record { gap: 9px; padding: 11px; }
    .school-document-record-icon { width: 40px; height: 40px; }
    .school-document-record-heading h3 { font-size: 0.88rem; }
    .school-document-record-meta { display: grid; gap: 3px; }
    .school-document-record-actions button { padding: 0 6px; font-size: 0.7rem; }
    .school-document-form-section { padding: 14px; }
    .school-document-form-grid,
    .school-document-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-document-form-grid .wide,
    .school-document-form-grid .full { grid-column: 1 / -1; }
    .school-document-date-group { padding: 9px; }
    .school-document-date-group > div { grid-template-columns: 0.65fr 1.35fr 0.75fr; gap: 5px; }
    .school-document-field input,
    .school-document-field select,
    .school-document-field textarea { padding-right: 7px; padding-left: 7px; font-size: 0.75rem; }
    .school-document-stat-editor { grid-template-columns: 1fr repeat(3, minmax(0, .85fr)); gap: 5px; }
    .school-document-preview-toolbar button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .quick-school-documents-button:hover .quick-school-documents-pen { animation: none; }
    .school-document-record,
    .school-documents-create-button,
    .school-document-template-band > button { transition: none; }
}

/* NDLP-Tablet: student registration */
.ndlp-student-shell,
.ndlp-student-shell * {
    box-sizing: border-box;
}

.ndlp-student-shell {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 20px 18px 36px;
    color: #172033;
}

.ndlp-student-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
    gap: 18px 28px;
    padding: 22px;
    border: 1px solid #cfe8f4;
    border-left: 5px solid #0284c7;
    border-radius: 8px;
    background: #f0f9ff;
}

.ndlp-student-hero-main,
.ndlp-student-identity,
.ndlp-student-section-head,
.ndlp-device-label,
.ndlp-student-progress-copy,
.ndlp-student-progress-meta,
.ndlp-action-summary,
.ndlp-evidence-card-head,
.ndlp-evidence-action,
.ndlp-evidence-file-label {
    display: flex;
    align-items: center;
}

.ndlp-student-hero-main {
    min-width: 0;
    gap: 14px;
}

.ndlp-student-hero-icon {
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #ffffff;
    color: #0284c7;
    font-size: 1.65rem;
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.12);
}

.ndlp-student-hero-copy {
    min-width: 0;
}

.ndlp-student-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #0369a1;
    font-size: 0.74rem;
    font-weight: 800;
}

.ndlp-student-hero-copy h2,
.ndlp-student-hero-copy p,
.ndlp-student-section-head strong,
.ndlp-student-section-head small,
.ndlp-evidence-heading strong,
.ndlp-evidence-heading small,
.ndlp-action-summary strong,
.ndlp-action-summary small {
    display: block;
    margin: 0;
}

.ndlp-student-hero-copy h2 {
    color: #0f172a;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.25;
}

.ndlp-student-hero-copy p {
    margin-top: 3px;
    color: #526179;
    font-size: 0.82rem;
    font-weight: 600;
}

.ndlp-student-identity {
    min-width: 0;
    gap: 11px;
    padding: 10px;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    background: #ffffff;
}

.ndlp-student-identity img {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border: 2px solid #e0f2fe;
    border-radius: 8px;
    background: #e8eef3;
    object-fit: cover;
}

.ndlp-student-identity span {
    min-width: 0;
}

.ndlp-student-identity small,
.ndlp-student-identity strong,
.ndlp-student-identity em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-student-identity small {
    color: #64748b;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
}

.ndlp-student-identity strong {
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 900;
}

.ndlp-student-identity em {
    color: #526179;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 650;
}

.ndlp-student-progress-area {
    grid-column: 1 / -1;
    padding-top: 2px;
}

.ndlp-student-progress-copy,
.ndlp-student-progress-meta {
    justify-content: space-between;
    gap: 12px;
}

.ndlp-registration-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
}

.ndlp-registration-status.is-progress {
    color: #a16207;
}

.ndlp-registration-status.is-complete {
    color: #15803d;
}

.ndlp-student-progress-copy > strong {
    color: #0369a1;
    font-size: 1.05rem;
    font-weight: 900;
}

.ndlp-student-progress-track {
    height: 9px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 5px;
    background: #dbe8ef;
}

.ndlp-student-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0284c7;
    transition: width 220ms ease;
}

.ndlp-student-progress-meta {
    margin-top: 6px;
    color: #64748b;
    font-size: 0.69rem;
    font-weight: 700;
}

.ndlp-student-progress-meta i {
    margin-right: 4px;
    color: #0f766e;
}

.ndlp-student-section {
    padding: 26px 0 0;
}

.ndlp-student-section + .ndlp-student-section {
    margin-top: 25px;
    border-top: 1px solid #dce5eb;
}

.ndlp-student-section-head {
    gap: 12px;
    margin-bottom: 16px;
}

.ndlp-student-section-number,
.ndlp-evidence-number {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    font-weight: 900;
}

.ndlp-student-section-number {
    width: 36px;
    height: 36px;
    font-size: 0.92rem;
}

.ndlp-student-section-head > span:last-child {
    min-width: 0;
}

.ndlp-student-section-head strong {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
}

.ndlp-student-section-head small {
    margin-top: 1px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 650;
}

.ndlp-device-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ndlp-device-field {
    display: block;
    min-width: 0;
    padding: 15px;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    background: #ffffff;
}

.ndlp-device-label {
    gap: 7px;
    margin-bottom: 8px;
    color: #24344d;
    font-size: 0.82rem;
    font-weight: 850;
}

.ndlp-device-label i {
    color: #0284c7;
}

.ndlp-device-input-wrap {
    position: relative;
    display: block;
}

.ndlp-device-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #7c8ba1;
    transform: translateY(-50%);
    pointer-events: none;
}

.ndlp-device-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1px solid #cbd8e3;
    border-radius: 7px;
    outline: none;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ndlp-device-input-wrap input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.13);
}

.ndlp-device-input-wrap input::placeholder {
    color: #94a3b8;
    font-weight: 600;
}

.ndlp-device-field > small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
}

.ndlp-evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ndlp-evidence-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #dbe5ec;
    border-top: 4px solid #94a3b8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.06);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ndlp-evidence-card.is-ready {
    border-color: #86d7bb;
    border-top-color: #0f9f72;
    box-shadow: 0 5px 15px rgba(15, 159, 114, 0.08);
}

.ndlp-evidence-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 50px;
}

.ndlp-evidence-number {
    width: 28px;
    height: 28px;
    background: #334155;
    font-size: 0.72rem;
}

.ndlp-evidence-card.is-ready .ndlp-evidence-number {
    background: #0f9f72;
}

.ndlp-evidence-heading {
    min-width: 0;
}

.ndlp-evidence-heading strong {
    color: #172033;
    font-size: 0.79rem;
    font-weight: 900;
    line-height: 1.3;
}

.ndlp-evidence-heading strong i {
    margin-right: 6px;
    color: #0284c7;
}

.ndlp-evidence-heading small {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.35;
}

.ndlp-evidence-state {
    align-self: start;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.ndlp-evidence-state.is-ready {
    background: #e8faf3;
    color: #0f7a59;
}

.ndlp-evidence-preview {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-top: 12px;
    overflow: hidden;
    place-items: center;
    border: 1px dashed #b8c6d4;
    border-radius: 7px;
    background: #f6f8fa;
    color: #64748b;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.ndlp-evidence-preview:disabled {
    opacity: 1;
    cursor: default;
}

.ndlp-evidence-preview.is-empty {
    padding: 14px;
}

.ndlp-evidence-preview.is-empty strong,
.ndlp-evidence-preview.is-empty small {
    display: block;
}

.ndlp-evidence-preview.is-empty strong {
    margin-top: 7px;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 850;
}

.ndlp-evidence-preview.is-empty small {
    margin-top: 2px;
    font-size: 0.62rem;
    font-weight: 650;
}

.ndlp-evidence-empty-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #d5e0e8;
    border-radius: 7px;
    background: #ffffff;
    color: #0284c7;
    font-size: 1.05rem;
}

.ndlp-evidence-preview.has-image {
    border-style: solid;
    border-color: #c5d4de;
    background: #e7edf2;
}

.ndlp-evidence-preview.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ndlp-evidence-preview-action {
    position: absolute;
    right: 7px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.86);
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 800;
}

.ndlp-evidence-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.ndlp-evidence-action {
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    gap: 8px;
    padding: 8px;
    border: 1px solid;
    border-radius: 7px;
    font: inherit;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ndlp-evidence-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.ndlp-evidence-action:active {
    transform: translateY(0);
}

.ndlp-evidence-action.camera {
    border-color: #99d9f0;
    background: #eaf8fe;
    color: #0369a1;
}

.ndlp-evidence-action.file {
    border-color: #f4cc8d;
    background: #fff8e8;
    color: #9a4f08;
}

.ndlp-evidence-action > i {
    flex: 0 0 auto;
    font-size: 1rem;
}

.ndlp-evidence-action span {
    min-width: 0;
    text-align: left;
}

.ndlp-evidence-action strong,
.ndlp-evidence-action small {
    display: block;
}

.ndlp-evidence-action strong {
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.ndlp-evidence-action small {
    margin-top: 1px;
    font-size: 0.55rem;
    font-weight: 650;
    opacity: 0.78;
    white-space: nowrap;
}

.ndlp-evidence-file-label {
    min-width: 0;
    gap: 6px;
    margin-top: 8px;
    color: #738197;
    font-size: 0.61rem;
    font-weight: 650;
}

.ndlp-evidence-file-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-evidence-file-label.is-selected,
.ndlp-evidence-file-label.has-existing {
    color: #0f7a59;
}

.ndlp-student-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
    padding: 14px;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.07);
}

.ndlp-action-summary {
    min-width: 0;
    gap: 10px;
    color: #0284c7;
}

.ndlp-action-summary > i {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.ndlp-action-summary span {
    min-width: 0;
}

.ndlp-action-summary strong {
    color: #172033;
    font-size: 0.82rem;
    font-weight: 900;
}

.ndlp-action-summary small {
    margin-top: 1px;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 650;
}

.ndlp-student-action-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.ndlp-student-refresh,
.ndlp-student-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    gap: 8px;
    padding: 0 16px;
    border-radius: 7px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ndlp-student-refresh {
    border: 1px solid #ccd7e1;
    background: #f8fafc;
    color: #334155;
}

.ndlp-student-save {
    min-width: 180px;
    border: 1px solid #0369a1;
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(2, 132, 199, 0.2);
}

.ndlp-student-refresh:hover,
.ndlp-student-save:hover {
    transform: translateY(-1px);
}

.ndlp-student-refresh:hover {
    background: #eef2f6;
}

.ndlp-student-save:hover {
    background: #0369a1;
    box-shadow: 0 7px 15px rgba(2, 132, 199, 0.25);
}

.ndlp-student-refresh:focus-visible,
.ndlp-student-save:focus-visible,
.ndlp-evidence-action:focus-visible,
.ndlp-evidence-preview:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.28);
    outline-offset: 2px;
}

@media (max-width: 960px) {
    .ndlp-student-hero {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 310px);
    }

    .ndlp-evidence-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ndlp-evidence-card:last-child {
        grid-column: 1 / -1;
        width: min(100%, calc(50% - 7px));
        justify-self: center;
    }
}

@media (max-width: 720px) {
    .ndlp-student-shell {
        padding: 10px 8px 24px;
    }

    .ndlp-student-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
        padding: 14px;
    }

    .ndlp-student-identity {
        width: 100%;
    }

    .ndlp-student-progress-area {
        grid-column: 1;
    }

    .ndlp-student-section {
        padding-top: 20px;
    }

    .ndlp-student-section + .ndlp-student-section {
        margin-top: 20px;
    }

    .ndlp-device-fields,
    .ndlp-evidence-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ndlp-evidence-card:last-child {
        grid-column: auto;
        width: 100%;
        justify-self: stretch;
    }

    .ndlp-student-action-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .ndlp-student-action-buttons {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ndlp-student-save {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .ndlp-student-hero-main {
        align-items: flex-start;
    }

    .ndlp-student-hero-icon {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    .ndlp-student-hero-copy h2 {
        font-size: 1.2rem;
    }

    .ndlp-student-hero-copy p {
        font-size: 0.7rem;
        line-height: 1.4;
    }

    .ndlp-student-progress-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .ndlp-student-section-head {
        align-items: flex-start;
    }

    .ndlp-student-section-head strong {
        font-size: 0.94rem;
    }

    .ndlp-device-field {
        padding: 12px;
    }

    .ndlp-evidence-card {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 9px 10px;
        padding: 11px;
    }

    .ndlp-evidence-card-head {
        grid-column: 1 / -1;
    }

    .ndlp-evidence-preview {
        grid-column: 1;
        grid-row: 2;
        aspect-ratio: 1 / 1;
        margin-top: 0;
    }

    .ndlp-evidence-preview.is-empty {
        padding: 8px;
    }

    .ndlp-evidence-preview.is-empty strong {
        margin-top: 5px;
        font-size: 0.64rem;
    }

    .ndlp-evidence-preview.is-empty small {
        display: none;
    }

    .ndlp-evidence-empty-icon {
        width: 34px;
        height: 34px;
    }

    .ndlp-evidence-preview-action {
        right: 4px;
        bottom: 4px;
        padding: 4px;
    }

    .ndlp-evidence-preview-action span {
        display: none;
    }

    .ndlp-evidence-actions {
        grid-column: 2;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr);
        margin-top: 0;
    }

    .ndlp-evidence-action {
        justify-content: flex-start;
        min-height: 48px;
        padding: 7px 10px;
    }

    .ndlp-evidence-file-label {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .ndlp-student-action-bar {
        margin-top: 20px;
        padding: 11px;
    }

    .ndlp-action-summary small {
        line-height: 1.35;
    }

    .ndlp-student-refresh,
    .ndlp-student-save {
        min-height: 48px;
        padding: 0 12px;
    }

    .ndlp-student-refresh span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ndlp-student-progress-track span,
    .ndlp-evidence-card,
    .ndlp-evidence-action,
    .ndlp-student-refresh,
    .ndlp-student-save {
        transition: none;
    }
}

/* NDLP-Tablet: staff registration review */
.ndlp-admin-shell,
.ndlp-admin-shell * {
    box-sizing: border-box;
}

.ndlp-admin-shell {
    width: min(100%, 1420px);
    margin: 0 auto;
    padding: 18px 16px 36px;
    color: #172033;
}

.ndlp-admin-hero {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(560px, 1.35fr);
    align-items: center;
    gap: 20px;
    padding: 18px;
    border: 1px solid #cae7f2;
    border-left: 5px solid #0891b2;
    border-radius: 8px;
    background: #f1fbfd;
}

.ndlp-admin-hero-title,
.ndlp-admin-summary-item,
.ndlp-admin-section-head,
.ndlp-admin-room-card,
.ndlp-admin-room-meta,
.ndlp-admin-room-detail-head,
.ndlp-admin-room-help,
.ndlp-admin-student-head,
.ndlp-admin-record-status,
.ndlp-admin-record-progress,
.ndlp-admin-missing,
.ndlp-admin-student-actions,
.ndlp-admin-student-actions button {
    display: flex;
    align-items: center;
}

.ndlp-admin-hero-title {
    min-width: 0;
    gap: 14px;
}

.ndlp-admin-hero-icon {
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid #b8e5ef;
    border-radius: 8px;
    background: #ffffff;
    color: #0891b2;
    font-size: 1.65rem;
    box-shadow: 0 5px 14px rgba(8, 145, 178, 0.12);
}

.ndlp-admin-hero-copy,
.ndlp-admin-hero-copy small,
.ndlp-admin-hero-copy strong,
.ndlp-admin-hero-copy em {
    display: block;
    min-width: 0;
}

.ndlp-admin-hero-copy small {
    color: #0e7490;
    font-size: 0.7rem;
    font-weight: 700;
}

.ndlp-admin-hero-copy strong {
    color: #0f172a;
    font-size: 1.52rem;
    font-weight: 900;
    line-height: 1.2;
}

.ndlp-admin-hero-copy em {
    margin-top: 3px;
    color: #526179;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 650;
    line-height: 1.4;
}

.ndlp-admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ndlp-admin-summary-item {
    min-width: 0;
    min-height: 62px;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce5eb;
    border-radius: 7px;
    background: #ffffff;
}

.ndlp-admin-summary-item > i {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 7px;
    font-size: 0.92rem;
}

.ndlp-admin-summary-item.total > i {
    background: #e0f2fe;
    color: #0369a1;
}

.ndlp-admin-summary-item.complete > i {
    background: #e8faf3;
    color: #0f7a59;
}

.ndlp-admin-summary-item.incomplete > i {
    background: #fff4df;
    color: #a35408;
}

.ndlp-admin-summary-item.rooms > i {
    background: #f1eefe;
    color: #6d4bc3;
}

.ndlp-admin-summary-item span,
.ndlp-admin-summary-item strong,
.ndlp-admin-summary-item small {
    display: block;
    min-width: 0;
}

.ndlp-admin-summary-item strong {
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
}

.ndlp-admin-summary-item small {
    margin-top: 2px;
    overflow: hidden;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #ffffff;
}

.ndlp-admin-search-wrap {
    position: relative;
    min-width: 0;
}

.ndlp-admin-search-wrap > i {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #0891b2;
    transform: translateY(-50%);
    pointer-events: none;
}

.ndlp-admin-search-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 43px;
    border: 1px solid #cbd8e3;
    border-radius: 7px;
    outline: none;
    background: #f8fafc;
    color: #172033;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ndlp-admin-search-wrap input:focus {
    border-color: #0891b2;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.13);
}

.ndlp-admin-search-wrap input::placeholder {
    color: #8794a6;
    font-weight: 600;
}

.ndlp-admin-search-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: #e9eef3;
    color: #526179;
    cursor: pointer;
    transform: translateY(-50%);
}

.ndlp-admin-search-clear:hover {
    background: #dff4f8;
    color: #0e7490;
}

.ndlp-admin-search-count {
    min-width: 105px;
    align-self: center;
    color: #0e7490;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: right;
}

.ndlp-admin-status-filter {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 600px);
}

.ndlp-admin-filter-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    min-height: 42px;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #d7e0e7;
    border-radius: 7px;
    background: #f8fafc;
    color: #526179;
    font: inherit;
    font-size: 0.69rem;
    font-weight: 800;
    cursor: pointer;
}

.ndlp-admin-filter-button span {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-filter-button strong {
    min-width: 25px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #e8edf2;
    color: #334155;
    text-align: center;
}

.ndlp-admin-filter-button.is-active {
    border-color: #7dd3e2;
    background: #eaf9fc;
    color: #0e7490;
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.08);
}

.ndlp-admin-filter-button.complete.is-active {
    border-color: #91ddc1;
    background: #edfbf5;
    color: #0f7a59;
}

.ndlp-admin-filter-button.incomplete.is-active {
    border-color: #f0c986;
    background: #fff8e9;
    color: #9a4f08;
}

.ndlp-admin-search-results,
.ndlp-admin-room-browser,
.ndlp-admin-room-detail {
    margin-top: 18px;
}

.ndlp-admin-section-head {
    min-width: 0;
    gap: 11px;
    margin-bottom: 13px;
}

.ndlp-admin-section-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid;
    border-radius: 7px;
}

.ndlp-admin-section-icon.rooms {
    border-color: #c9bdf2;
    background: #f3f0fe;
    color: #6d4bc3;
}

.ndlp-admin-section-icon.search {
    border-color: #afe2eb;
    background: #ebfafc;
    color: #0e7490;
}

.ndlp-admin-section-copy {
    min-width: 0;
    flex: 1;
}

.ndlp-admin-section-copy strong,
.ndlp-admin-section-copy small {
    display: block;
}

.ndlp-admin-section-copy strong {
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
}

.ndlp-admin-section-copy small {
    margin-top: 1px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.35;
}

.ndlp-admin-section-count {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid #dce5eb;
    border-radius: 6px;
    background: #ffffff;
    color: #526179;
    font-size: 0.68rem;
    font-weight: 800;
}

.ndlp-admin-room-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ndlp-admin-room-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 116px;
    gap: 7px 10px;
    padding: 13px;
    border: 1px solid #d9e2e8;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.ndlp-admin-room-card:hover,
.ndlp-admin-room-card.is-selected {
    border-color: #67cadc;
    box-shadow: 0 7px 17px rgba(8, 145, 178, 0.11);
    transform: translateY(-1px);
}

.ndlp-admin-room-icon {
    display: grid;
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: #0ea5c6;
    color: #ffffff;
    font-size: 1.08rem;
    box-shadow: 0 5px 10px rgba(14, 165, 198, 0.18);
}

.ndlp-admin-room-copy {
    min-width: 0;
    align-self: center;
}

.ndlp-admin-room-copy strong,
.ndlp-admin-room-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-room-copy strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 900;
}

.ndlp-admin-room-copy small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 650;
}

.ndlp-admin-room-chevron {
    color: #94a3b8;
    font-size: 0.7rem;
}

.ndlp-admin-room-progress {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 4px;
    background: #e8edf2;
}

.ndlp-admin-room-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #10a879;
}

.ndlp-admin-room-meta {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 700;
}

.ndlp-admin-room-meta em {
    overflow: hidden;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-room-meta strong {
    color: #0f7a59;
    font-size: 0.65rem;
}

.ndlp-admin-empty {
    display: grid;
    min-height: 220px;
    padding: 30px;
    place-items: center;
    align-content: center;
    border: 1px dashed #c6d2dc;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
}

.ndlp-admin-empty.compact {
    grid-column: 1 / -1;
    min-height: 170px;
}

.ndlp-admin-empty > i {
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 2rem;
}

.ndlp-admin-empty strong,
.ndlp-admin-empty small {
    display: block;
}

.ndlp-admin-empty strong {
    color: #334155;
    font-size: 0.92rem;
    font-weight: 900;
}

.ndlp-admin-empty small {
    margin-top: 3px;
    font-size: 0.68rem;
    font-weight: 650;
}

.ndlp-admin-empty button {
    min-height: 40px;
    margin-top: 13px;
    padding: 0 14px;
    border: 1px solid #9edce7;
    border-radius: 7px;
    background: #eaf9fc;
    color: #0e7490;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.ndlp-admin-room-detail {
    padding: 15px;
    border: 1px solid #cce6ef;
    border-left: 5px solid #0ea5c6;
    border-radius: 8px;
    background: #f2fbfd;
}

.ndlp-admin-room-detail-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    gap: 10px;
}

.ndlp-admin-room-back,
.ndlp-admin-room-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #cbd8e3;
    border-radius: 7px;
    background: #ffffff;
    color: #526179;
    font: inherit;
    cursor: pointer;
}

.ndlp-admin-room-back {
    gap: 7px;
    padding: 0 12px;
    font-size: 0.68rem;
    font-weight: 800;
}

.ndlp-admin-room-close {
    width: 42px;
}

.ndlp-admin-room-back:hover,
.ndlp-admin-room-close:hover {
    border-color: #8fd2df;
    color: #0e7490;
}

.ndlp-admin-room-detail-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: #0ea5c6;
    color: #ffffff;
    font-size: 1.15rem;
}

.ndlp-admin-room-detail-copy {
    min-width: 0;
}

.ndlp-admin-room-detail-copy small,
.ndlp-admin-room-detail-copy strong,
.ndlp-admin-room-detail-copy em,
.ndlp-admin-room-detail-progress strong,
.ndlp-admin-room-detail-progress small {
    display: block;
}

.ndlp-admin-room-detail-copy small {
    color: #0e7490;
    font-size: 0.58rem;
    font-weight: 750;
}

.ndlp-admin-room-detail-copy strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-room-detail-copy em {
    color: #64748b;
    font-size: 0.64rem;
    font-style: normal;
    font-weight: 650;
}

.ndlp-admin-room-detail-progress {
    min-width: 92px;
    padding: 6px 10px;
    border: 1px solid #b7e0cb;
    border-radius: 7px;
    background: #ffffff;
    text-align: center;
}

.ndlp-admin-room-detail-progress strong {
    color: #0f7a59;
    font-size: 0.9rem;
    font-weight: 900;
}

.ndlp-admin-room-detail-progress small {
    color: #64748b;
    font-size: 0.54rem;
    font-weight: 650;
}

.ndlp-admin-room-help {
    gap: 7px;
    margin: 12px 0;
    padding: 8px 10px;
    border: 1px solid #bce8d2;
    border-radius: 7px;
    background: #effbf5;
    color: #167553;
    font-size: 0.64rem;
    font-weight: 700;
}

.ndlp-admin-room-help i {
    color: #08a050;
    font-size: 1rem;
}

.ndlp-admin-student-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ndlp-admin-student-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid #d9e2e8;
    border-top: 4px solid #e0a33b;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.ndlp-admin-student-card.is-complete {
    border-top-color: #10a879;
}

.ndlp-admin-student-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
}

.ndlp-admin-student-head > img {
    width: 54px;
    height: 54px;
    border: 2px solid #dce5eb;
    border-radius: 8px;
    background: #e8edf2;
    object-fit: cover;
}

.ndlp-admin-student-identity {
    min-width: 0;
}

.ndlp-admin-student-identity small,
.ndlp-admin-student-identity strong,
.ndlp-admin-student-identity em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-student-identity small {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 5px;
    background: #e6f7fb;
    color: #0e7490;
    font-size: 0.56rem;
    font-weight: 800;
}

.ndlp-admin-student-identity strong {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 900;
}

.ndlp-admin-student-identity em {
    margin-top: 1px;
    color: #64748b;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 650;
}

.ndlp-admin-record-status {
    align-self: start;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.ndlp-admin-record-status.is-complete {
    background: #e8faf3;
    color: #0f7a59;
}

.ndlp-admin-record-status.is-incomplete {
    background: #fff4df;
    color: #9a4f08;
}

.ndlp-admin-device-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 11px;
    padding: 9px 0;
    border-top: 1px solid #e2e8ee;
    border-bottom: 1px solid #e2e8ee;
}

.ndlp-admin-device-data > span {
    min-width: 0;
}

.ndlp-admin-device-data small,
.ndlp-admin-device-data strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-device-data small {
    color: #7a8799;
    font-size: 0.55rem;
    font-weight: 700;
}

.ndlp-admin-device-data small i {
    width: 15px;
    color: #0891b2;
}

.ndlp-admin-device-data strong {
    margin-top: 2px;
    color: #24344d;
    font-size: 0.7rem;
    font-weight: 850;
}

.ndlp-admin-record-progress {
    gap: 8px;
    margin-top: 9px;
}

.ndlp-admin-record-progress > span {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 4px;
    background: #e7edf2;
}

.ndlp-admin-record-progress > span i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #e0a33b;
}

.ndlp-admin-student-card.is-complete .ndlp-admin-record-progress > span i {
    background: #10a879;
}

.ndlp-admin-record-progress > strong {
    min-width: 30px;
    color: #526179;
    font-size: 0.6rem;
    font-weight: 900;
    text-align: right;
}

.ndlp-admin-missing {
    gap: 6px;
    margin-top: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    background: #fff7e8;
    color: #965012;
    font-size: 0.6rem;
    font-weight: 650;
    line-height: 1.35;
}

.ndlp-admin-missing > i {
    flex: 0 0 auto;
}

.ndlp-admin-missing strong {
    font-weight: 900;
}

.ndlp-admin-evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.ndlp-admin-evidence-thumb {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-width: 0;
    overflow: hidden;
    place-items: center;
    border: 1px solid #d4dee6;
    border-radius: 7px;
    background: #f5f7f9;
    color: #64748b;
    font: inherit;
}

button.ndlp-admin-evidence-thumb {
    padding: 0;
    cursor: pointer;
}

.ndlp-admin-evidence-thumb.is-empty {
    align-content: center;
    border-style: dashed;
    color: #8995a5;
}

.ndlp-admin-evidence-thumb.is-empty i {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.ndlp-admin-evidence-thumb.is-empty span {
    font-size: 0.54rem;
    font-weight: 700;
}

.ndlp-admin-evidence-thumb.has-image img {
    width: 100%;
    height: 100%;
    background: #e8edf2;
    object-fit: contain;
}

.ndlp-admin-evidence-thumb.has-image > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 8px);
    padding: 3px 5px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.84);
    color: #ffffff;
    font-size: 0.49rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndlp-admin-student-actions {
    justify-content: space-between;
    gap: 9px;
    margin-top: 10px;
}

.ndlp-admin-student-actions > span {
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 700;
}

.ndlp-admin-student-actions > span i {
    margin-right: 5px;
    color: #7c3aed;
}

.ndlp-admin-student-actions button {
    min-height: 38px;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid #9bdfba;
    border-radius: 7px;
    background: #edfbf4;
    color: #087a3c;
    font: inherit;
    font-size: 0.63rem;
    font-weight: 850;
    cursor: pointer;
}

.ndlp-admin-student-actions button:hover {
    border-color: #23aa63;
    background: #11a855;
    color: #ffffff;
}

.ndlp-admin-filter-button:focus-visible,
.ndlp-admin-search-clear:focus-visible,
.ndlp-admin-room-card:focus-visible,
.ndlp-admin-room-back:focus-visible,
.ndlp-admin-room-close:focus-visible,
.ndlp-admin-evidence-thumb:focus-visible,
.ndlp-admin-student-actions button:focus-visible {
    outline: 3px solid rgba(8, 145, 178, 0.25);
    outline-offset: 2px;
}

@media (max-width: 1180px) {
    .ndlp-admin-hero {
        grid-template-columns: minmax(260px, 0.8fr) minmax(490px, 1.3fr);
    }

    .ndlp-admin-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ndlp-admin-room-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .ndlp-admin-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .ndlp-admin-room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ndlp-admin-student-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .ndlp-admin-shell {
        padding: 10px 8px 26px;
    }

    .ndlp-admin-hero {
        gap: 14px;
        padding: 14px;
    }

    .ndlp-admin-hero-icon {
        flex-basis: 50px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .ndlp-admin-hero-copy strong {
        font-size: 1.22rem;
    }

    .ndlp-admin-summary-item {
        min-height: 58px;
        padding: 8px;
    }

    .ndlp-admin-summary-item > i {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .ndlp-admin-tools {
        grid-template-columns: minmax(0, 1fr);
        padding: 10px;
    }

    .ndlp-admin-search-count {
        display: none;
    }

    .ndlp-admin-status-filter {
        grid-column: 1;
        gap: 5px;
    }

    .ndlp-admin-filter-button {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 5px;
        padding: 6px;
        font-size: 0.62rem;
    }

    .ndlp-admin-filter-button strong {
        grid-column: 1 / -1;
        width: 100%;
        padding: 1px 4px;
    }

    .ndlp-admin-section-copy small {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .ndlp-admin-room-grid {
        gap: 8px;
    }

    .ndlp-admin-room-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 118px;
        gap: 6px 8px;
        padding: 10px;
    }

    .ndlp-admin-room-icon {
        grid-row: auto;
        width: 38px;
        height: 38px;
        font-size: 0.96rem;
    }

    .ndlp-admin-room-chevron {
        display: none;
    }

    .ndlp-admin-room-progress,
    .ndlp-admin-room-meta {
        grid-column: 1 / -1;
    }

    .ndlp-admin-room-copy strong {
        font-size: 0.78rem;
    }

    .ndlp-admin-room-copy small {
        font-size: 0.54rem;
    }

    .ndlp-admin-room-detail {
        padding: 11px;
    }

    .ndlp-admin-room-detail-head {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
    }

    .ndlp-admin-room-back {
        width: 42px;
        padding: 0;
    }

    .ndlp-admin-room-back span,
    .ndlp-admin-room-close {
        display: none;
    }

    .ndlp-admin-room-detail-icon {
        width: 42px;
        height: 42px;
    }

    .ndlp-admin-room-detail-progress {
        min-width: 74px;
        padding: 5px 7px;
    }

    .ndlp-admin-room-help {
        align-items: flex-start;
        line-height: 1.4;
    }

    .ndlp-admin-student-card {
        padding: 11px;
    }

    .ndlp-admin-student-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ndlp-admin-record-status {
        grid-column: 2;
        width: fit-content;
        margin-top: 3px;
    }

    .ndlp-admin-device-data {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .ndlp-admin-evidence-thumb {
        aspect-ratio: 1.25 / 1;
    }

    .ndlp-admin-evidence-thumb.has-image > span {
        right: 3px;
        bottom: 3px;
        padding: 3px;
    }

    .ndlp-admin-evidence-thumb.has-image > span i {
        display: none;
    }
}

@media (max-width: 380px) {
    .ndlp-admin-hero-title {
        align-items: flex-start;
    }

    .ndlp-admin-summary-item small {
        white-space: normal;
    }

    .ndlp-admin-room-card {
        padding: 8px;
    }

    .ndlp-admin-room-icon {
        width: 34px;
        height: 34px;
    }

    .ndlp-admin-room-detail-icon {
        display: none;
    }

    .ndlp-admin-room-detail-head {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ndlp-admin-room-card,
    .ndlp-admin-search-wrap input {
        transition: none;
    }
}

/* Subject teaching media */
.quick-subject-media-button {
    border-color: #bae6fd !important;
    background: #f0fdfa;
    isolation: isolate;
}

.quick-subject-media-button::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(16, 185, 129, 0.05) 55%, rgba(245, 158, 11, 0.08));
}

.quick-subject-media-animation {
    position: relative;
    z-index: 2;
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    place-items: center;
    margin-bottom: 8px;
}

.quick-subject-media-icon {
    position: relative;
    z-index: 3;
    display: block;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    box-shadow: 0 6px 14px rgba(8, 145, 178, 0.24);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-subject-media-button:hover .quick-subject-media-icon {
    transform: translateY(-2px);
    box-shadow: 0 9px 18px rgba(8, 145, 178, 0.3);
}

.quick-subject-media-mode {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    opacity: 0;
    animation: subjectMediaModeSwitch 5.2s ease-in-out infinite;
}

.quick-subject-media-image {
    animation-delay: 0s;
}

.quick-subject-media-video {
    animation-delay: 2.6s;
}

@keyframes subjectMediaModeSwitch {
    0%, 42% { opacity: 1; transform: translateY(0) scale(1); }
    48%, 94% { opacity: 0; transform: translateY(-6px) scale(0.82); }
    95% { opacity: 0; transform: translateY(6px) scale(0.82); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.subject-media-shell {
    width: min(1380px, 100%);
    margin: 0 auto;
    padding: 2px 2px 42px;
    color: #172033;
}

.subject-media-header {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border: 1px solid #bae6fd;
    border-left: 7px solid #0891b2;
    border-radius: 8px;
    background: #f8fdff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.subject-media-title-wrap {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
}

.subject-media-title-icon {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    place-items: center;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 18px rgba(8, 145, 178, 0.22);
}

.subject-media-eyebrow {
    margin: 0 0 3px;
    color: #0e7490;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.subject-media-title-wrap h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 950;
    line-height: 1.15;
}

.subject-media-title-wrap > div > p:last-child {
    margin: 6px 0 0;
    color: #5b6474;
    font-size: 0.96rem;
    font-weight: 650;
}

.subject-media-refresh-button {
    display: inline-flex;
    min-height: 46px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    background: #fff;
    color: #0e7490;
    font-weight: 900;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.subject-media-refresh-button:hover {
    transform: translateY(-1px);
    border-color: #0891b2;
    box-shadow: 0 7px 14px rgba(8, 145, 178, 0.13);
}

.subject-media-content {
    margin-top: 18px;
}

.subject-media-loading-state,
.subject-media-empty-state {
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 36px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    text-align: center;
}

.subject-media-loading-state > i,
.subject-media-empty-state > i {
    color: #0891b2;
    font-size: 2.7rem;
}

.subject-media-loading-state strong,
.subject-media-empty-state h3 {
    margin: 5px 0 0;
    color: #172033;
    font-size: 1.25rem;
    font-weight: 950;
}

.subject-media-loading-state span,
.subject-media-empty-state p {
    margin: 0;
    max-width: 540px;
    font-weight: 650;
}

.subject-media-empty-state button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0 16px;
    border: 1px solid #0891b2;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    font-weight: 900;
}

.subject-media-empty-state.is-error > i { color: #dc2626; }

.subject-media-empty-state.compact {
    min-height: 250px;
    grid-column: 1 / -1;
}

.subject-media-picker-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 20px;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    background: #fff;
}

.subject-media-picker-copy {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.subject-media-picker-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 8px;
    background: #ecfeff;
    color: #0891b2;
    font-size: 1.3rem;
}

.subject-media-picker-copy label {
    display: block;
    color: #172033;
    font-size: 1.05rem;
    font-weight: 950;
}

.subject-media-picker-copy p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 650;
}

.subject-media-picker-band select {
    width: min(570px, 52%);
    min-height: 48px;
    padding: 0 42px 0 14px;
    border: 1px solid #b9c7d5;
    border-radius: 8px;
    background-color: #f8fafc;
    color: #172033;
    font-weight: 800;
}

.subject-media-action-band {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(420px, 1.25fr);
    align-items: stretch;
    gap: 14px;
    margin-top: 14px;
}

.subject-media-selected-subject {
    padding: 20px;
    border: 1px solid #a5f3fc;
    border-left: 6px solid #06b6d4;
    border-radius: 8px;
    background: #ecfeff;
}

.subject-media-selected-subject > span {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 5px;
    background: #cffafe;
    color: #0e7490;
    font-size: 0.78rem;
    font-weight: 950;
}

.subject-media-selected-subject h3 {
    margin: 9px 0 3px;
    color: #111827;
    font-size: 1.3rem;
    font-weight: 950;
    line-height: 1.25;
}

.subject-media-selected-subject p {
    margin: 0;
    color: #4b6470;
    font-size: 0.88rem;
    font-weight: 700;
}

.subject-media-create-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.subject-media-add-button {
    display: flex;
    min-width: 0;
    min-height: 116px;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid;
    border-radius: 8px;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.subject-media-add-button:hover { transform: translateY(-2px); }

.subject-media-add-button > i {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 1.55rem;
}

.subject-media-add-button span { min-width: 0; }
.subject-media-add-button strong,
.subject-media-add-button small { display: block; }
.subject-media-add-button strong { color: #172033; font-size: 0.98rem; font-weight: 950; line-height: 1.25; }
.subject-media-add-button small { margin-top: 3px; color: #64748b; font-size: 0.78rem; font-weight: 700; }

.subject-media-add-button.youtube { border-color: #fecaca; background: #fff7f7; }
.subject-media-add-button.youtube > i { background: #dc2626; box-shadow: 0 7px 15px rgba(220, 38, 38, 0.2); }
.subject-media-add-button.youtube:hover { box-shadow: 0 9px 18px rgba(220, 38, 38, 0.12); }
.subject-media-add-button.slides { border-color: #bfdbfe; background: #f5f9ff; }
.subject-media-add-button.slides > i { background: #2563eb; box-shadow: 0 7px 15px rgba(37, 99, 235, 0.2); }
.subject-media-add-button.slides:hover { box-shadow: 0 9px 18px rgba(37, 99, 235, 0.12); }

.subject-media-summary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.subject-media-summary-row > div {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 750;
}

.subject-media-summary-row i { color: #0891b2; }
.subject-media-summary-row > div:nth-child(2) i { color: #059669; }
.subject-media-summary-row > div:nth-child(3) i { color: #dc2626; }
.subject-media-summary-row > div:nth-child(4) i { color: #2563eb; }
.subject-media-summary-row strong { color: #172033; font-size: 1.05rem; font-weight: 950; }

.subject-media-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 0 13px;
    border-top: 1px solid #e2e8f0;
}

.subject-media-list-toolbar h3 { margin: 0; color: #172033; font-size: 1.22rem; font-weight: 950; }
.subject-media-list-toolbar p { margin: 2px 0 0; color: #64748b; font-size: 0.84rem; font-weight: 650; }

.subject-media-search-field {
    display: flex;
    width: min(390px, 42%);
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
}

.subject-media-search-field:focus-within { border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.11); }
.subject-media-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #172033; font-weight: 700; }

.subject-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.subject-media-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #dbe4eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
}

.subject-media-card.is-published { border-top: 4px solid #10b981; }
.subject-media-card.is-draft { border-top: 4px solid #94a3b8; }

.subject-media-card-preview {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 0;
    background: #0f172a;
}

.subject-media-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 280ms ease;
}

.subject-media-card-preview:hover img { transform: scale(1.035); }

.subject-media-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: #dbeafe;
    color: #2563eb;
    font-size: 3rem;
}

.subject-media-preview-type {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.86);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.subject-media-preview-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255,255,255,0.75);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 7px 18px rgba(0,0,0,0.28);
}

.subject-media-card-preview.youtube .subject-media-preview-play { background: rgba(220, 38, 38, 0.92); }
.subject-media-card-preview.slides .subject-media-preview-play { background: rgba(37, 99, 235, 0.9); }

.subject-media-card-body {
    display: flex;
    min-height: 185px;
    flex: 1;
    flex-direction: column;
    padding: 15px;
}

.subject-media-card-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.subject-media-publish-badge,
.subject-media-learning-label {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 900;
}

.subject-media-publish-badge.published { background: #dcfce7; color: #047857; }
.subject-media-publish-badge.draft { background: #f1f5f9; color: #64748b; }
.subject-media-learning-label { background: #ecfdf5; color: #047857; }
.subject-media-updated { color: #94a3b8; font-size: 0.68rem; font-weight: 750; }

.subject-media-card-body h4 {
    margin: 11px 0 6px;
    color: #111827;
    font-size: 1.08rem;
    font-weight: 950;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.subject-media-card-body > p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #596579;
    font-size: 0.85rem;
    font-weight: 620;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.subject-media-muted { color: #94a3b8; }
.subject-media-owner { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 13px; color: #718096; font-size: 0.74rem; font-weight: 750; }

.subject-media-card-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 55px;
    border-top: 1px solid #e2e8f0;
}

.subject-media-card-actions button {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 7px 3px;
    border-right: 1px solid #edf2f7;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 850;
}

.subject-media-card-actions button:last-child { border-right: 0; }
.subject-media-card-actions button:hover { background: #f8fafc; color: #0891b2; }
.subject-media-card-actions button.publish { color: #059669; }
.subject-media-card-actions button.unpublish { color: #d97706; }
.subject-media-card-actions button.delete { color: #dc2626; }

.subject-media-student-card-footer {
    display: flex;
    gap: 8px;
    padding: 0 15px 15px;
}

.subject-media-student-card-footer button {
    display: inline-flex;
    min-height: 45px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    font-weight: 900;
}

.subject-media-student-card-footer button.download {
    max-width: 48px;
    flex-basis: 48px;
    background: #f1f5f9;
    color: #475569;
}

.subject-media-course-band {
    display: grid;
    grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    background: #fff;
}

.subject-media-course-band-title h3 { margin: 0; color: #172033; font-size: 1.18rem; font-weight: 950; }
.subject-media-course-band-title p { margin: 3px 0 0; color: #64748b; font-size: 0.84rem; font-weight: 650; }

.subject-media-course-rail {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 9px;
    padding: 2px;
}

.subject-media-course-button {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 76px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    text-align: left;
}

.subject-media-course-button.active { border-color: #0891b2; background: #ecfeff; box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1); }
.subject-media-course-icon { display: grid; width: 42px; height: 42px; grid-row: 1 / span 2; place-items: center; border-radius: 8px; background: #fff; color: #0891b2; font-size: 1.1rem; }
.subject-media-course-button > span:not(.subject-media-course-icon) { min-width: 0; }
.subject-media-course-button small,
.subject-media-course-button strong { display: block; overflow: hidden; }
.subject-media-course-button small { color: #0891b2; font-size: 0.7rem; font-weight: 900; }
.subject-media-course-button strong {
    display: -webkit-box;
    color: #172033;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.subject-media-course-button em {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    padding: 4px 7px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 850;
    white-space: nowrap;
}
.subject-media-course-button.active em { background: #cffafe; color: #0e7490; }

.subject-media-student-subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 13px;
    padding: 0 2px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.subject-media-student-subject-header span { color: #0e7490; font-size: 0.78rem; font-weight: 950; }
.subject-media-student-subject-header h3 { margin: 2px 0; color: #172033; font-size: 1.35rem; font-weight: 950; }
.subject-media-student-subject-header p { margin: 0; color: #64748b; font-size: 0.8rem; font-weight: 650; }
.subject-media-student-subject-header > strong { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 8px; background: #ecfeff; color: #0e7490; font-size: 0.82rem; }

/* Editor */
.subject-media-form-popup { border-radius: 8px !important; }
.subject-media-form-popup .swal2-title { color: #172033; font-weight: 950; }
.subject-media-form { display: grid; gap: 13px; color: #172033; text-align: left; }
.subject-media-form > label > span:first-child { display: block; margin-bottom: 5px; color: #334155; font-size: 0.82rem; font-weight: 900; }
.subject-media-form em { color: #dc2626; font-style: normal; }
.subject-media-form input[type="text"],
.subject-media-form input[type="url"],
.subject-media-form select,
.subject-media-form textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #172033; font-weight: 700; outline: 0; }
.subject-media-form input[type="text"],
.subject-media-form input[type="url"],
.subject-media-form select { min-height: 46px; padding: 0 12px; }
.subject-media-form textarea { min-height: 94px; padding: 11px 12px; resize: vertical; }
.subject-media-form input:focus,
.subject-media-form select:focus,
.subject-media-form textarea:focus { border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.11); }
.subject-media-form label > small { display: block; margin-top: 5px; color: #64748b; font-size: 0.74rem; font-weight: 650; }

.subject-media-form-type { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid; border-radius: 8px; }
.subject-media-form-type > i { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 8px; color: #fff; font-size: 1.35rem; }
.subject-media-form-type strong,
.subject-media-form-type small { display: block; }
.subject-media-form-type strong { font-weight: 950; }
.subject-media-form-type small { margin-top: 2px; color: #64748b; font-size: 0.75rem; font-weight: 650; }
.subject-media-form-type.youtube { border-color: #fecaca; background: #fff7f7; }
.subject-media-form-type.youtube > i { background: #dc2626; }
.subject-media-form-type.slides { border-color: #bfdbfe; background: #f5f9ff; }
.subject-media-form-type.slides > i { background: #2563eb; }

.subject-media-file-picker { position: relative; display: flex; min-height: 100px; align-items: center; justify-content: center; gap: 13px; padding: 15px; border: 2px dashed #7dd3fc; border-radius: 8px; background: #f0f9ff; text-align: center; cursor: pointer; }
.subject-media-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.subject-media-file-picker-icon { display: grid !important; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; margin: 0 !important; border-radius: 8px; background: #0891b2; color: #fff !important; font-size: 1.25rem !important; }
.subject-media-file-picker strong,
.subject-media-file-picker small { display: block; }
.subject-media-file-picker strong { color: #172033; font-weight: 950; }
.subject-media-file-picker small { margin-top: 2px; color: #64748b; font-size: 0.73rem; font-weight: 650; }
.subject-media-file-summary { padding: 9px 11px; border-radius: 8px; background: #ecfdf5; color: #047857; font-size: 0.82rem; font-weight: 750; }
.subject-media-local-previews { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.subject-media-local-previews > span { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid #dbe5ec; border-radius: 6px; background: #f1f5f9; }
.subject-media-local-previews img { width: 100%; height: 100%; object-fit: cover; }
.subject-media-local-previews em { position: absolute; right: 3px; bottom: 3px; display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 4px; background: rgba(15,23,42,.82); color: #fff; font-size: .65rem; font-style: normal; }
.subject-media-local-previews .more { display: grid; place-items: center; color: #2563eb; font-weight: 950; }

.subject-media-existing-images { padding: 12px; border: 1px solid #dbe5ec; border-radius: 8px; background: #f8fafc; }
.subject-media-existing-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.subject-media-existing-title strong { font-size: 0.86rem; font-weight: 950; }
.subject-media-existing-title span { color: #64748b; font-size: 0.75rem; font-weight: 800; }
.subject-media-editor-images { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.subject-media-editor-image { position: relative; overflow: hidden; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
.subject-media-editor-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.subject-media-editor-image > span { position: absolute; top: 3px; left: 3px; display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 4px; background: rgba(15,23,42,.82); color: #fff; font-size: .65rem; font-weight: 900; }
.subject-media-editor-image > div { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #e2e8f0; }
.subject-media-editor-image button { min-height: 31px; color: #475569; font-size: .7rem; }
.subject-media-editor-image button:hover { background: #f1f5f9; color: #0891b2; }
.subject-media-editor-image button.delete { color: #dc2626; }
.subject-media-editor-image button:disabled { opacity: .25; cursor: not-allowed; }
.subject-media-editor-no-images { display: flex; min-height: 78px; align-items: center; justify-content: center; gap: 9px; color: #94a3b8; font-weight: 750; }

.subject-media-publish-option { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #a7f3d0; border-radius: 8px; background: #f0fdf4; cursor: pointer; }
.subject-media-publish-option input { position: absolute; opacity: 0; }
.subject-media-switch { position: relative; display: block !important; width: 45px; height: 25px; flex: 0 0 45px; margin: 0 !important; border-radius: 13px; background: #94a3b8; transition: background 180ms ease; }
.subject-media-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15,23,42,.22); transition: transform 180ms ease; }
.subject-media-publish-option input:checked + .subject-media-switch { background: #10b981; }
.subject-media-publish-option input:checked + .subject-media-switch::after { transform: translateX(20px); }
.subject-media-publish-option > span:last-child strong,
.subject-media-publish-option > span:last-child small { display: block; }
.subject-media-publish-option > span:last-child strong { color: #065f46; font-size: .86rem; font-weight: 950; }
.subject-media-publish-option > span:last-child small { color: #4b7163; font-size: .72rem; font-weight: 650; }
.subject-media-form-confirm { background: #0891b2 !important; font-weight: 900 !important; }
.subject-media-form-cancel { background: #e2e8f0 !important; color: #475569 !important; font-weight: 850 !important; }
.subject-media-upload-progress { padding: 7px 0 2px; }
.subject-media-upload-progress > div { height: 10px; overflow: hidden; border-radius: 5px; background: #e2e8f0; }
.subject-media-upload-progress > div span { display: block; width: 0; height: 100%; background: #0891b2; transition: width 180ms ease; }
.subject-media-upload-progress strong,
.subject-media-upload-progress small { display: block; }
.subject-media-upload-progress strong { margin-top: 11px; color: #172033; font-size: .9rem; }
.subject-media-upload-progress small { margin-top: 3px; color: #64748b; font-size: .75rem; }
.subject-media-upload-errors { max-height: 240px; overflow-y: auto; text-align: left; }
.subject-media-upload-errors p { margin: 4px 0; color: #991b1b; font-size: .8rem; }

/* Full-screen media viewer */
body.subject-media-viewer-open { overflow: hidden !important; }
.subject-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: flex;
    overflow-y: auto;
    flex-direction: column;
    background: #07111f;
    color: #fff;
    overscroll-behavior: contain;
}
.subject-media-viewer.hidden { display: none !important; }
.subject-media-viewer:fullscreen,
.subject-media-viewer:-webkit-full-screen,
.subject-media-viewer.is-immersive-fallback { width: 100%; height: 100%; background: #07111f; }
.subject-media-viewer-toolbar { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 22px; border-bottom: 1px solid rgba(255,255,255,.14); background: #0f1d2d; }
.subject-media-viewer-toolbar > div:first-child { min-width: 0; }
.subject-media-viewer-type { color: #67e8f9; font-size: .72rem; font-weight: 950; text-transform: uppercase; }
.subject-media-viewer-toolbar h3 { margin: 2px 0; overflow: hidden; color: #fff; font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.subject-media-viewer-toolbar p { margin: 0; color: #a9bbce; font-size: .8rem; font-weight: 650; }
.subject-media-viewer-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.subject-media-viewer-actions button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: #1e3146; color: #fff; font-weight: 850; }
.subject-media-viewer-actions button:last-child { width: 44px; padding: 0; background: #7f1d1d; }
.subject-media-viewer-actions button:hover { border-color: #67e8f9; }
.subject-media-viewer-actions button.is-active { border-color: #67e8f9; background: #0e7490; color: #fff; }
.subject-media-youtube-view,
.subject-media-slides-view { display: flex; width: 100%; min-height: 0; flex: 1; flex-direction: column; }
.subject-media-youtube-view.hidden,
.subject-media-slides-view.hidden { display: none !important; }
.subject-media-youtube-view { align-items: center; justify-content: center; gap: 15px; padding: 22px; }
.subject-media-video-frame { width: min(1180px, 100%); aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #000; box-shadow: 0 18px 55px rgba(0,0,0,.4); }
.subject-media-video-frame iframe { width: 100%; height: 100%; border: 0; }
.subject-media-viewer-description { width: min(1180px, 100%); padding: 13px 15px; border-left: 4px solid #22d3ee; border-radius: 5px; background: #112438; color: #d7e4ef; font-size: .9rem; font-weight: 620; line-height: 1.6; }
.subject-media-slides-view { min-height: calc(100vh - 88px); padding: 16px 20px 20px; }
.subject-media-slide-stage { position: relative; display: flex; min-height: 0; flex: 1; align-items: center; justify-content: center; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #020617; touch-action: pan-y; }
.subject-media-slide-stage.is-empty::before { content: 'ยังไม่มีรูปในชุดสไลด์นี้'; color: #94a3b8; font-weight: 800; }
.subject-media-slide-stage > img { display: block; width: 100%; height: 100%; max-height: calc(100vh - 250px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.subject-media-slide-nav { position: absolute; top: 50%; z-index: 3; display: grid; width: 50px; height: 64px; place-items: center; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(15,29,45,.82); color: #fff; font-size: 1.25rem; }
.subject-media-slide-nav.previous { left: 13px; }
.subject-media-slide-nav.next { right: 13px; }
.subject-media-slide-nav:hover { background: #0891b2; }
.subject-media-slide-counter { position: absolute; bottom: 12px; left: 50%; z-index: 3; transform: translateX(-50%); padding: 6px 10px; border-radius: 6px; background: rgba(15,23,42,.85); color: #fff; font-size: .78rem; font-weight: 900; }
.subject-media-slide-download { position: absolute; right: 13px; bottom: 12px; z-index: 3; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: rgba(15,29,45,.88); color: #fff; }
.subject-media-slide-thumbnails { display: flex; min-height: 78px; gap: 8px; overflow-x: auto; padding: 10px 1px 5px; scroll-snap-type: x proximity; }
.subject-media-slide-thumbnails button { position: relative; width: 92px; height: 62px; flex: 0 0 92px; overflow: hidden; border: 2px solid transparent; border-radius: 6px; background: #1e293b; opacity: .65; scroll-snap-align: center; }
.subject-media-slide-thumbnails button.active { border-color: #22d3ee; opacity: 1; }
.subject-media-slide-thumbnails img { width: 100%; height: 100%; object-fit: cover; }
.subject-media-slide-thumbnails span { position: absolute; right: 3px; bottom: 3px; display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 4px; background: rgba(15,23,42,.86); color: #fff; font-size: .62rem; font-weight: 900; }
.subject-media-slides-view > .subject-media-viewer-description { width: 100%; margin-top: 8px; }

@media (max-width: 1100px) {
    .subject-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .subject-media-action-band { grid-template-columns: 1fr; }
    .subject-media-editor-images { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .subject-media-shell { padding: 0 0 28px; }
    .subject-media-header { min-height: 0; align-items: flex-start; gap: 10px; padding: 14px; border-left-width: 5px; }
    .subject-media-title-wrap { align-items: flex-start; gap: 11px; }
    .subject-media-title-icon { width: 51px; height: 51px; flex-basis: 51px; font-size: 1.4rem; }
    .subject-media-eyebrow { font-size: .68rem; }
    .subject-media-title-wrap h2 { font-size: 1.45rem; }
    .subject-media-title-wrap > div > p:last-child { font-size: .78rem; line-height: 1.45; }
    .subject-media-refresh-button { width: 42px; min-height: 42px; padding: 0; }
    .subject-media-refresh-button span { display: none; }
    .subject-media-content { margin-top: 11px; }
    .subject-media-picker-band { align-items: stretch; flex-direction: column; gap: 11px; padding: 13px; }
    .subject-media-picker-icon { width: 42px; height: 42px; flex-basis: 42px; }
    .subject-media-picker-copy label { font-size: .96rem; }
    .subject-media-picker-copy p { font-size: .76rem; }
    .subject-media-picker-band select { width: 100%; min-height: 46px; font-size: .82rem; }
    .subject-media-action-band { gap: 9px; margin-top: 9px; }
    .subject-media-selected-subject { padding: 14px; }
    .subject-media-selected-subject h3 { font-size: 1.12rem; }
    .subject-media-create-actions { gap: 8px; }
    .subject-media-add-button { min-height: 104px; align-items: center; flex-direction: column; gap: 7px; padding: 11px 7px; text-align: center; }
    .subject-media-add-button > i { width: 44px; height: 44px; flex-basis: 44px; font-size: 1.25rem; }
    .subject-media-add-button strong { font-size: .83rem; }
    .subject-media-add-button small { font-size: .68rem; }
    .subject-media-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 9px 0; }
    .subject-media-summary-row > div { min-height: 50px; font-size: .77rem; }
    .subject-media-list-toolbar { align-items: stretch; flex-direction: column; gap: 9px; padding-top: 13px; }
    .subject-media-list-toolbar h3 { font-size: 1.08rem; }
    .subject-media-search-field { width: 100%; }
    .subject-media-grid { grid-template-columns: 1fr; gap: 11px; }
    .subject-media-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: stretch; }
    .subject-media-card-preview { height: 100%; min-height: 178px; aspect-ratio: auto; }
    .subject-media-preview-type { top: 7px; left: 7px; max-width: calc(100% - 14px); padding: 4px 6px; overflow: hidden; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
    .subject-media-preview-play { width: 42px; height: 42px; font-size: .95rem; }
    .subject-media-card-body { min-height: 178px; padding: 12px; }
    .subject-media-card-status-row { align-items: flex-start; flex-direction: column; gap: 4px; }
    .subject-media-updated { display: none; }
    .subject-media-card-body h4 { margin-top: 8px; font-size: .98rem; }
    .subject-media-card-body > p { font-size: .77rem; -webkit-line-clamp: 3; }
    .subject-media-owner { font-size: .66rem; }
    .subject-media-card-actions { grid-column: 1 / -1; }
    .subject-media-card-actions button { min-height: 52px; }
    .subject-media-student-card-footer { grid-column: 1 / -1; padding: 0 11px 11px; }
    .subject-media-student-card-footer button { min-height: 43px; font-size: .82rem; }
    .subject-media-course-band { display: block; padding: 13px; }
    .subject-media-course-band-title { margin-bottom: 10px; }
    .subject-media-course-rail { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .subject-media-course-button {
        min-width: 0;
        min-height: 58px;
        grid-template-columns: 32px minmax(0, 1fr) auto;
        align-content: center;
        gap: 8px;
        padding: 7px 9px;
    }
    .subject-media-course-icon { width: 32px; height: 32px; grid-row: 1; font-size: 0.85rem; }
    .subject-media-course-button small { font-size: 0.62rem; }
    .subject-media-course-button strong {
        font-size: 0.78rem;
        line-height: 1.25;
        -webkit-line-clamp: 1;
    }
    .subject-media-course-button em {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        justify-self: end;
        padding: 3px 6px;
        font-size: 0.62rem;
    }
    .subject-media-student-subject-header { align-items: flex-end; margin-top: 13px; }
    .subject-media-student-subject-header h3 { font-size: 1.12rem; }
    .subject-media-student-subject-header > strong { font-size: .73rem; }
    .subject-media-form-popup { width: calc(100% - 18px) !important; padding: 13px !important; }
    .subject-media-form-popup .swal2-title { padding: .55em .25em 0; font-size: 1.3rem; }
    .subject-media-form-popup .swal2-html-container { margin: 1em .1em .2em; }
    .subject-media-file-picker { min-height: 112px; flex-direction: column; gap: 7px; }
    .subject-media-local-previews { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .subject-media-editor-images { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .subject-media-publish-option { align-items: flex-start; }
    .subject-media-viewer-toolbar { min-height: 76px; padding: 10px 11px; }
    .subject-media-viewer-toolbar h3 { max-width: 54vw; font-size: 1rem; }
    .subject-media-viewer-toolbar p { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .subject-media-viewer-actions { gap: 5px; }
    .subject-media-viewer-actions button { width: 42px; min-height: 42px; padding: 0; }
    .subject-media-viewer-actions button span { display: none; }
    .subject-media-youtube-view { justify-content: flex-start; padding: 12px 8px; }
    .subject-media-video-frame { width: 100%; }
    .subject-media-viewer-description { padding: 11px; font-size: .8rem; }
    .subject-media-slides-view { min-height: calc(100dvh - 76px); padding: 8px 7px 10px; }
    .subject-media-slide-stage { min-height: 58dvh; }
    .subject-media-slide-stage > img { max-height: 67dvh; }
    .subject-media-slide-nav { width: 40px; height: 52px; font-size: 1rem; }
    .subject-media-slide-nav.previous { left: 7px; }
    .subject-media-slide-nav.next { right: 7px; }
    .subject-media-slide-download { right: 7px; bottom: 8px; width: 40px; height: 40px; }
    .subject-media-slide-counter { bottom: 8px; }
    .subject-media-slide-thumbnails { min-height: 67px; gap: 6px; padding-top: 7px; }
    .subject-media-slide-thumbnails button { width: 78px; height: 52px; flex-basis: 78px; }
}

@media (max-width: 430px) {
    .subject-media-title-wrap > div > p:last-child { display: none; }
    .subject-media-card { grid-template-columns: 112px minmax(0, 1fr); }
    .subject-media-card-preview,
    .subject-media-card-body { min-height: 166px; }
    .subject-media-card-actions span { font-size: .6rem; }
    .subject-media-editor-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 620px) {
    .subject-media-viewer-toolbar {
        min-height: 58px;
        padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
        gap: 10px;
    }

    .subject-media-viewer-type,
    .subject-media-viewer-toolbar p {
        display: none;
    }

    .subject-media-viewer-toolbar h3 {
        max-width: 52vw;
        margin: 0;
        font-size: 0.95rem;
    }

    .subject-media-viewer-actions {
        gap: 5px;
    }

    .subject-media-viewer-actions button {
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

    .subject-media-viewer-actions button span {
        display: none;
    }

    .subject-media-youtube-view {
        min-height: 0;
        justify-content: center;
        padding: 5px max(7px, env(safe-area-inset-right)) 5px max(7px, env(safe-area-inset-left));
    }

    .subject-media-youtube-view .subject-media-viewer-description {
        display: none;
    }

    .subject-media-video-frame {
        width: auto;
        height: calc(100dvh - 68px);
        max-width: 100%;
        max-height: calc(100dvh - 68px);
        aspect-ratio: 16 / 9;
    }

    .subject-media-slides-view {
        min-height: 0;
        height: calc(100dvh - 58px);
        padding: 5px max(7px, env(safe-area-inset-right)) 5px max(7px, env(safe-area-inset-left));
    }

    .subject-media-slide-stage {
        min-height: 0;
    }

    .subject-media-slide-stage > img {
        max-height: calc(100dvh - 126px);
    }

    .subject-media-slide-thumbnails {
        min-height: 58px;
        padding: 5px 1px 2px;
    }

    .subject-media-slide-thumbnails button {
        width: 72px;
        height: 48px;
        flex-basis: 72px;
    }

    .subject-media-slides-view > .subject-media-viewer-description {
        display: none;
    }

    .subject-media-slide-nav {
        width: 40px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-subject-media-mode { animation: none !important; }
    .quick-subject-media-image { opacity: 1; transform: none; }
    .quick-subject-media-video { opacity: 0; }
}

/* =========================================================
   SCHOOL TOURNAMENT BRACKETS
   ========================================================= */
.school-tournament-panel {
    padding: 0;
    overflow: hidden;
    background: #fff;
}

#view-tournaments {
    padding: 12px;
}

.school-tournaments-page-shell {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dbe7f0;
    border-radius: 8px;
    background: #fff;
}

.school-tournaments-page-header {
    display: flex;
    min-height: 104px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid #bae6fd;
    background: #f7fcff;
}

.school-tournaments-page-title,
.school-tournaments-page-actions,
.school-tournament-live-status,
.school-tournament-page-refresh {
    display: flex;
    align-items: center;
}

.school-tournaments-page-title {
    min-width: 0;
    gap: 14px;
}

.school-tournaments-page-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: #f59e0b;
    color: #fff;
    font-size: 1.65rem;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.2);
}

.school-tournaments-page-title > div { min-width: 0; }
.school-tournaments-page-title p { margin: 0 0 2px; color: #0284c7; font-size: 0.66rem; font-weight: 900; }
.school-tournaments-page-title h2 { margin: 0; color: #172033; font-size: 1.35rem; font-weight: 900; }
.school-tournaments-page-title div > span { display: block; margin-top: 3px; color: #64748b; font-size: 0.72rem; font-weight: 750; }

.school-tournaments-page-actions { flex: 0 0 auto; gap: 9px; }

.school-tournament-live-status {
    min-height: 44px;
    gap: 9px;
    border: 1px solid #a7f3d0;
    border-radius: 7px;
    padding: 7px 11px;
    background: #ecfdf5;
    color: #047857;
}

.school-tournament-live-status > div { display: flex; flex-direction: column; }
.school-tournament-live-status strong { font-size: 0.68rem; font-weight: 900; }
.school-tournament-live-status small { margin-top: 1px; color: #64748b; font-size: 0.55rem; font-weight: 750; }
.school-tournament-live-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); animation: schoolTournamentLivePulse 1.8s ease-in-out infinite; }
.school-tournament-live-status.syncing { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.school-tournament-live-status.syncing .school-tournament-live-dot { background: #0ea5e9; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12); }
.school-tournament-live-status.updated { border-color: #86efac; background: #dcfce7; color: #047857; }
.school-tournament-live-status.offline { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.school-tournament-live-status.offline .school-tournament-live-dot { background: #f97316; box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12); }

.school-tournament-page-refresh {
    min-height: 44px;
    justify-content: center;
    gap: 7px;
    border: 1px solid #bae6fd;
    border-radius: 7px;
    padding: 8px 12px;
    background: #fff;
    color: #0369a1;
    font-size: 0.68rem;
    font-weight: 900;
}
.school-tournament-page-refresh:hover { border-color: #38bdf8; background: #e0f2fe; }

@keyframes schoolTournamentLivePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.78); opacity: 0.58; }
}

.school-tournament-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.school-tournament-picker {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 9px;
}

.school-tournament-picker select {
    min-height: 44px;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 36px 8px 11px;
    background: #fff;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 800;
}

.school-tournament-empty-state .school-activity-primary-button {
    margin-top: 15px;
}

.school-tournament-workspace {
    background: #fff;
}

.school-tournament-header {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid #dbe7f0;
    background: #f8fafc;
}

.school-tournament-title-block {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.school-tournament-title-icon {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #ffedd5;
    color: #ea580c;
    font-size: 1.45rem;
}

.school-tournament-title-block > div {
    min-width: 0;
}

.school-tournament-title-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.school-tournament-title-line h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #172033;
    font-size: 1.12rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.school-tournament-status {
    display: inline-flex;
    min-height: 27px;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    border: 1px solid;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.61rem;
    font-weight: 900;
}

.school-tournament-status.draft { border-color: #cbd5e1; background: #fff; color: #64748b; }
.school-tournament-status.active { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }
.school-tournament-status.completed { border-color: #fcd34d; background: #fffbeb; color: #a16207; }

.school-tournament-title-block p {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 750;
}

.school-tournament-title-block p span { display: inline-flex; align-items: center; gap: 5px; }
.school-tournament-title-block p i { color: #0ea5e9; }
.school-tournament-title-block p .editors { color: #0f766e; }
.school-tournament-title-block p .editors i { color: #14b8a6; }
.school-tournament-title-block p .champion { color: #a16207; }
.school-tournament-title-block p .champion i { color: #eab308; }

.school-tournament-header-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.school-tournament-header-actions button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid;
    border-radius: 7px;
    padding: 7px 11px;
    background: #fff;
    font-size: 0.67rem;
    font-weight: 850;
}

.school-tournament-header-actions .edit { border-color: #bae6fd; color: #0369a1; }
.school-tournament-header-actions .access { border-color: #99f6e4; color: #0f766e; }
.school-tournament-header-actions .delete { border-color: #fecaca; color: #dc2626; }
.school-tournament-header-actions .edit:hover { background: #f0f9ff; }
.school-tournament-header-actions .access:hover { background: #f0fdfa; }
.school-tournament-header-actions .delete:hover { background: #fff1f2; }
.school-tournament-readonly { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 0.68rem; font-weight: 800; }

.school-tournament-access-modal {
    border-radius: 8px !important;
}

.school-tournament-access-modal .swal2-html-container {
    margin: 14px 22px 0;
    text-align: left;
}

.school-tournament-access-picker {
    color: #172033;
}

.school-tournament-access-owner {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 11px;
    background: #fffbeb;
}

.school-tournament-access-owner > span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 7px;
    background: #fef3c7;
    color: #d97706;
    font-size: 1.15rem;
}

.school-tournament-access-owner div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.school-tournament-access-owner small { color: #92400e; font-size: 0.68rem; font-weight: 750; }
.school-tournament-access-owner strong { overflow: hidden; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.school-tournament-access-owner b { border-radius: 999px; padding: 5px 9px; background: #fff; color: #a16207; font-size: 0.63rem; white-space: nowrap; }

.school-tournament-access-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
    border-left: 3px solid #38bdf8;
    padding: 8px 10px;
    background: #f0f9ff;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.5;
}

.school-tournament-access-note i { margin-top: 2px; color: #0284c7; }

.school-tournament-access-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.school-tournament-access-toolbar > label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 0 10px;
    background: #fff;
    color: #64748b;
}

.school-tournament-access-toolbar input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172033;
    font: inherit;
    font-size: 0.75rem;
}

.school-tournament-access-toolbar > div { display: flex; gap: 5px; }
.school-tournament-access-toolbar button {
    min-height: 40px;
    border: 1px solid #bae6fd;
    border-radius: 7px;
    padding: 6px 10px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: 0.65rem;
    font-weight: 850;
}

.school-tournament-access-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 1px 6px;
    color: #64748b;
    font-size: 0.67rem;
    font-weight: 800;
}

.school-tournament-access-summary strong { color: #0f766e; }

.school-tournament-access-list {
    display: grid;
    max-height: 350px;
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1px 4px 1px 1px;
}

.school-tournament-access-option {
    display: grid;
    grid-template-columns: 1px 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    border: 1px solid #dbe7f0;
    border-radius: 7px;
    padding: 8px 11px 8px 5px;
    background: #fff;
    cursor: pointer;
}

.school-tournament-access-option[hidden] { display: none; }
.school-tournament-access-option:hover { border-color: #7dd3fc; background: #f8fdff; }
.school-tournament-access-option > input { width: 1px; height: 1px; opacity: 0; }

.school-tournament-access-check {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.school-tournament-access-option > input:checked + .school-tournament-access-check {
    border-color: #14b8a6;
    background: #14b8a6;
    color: #fff;
}

.school-tournament-access-person {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.school-tournament-access-person strong { overflow: hidden; color: #172033; font-size: 0.79rem; text-overflow: ellipsis; white-space: nowrap; }
.school-tournament-access-person small { overflow: hidden; color: #64748b; font-size: 0.64rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.school-tournament-access-empty {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
}

.school-tournament-access-empty i { color: #14b8a6; font-size: 1.7rem; }
.school-tournament-access-empty strong { color: #334155; font-size: 0.83rem; }
.school-tournament-access-empty span { font-size: 0.66rem; }

.school-tournament-layout {
    display: grid;
    grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
    min-height: 610px;
}

.school-tournament-team-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border-right: 1px solid #dbe7f0;
    padding: 16px;
    background: #f8fafc;
}

.school-tournament-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid #dbe7f0;
}

.school-tournament-section-heading > div { display: flex; flex-direction: column; }
.school-tournament-section-heading span { color: #64748b; font-size: 0.65rem; font-weight: 800; }
.school-tournament-section-heading strong { margin-top: 2px; color: #172033; font-size: 1rem; font-weight: 900; }
.school-tournament-section-heading > i { color: #0ea5e9; font-size: 1.2rem; }

.school-tournament-add-team {
    padding: 13px 0;
}

.school-tournament-add-team label {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 850;
}

.school-tournament-add-team > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.school-tournament-add-team input {
    width: 100%;
    min-width: 0;
    min-height: 41px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: #172033;
    font-size: 0.72rem;
    font-weight: 750;
}

.school-tournament-add-team input:focus { border-color: #38bdf8; outline: 3px solid rgba(14, 165, 233, 0.12); }
.school-tournament-add-team button {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 6px;
    padding: 8px 11px;
    background: #0284c7;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
}

.school-tournament-add-team button:disabled,
.school-tournament-team-actions button:disabled { cursor: not-allowed; opacity: 0.45; }

.school-tournament-team-list {
    display: flex;
    min-height: 180px;
    max-height: 400px;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
    padding: 2px 3px 8px 0;
    scrollbar-width: thin;
}

.school-tournament-team-empty {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    text-align: center;
}

.school-tournament-team-empty i { margin-bottom: 8px; font-size: 1.35rem; }
.school-tournament-team-empty strong { color: #64748b; font-size: 0.75rem; }
.school-tournament-team-empty span { margin-top: 3px; font-size: 0.61rem; font-weight: 700; }

.school-tournament-team-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    border: 1px solid #dbe7f0;
    border-radius: 7px;
    padding: 6px 7px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
}

.school-tournament-seed {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.64rem;
    font-weight: 900;
}

.school-tournament-team-item > strong { overflow: hidden; color: #273449; font-size: 0.7rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.school-tournament-team-item > div { display: flex; gap: 3px; }
.school-tournament-team-item button { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 5px; font-size: 0.62rem; }
.school-tournament-team-item button.edit { background: #f0f9ff; color: #0284c7; }
.school-tournament-team-item button.delete { background: #fff1f2; color: #dc2626; }

.school-tournament-team-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid #dbe7f0;
}

.school-tournament-team-actions button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid;
    border-radius: 7px;
    padding: 8px;
    font-size: 0.67rem;
    font-weight: 900;
}

.school-tournament-team-actions .randomize { border-color: #fdba74; background: #fff7ed; color: #c2410c; }
.school-tournament-team-actions .reset { border-color: #fecaca; background: #fff; color: #dc2626; }
.school-tournament-team-actions .randomize:not(:disabled):hover { background: #ffedd5; }
.school-tournament-team-actions .reset:not(:disabled):hover { background: #fff1f2; }

body.school-tournament-draw-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.school-tournament-draw-reveal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 420px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: #07111f;
    color: #fff;
    font-family: 'Prompt', sans-serif;
    opacity: 0;
    isolation: isolate;
    letter-spacing: 0;
    transform: scale(1.025);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.school-tournament-draw-reveal:fullscreen,
.school-tournament-draw-reveal:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.school-tournament-draw-reveal.is-open { opacity: 1; transform: scale(1); }
.school-tournament-draw-reveal.is-closing { opacity: 0; transform: scale(0.985); }

.school-tournament-draw-backdrop,
.school-tournament-draw-backdrop::before,
.school-tournament-draw-backdrop::after,
.school-tournament-draw-plane,
.school-tournament-draw-light,
.school-tournament-draw-impact-line,
.school-tournament-draw-sparks {
    position: absolute;
    pointer-events: none;
}

.school-tournament-draw-backdrop {
    z-index: -1;
    inset: 0;
    overflow: hidden;
    background: #07111f;
}

.school-tournament-draw-backdrop::before {
    content: '';
    z-index: 4;
    inset: 0;
    background: repeating-linear-gradient(125deg, transparent 0 34px, rgba(255,255,255,0.035) 35px 36px, transparent 37px 72px);
    opacity: 0.7;
}

.school-tournament-draw-backdrop::after {
    content: '';
    z-index: 5;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 18%;
    background: linear-gradient(90deg, transparent, rgba(5, 12, 25, 0.88) 42%, rgba(5, 12, 25, 0.88) 58%, transparent);
    transform: translateX(-50%);
}

.school-tournament-draw-plane {
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 62%;
    transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.school-tournament-draw-plane.left {
    left: 0;
    background: linear-gradient(115deg, #04182f 0%, #075985 48%, #0ea5c9 100%);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
    transform: translateX(-105%);
}

.school-tournament-draw-plane.right {
    right: 0;
    background: linear-gradient(245deg, #310816 0%, #9f1239 52%, #ef4444 100%);
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(105%);
}

.school-tournament-draw-reveal.is-entering .school-tournament-draw-plane { transform: translateX(0); }

.school-tournament-draw-light {
    z-index: 3;
    top: 14%;
    width: 58%;
    height: 16%;
    opacity: 0;
    filter: blur(1px);
}

.school-tournament-draw-light.left {
    left: -16%;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.64), transparent);
    transform: rotate(-25deg) translateX(-45%);
}

.school-tournament-draw-light.right {
    right: -16%;
    background: linear-gradient(90deg, transparent, rgba(253, 164, 175, 0.62), transparent);
    transform: rotate(25deg) translateX(45%);
}

.school-tournament-draw-reveal.is-impact .school-tournament-draw-light.left { animation: school-tournament-draw-light-left 1.25s ease-out both; }
.school-tournament-draw-reveal.is-impact .school-tournament-draw-light.right { animation: school-tournament-draw-light-right 1.25s ease-out both; }

.school-tournament-draw-impact-line {
    z-index: 6;
    top: 8%;
    bottom: 8%;
    left: 50%;
    width: 4px;
    background: #f8d34d;
    box-shadow: 0 0 18px #f8d34d, 0 0 42px rgba(255, 255, 255, 0.8), 0 0 90px rgba(251, 191, 36, 0.72);
    opacity: 0;
    transform: translateX(-50%) scaleY(0.08);
}

.school-tournament-draw-reveal.is-impact .school-tournament-draw-impact-line { animation: school-tournament-draw-impact-line 0.78s cubic-bezier(0.2, 0.95, 0.28, 1) both; }

.school-tournament-draw-sparks {
    z-index: 7;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
}

.school-tournament-draw-sparks i {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 9px;
    height: 3px;
    background: #facc15;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--spark-rotate));
}

.school-tournament-draw-sparks i:nth-child(3n) { width: 5px; height: 5px; background: #fff; }
.school-tournament-draw-sparks i:nth-child(3n + 1) { background: #67e8f9; }
.school-tournament-draw-sparks i:nth-child(3n + 2) { background: #fb7185; }
.school-tournament-draw-reveal.is-impact .school-tournament-draw-sparks i { animation: school-tournament-draw-spark 0.9s cubic-bezier(0.1, 0.8, 0.25, 1) var(--spark-delay) both; }

.school-tournament-draw-header {
    position: relative;
    z-index: 20;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left));
}

.school-tournament-draw-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.school-tournament-draw-brand > span {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    clip-path: polygon(50% 0, 92% 22%, 92% 72%, 50% 100%, 8% 72%, 8% 22%);
    background: #facc15;
    color: #4a2600;
    font-size: 1.28rem;
    filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.3));
}

.school-tournament-draw-brand > div { display: flex; min-width: 0; flex-direction: column; }
.school-tournament-draw-brand small { color: #fde68a; font-size: 0.68rem; font-weight: 800; }
.school-tournament-draw-brand strong { max-width: min(68vw, 820px); overflow: hidden; color: #fff; font-size: 1.12rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }

.school-tournament-draw-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.school-tournament-draw-header-actions button {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 50%;
    background: rgba(5, 12, 25, 0.58);
    color: #fff;
    font-size: 1.12rem;
    backdrop-filter: blur(8px);
}

.school-tournament-draw-header-actions button:hover { border-color: #fff; background: rgba(3, 105, 161, 0.82); }
.school-tournament-draw-header-actions button[data-draw-action="close"]:hover { background: rgba(127, 29, 29, 0.8); }
.school-tournament-draw-header-actions button.is-muted { color: #fca5a5; }

.school-tournament-draw-main {
    position: relative;
    z-index: 12;
    display: grid;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0 max(4vw, 32px);
}

.school-tournament-draw-meta {
    display: grid;
    width: min(720px, 68vw);
    grid-template-columns: auto minmax(100px, 1fr) auto;
    align-items: center;
    justify-self: center;
    gap: 10px;
    color: rgba(255,255,255,0.78);
    font-size: 0.9rem;
    font-weight: 800;
}

.school-tournament-draw-meta > strong { color: #fef3c7; white-space: nowrap; }
.school-tournament-draw-progress { height: 7px; overflow: hidden; background: rgba(255,255,255,0.18); }
.school-tournament-draw-progress > i { display: block; width: 0; height: 100%; background: #facc15; transition: width 0.32s ease; }

.school-tournament-draw-arena {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.school-tournament-draw-team {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.72s cubic-bezier(0.16, 0.92, 0.24, 1);
}

.school-tournament-draw-team-a { transform: translateX(-24%) scale(0.9); }
.school-tournament-draw-team-b { transform: translateX(24%) scale(0.9); }
.school-tournament-draw-reveal.is-entering .school-tournament-draw-team { opacity: 1; transform: translateX(0) scale(1); }

.school-tournament-draw-mark {
    position: relative;
    display: grid;
    width: 132px;
    height: 112px;
    place-items: center;
    margin-bottom: 3px;
    overflow: visible;
    background: transparent;
    color: #fff;
    font-size: 2.1rem;
    font-style: normal;
    font-weight: 900;
    isolation: isolate;
    filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 12px 18px rgba(0,0,0,0.36));
    animation: school-tournament-draw-mark-glow 1.55s ease-in-out infinite;
}

.school-tournament-draw-mark::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: 105%;
    height: 3px;
    background: currentColor;
    opacity: 0.28;
    filter: blur(5px);
    transform: translate(-50%, -50%) scaleX(0.55);
    animation: school-tournament-draw-mark-ray 1.55s ease-in-out infinite;
}

.school-tournament-draw-mark i {
    position: relative;
    z-index: 2;
    font-size: 5rem;
    line-height: 1;
    -webkit-text-stroke: 1px rgba(255,255,255,0.72);
    text-shadow: 0 0 9px #fff, 0 0 22px currentColor, 0 0 42px currentColor;
    animation: school-tournament-draw-mark-icon 1.55s ease-in-out infinite;
}

.school-tournament-draw-team-a .school-tournament-draw-mark { color: #67e8f9; }
.school-tournament-draw-team-b .school-tournament-draw-mark { color: #fb7185; animation-delay: -0.75s; }
.school-tournament-draw-team-b .school-tournament-draw-mark i { transform: scaleX(-1); }
.school-tournament-draw-team > small { margin-bottom: 6px; color: rgba(255,255,255,0.78); font-size: 0.82rem; font-weight: 900; }

.school-tournament-draw-team h2 {
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: var(--draw-team-name-size, 6rem);
    font-weight: 900;
    line-height: 1.04;
    text-wrap: balance;
    text-shadow: 0 7px 24px rgba(0,0,0,0.54), 0 0 2px rgba(255,255,255,0.9);
}

.school-tournament-draw-team h2.name-long { line-height: 1.08; }
.school-tournament-draw-team h2.name-very-long { line-height: 1.12; }

.school-tournament-draw-versus {
    position: relative;
    display: grid;
    width: 150px;
    height: 150px;
    place-items: center;
    justify-self: center;
    opacity: 0;
    transform: rotate(45deg) scale(0.12);
}

.school-tournament-draw-versus::before,
.school-tournament-draw-versus::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #facc15;
    background: #0b1322;
    box-shadow: 0 0 28px rgba(250,204,21,0.68), inset 0 0 26px rgba(250,204,21,0.18);
}

.school-tournament-draw-versus::after { inset: 10px; border-width: 1px; background: transparent; }
.school-tournament-draw-versus strong { position: relative; z-index: 2; color: #fff7c2; font-size: 3.15rem; font-style: italic; font-weight: 900; transform: rotate(-45deg); text-shadow: 0 0 16px rgba(250,204,21,0.8); }
.school-tournament-draw-versus i,
.school-tournament-draw-versus span { position: absolute; z-index: 1; top: 50%; left: 50%; width: 180%; height: 3px; background: #fff; opacity: 0.75; transform: translate(-50%, -50%) rotate(-45deg); }
.school-tournament-draw-versus span { transform: translate(-50%, -50%) rotate(45deg); }
.school-tournament-draw-reveal.is-impact .school-tournament-draw-versus { animation: school-tournament-draw-vs 0.68s cubic-bezier(0.12, 0.88, 0.2, 1.22) both; }
.school-tournament-draw-reveal.is-bye .school-tournament-draw-versus::before { border-color: #67e8f9; box-shadow: 0 0 28px rgba(103,232,249,0.62), inset 0 0 26px rgba(103,232,249,0.18); }
.school-tournament-draw-reveal.is-bye .school-tournament-draw-team-b .school-tournament-draw-mark { color: #facc15; }

.school-tournament-draw-preparing,
.school-tournament-draw-complete {
    display: none;
    min-height: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.school-tournament-draw-reveal.is-preparing .school-tournament-draw-arena { display: none; }
.school-tournament-draw-reveal.is-preparing .school-tournament-draw-preparing { display: flex; animation: school-tournament-draw-complete 0.5s ease both; }
.school-tournament-draw-preparing > span { display: grid; width: 106px; height: 106px; place-items: center; clip-path: polygon(50% 0, 90% 22%, 90% 72%, 50% 100%, 10% 72%, 10% 22%); background: #0ea5c9; color: #fff; font-size: 2.55rem; filter: drop-shadow(0 16px 22px rgba(0,0,0,0.38)); }
.school-tournament-draw-preparing > span i { animation: school-tournament-draw-shuffle 0.75s ease-in-out infinite; }
.school-tournament-draw-preparing small { margin-top: 16px; color: #67e8f9; font-size: 0.72rem; font-weight: 800; }
.school-tournament-draw-preparing h2 { margin: 4px 0 0; color: #fff; font-size: 2.25rem; font-weight: 900; }

.school-tournament-draw-reveal.is-complete .school-tournament-draw-arena { display: none; }
.school-tournament-draw-reveal.is-complete .school-tournament-draw-complete { display: flex; animation: school-tournament-draw-complete 0.65s cubic-bezier(0.16,0.9,0.24,1) both; }
.school-tournament-draw-complete > span { display: grid; width: 128px; height: 128px; place-items: center; clip-path: polygon(50% 0, 88% 18%, 100% 60%, 74% 100%, 26% 100%, 0 60%, 12% 18%); background: #facc15; color: #4a2600; font-size: 3.2rem; filter: drop-shadow(0 18px 24px rgba(0,0,0,0.38)); }
.school-tournament-draw-complete small { margin-top: 16px; color: #fde68a; font-size: 0.72rem; font-weight: 800; }
.school-tournament-draw-complete h2 { margin: 3px 0 0; color: #fff; font-size: 3.6rem; font-weight: 900; }
.school-tournament-draw-complete p { margin: 4px 0 0; color: #bae6fd; font-size: 1rem; font-weight: 700; }

.school-tournament-draw-footer {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px max(24px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.school-tournament-draw-reveal.is-preparing .school-tournament-draw-footer { opacity: 0; pointer-events: none; }

.school-tournament-draw-footer button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 7px;
    padding: 9px 16px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 850;
    backdrop-filter: blur(8px);
}

.school-tournament-draw-footer button[hidden] { display: none !important; }
.school-tournament-draw-footer .secondary { background: rgba(5,12,25,0.55); }
.school-tournament-draw-footer .primary { border-color: #facc15; background: #facc15; color: #422006; }
.school-tournament-draw-footer button:hover { transform: translateY(-1px); }
.school-tournament-draw-footer button:focus-visible,
.school-tournament-draw-header-actions button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@keyframes school-tournament-draw-light-left {
    0% { opacity: 0; transform: rotate(-25deg) translateX(-45%); }
    35% { opacity: 0.85; }
    100% { opacity: 0; transform: rotate(-25deg) translateX(125%); }
}

@keyframes school-tournament-draw-light-right {
    0% { opacity: 0; transform: rotate(25deg) translateX(45%); }
    35% { opacity: 0.85; }
    100% { opacity: 0; transform: rotate(25deg) translateX(-125%); }
}

@keyframes school-tournament-draw-impact-line {
    0% { opacity: 0; transform: translateX(-50%) scaleY(0.08); }
    35% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    100% { opacity: 0.28; transform: translateX(-50%) scaleY(0.86); }
}

@keyframes school-tournament-draw-spark {
    0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--spark-rotate)) scale(0.2); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) rotate(calc(var(--spark-rotate) + 180deg)) scale(0.75); }
}

@keyframes school-tournament-draw-vs {
    0% { opacity: 0; transform: rotate(45deg) scale(0.12); }
    58% { opacity: 1; transform: rotate(45deg) scale(1.16); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

@keyframes school-tournament-draw-complete {
    0% { opacity: 0; transform: scale(0.68) translateY(26px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes school-tournament-draw-shuffle {
    0%, 100% { transform: translateX(-5px) rotate(-8deg); }
    50% { transform: translateX(5px) rotate(8deg); }
}

@keyframes school-tournament-draw-mark-glow {
    0%, 100% { filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 12px 18px rgba(0,0,0,0.36)); }
    50% { filter: drop-shadow(0 0 24px currentColor) drop-shadow(0 15px 22px rgba(0,0,0,0.42)); }
}

@keyframes school-tournament-draw-mark-ray {
    0%, 100% { opacity: 0.18; transform: translate(-50%, -50%) scaleX(0.42); }
    50% { opacity: 0.72; transform: translate(-50%, -50%) scaleX(1); }
}

@keyframes school-tournament-draw-mark-icon {
    0%, 100% { opacity: 0.82; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.75); }
}

@media (max-width: 767px) {
    .school-tournament-draw-reveal { min-height: 520px; }
    .school-tournament-draw-header { gap: 10px; padding: max(14px, env(safe-area-inset-top)) 16px 12px; }
    .school-tournament-draw-brand { flex: 1 1 auto; gap: 9px; }
    .school-tournament-draw-brand > span { width: 40px; height: 40px; font-size: 1rem; }
    .school-tournament-draw-brand small { font-size: 0.54rem; }
    .school-tournament-draw-brand strong { max-width: calc(100vw - 184px); font-size: 0.79rem; }
    .school-tournament-draw-header-actions { gap: 7px; }
    .school-tournament-draw-header-actions button { width: 40px; height: 40px; font-size: 1rem; }
    .school-tournament-draw-main { padding: 0 18px; }
    .school-tournament-draw-meta { width: min(100%, 430px); grid-template-columns: auto minmax(64px, 1fr); gap: 8px; padding-bottom: clamp(10px, 1.7vh, 18px); font-size: 0.6rem; }
    .school-tournament-draw-meta > strong { grid-column: 1 / -1; justify-self: center; }
    .school-tournament-draw-arena { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 92px minmax(0, 1fr); gap: clamp(12px, 2vh, 24px); padding: clamp(8px, 1.4vh, 16px) 0; }
    .school-tournament-draw-plane { width: 100%; height: 58%; }
    .school-tournament-draw-plane.left { top: 0; bottom: auto; clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%); transform: translateY(-105%); }
    .school-tournament-draw-plane.right { top: auto; bottom: 0; clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%); transform: translateY(105%); }
    .school-tournament-draw-reveal.is-entering .school-tournament-draw-plane { transform: translateY(0); }
    .school-tournament-draw-backdrop::after { top: 50%; right: 0; bottom: auto; left: 0; width: 100%; height: 18%; background: linear-gradient(180deg, transparent, rgba(5,12,25,0.9) 42%, rgba(5,12,25,0.9) 58%, transparent); transform: translateY(-50%); }
    .school-tournament-draw-impact-line { top: var(--draw-mobile-vs-center, 50%); right: 7%; bottom: auto; left: 7%; width: auto; height: 4px; transform: translateY(-50%) scaleX(0.08); transform-origin: center; }
    .school-tournament-draw-reveal.is-impact .school-tournament-draw-impact-line { animation-name: school-tournament-draw-impact-line-mobile; }
    .school-tournament-draw-team { align-self: center; }
    .school-tournament-draw-team-a { transform: translateY(-20%) scale(0.9); }
    .school-tournament-draw-team-b { transform: translateY(20%) scale(0.9); }
    .school-tournament-draw-reveal.is-entering .school-tournament-draw-team { transform: translateY(0) scale(1); }
    .school-tournament-draw-mark { width: 84px; height: 74px; margin-bottom: 7px; }
    .school-tournament-draw-mark i { font-size: 3rem; }
    .school-tournament-draw-team > small { margin-bottom: 6px; font-size: 0.62rem; }
    .school-tournament-draw-team h2 { max-width: 94%; font-size: var(--draw-team-name-size, 2.5rem); line-height: 1.05; }
    .school-tournament-draw-team h2.name-long { line-height: 1.08; }
    .school-tournament-draw-team h2.name-very-long { line-height: 1.12; }
    .school-tournament-draw-versus { width: 78px; height: 78px; }
    .school-tournament-draw-versus::after { inset: 8px; }
    .school-tournament-draw-versus strong { font-size: 1.58rem; }
    .school-tournament-draw-versus i,
    .school-tournament-draw-versus span { width: 150%; height: 2px; }
    .school-tournament-draw-complete > span { width: 92px; height: 92px; font-size: 2.25rem; }
    .school-tournament-draw-preparing > span { width: 82px; height: 82px; font-size: 1.85rem; }
    .school-tournament-draw-preparing h2 { font-size: 1.55rem; }
    .school-tournament-draw-complete h2 { font-size: 2.2rem; }
    .school-tournament-draw-complete p { font-size: 0.76rem; }
    .school-tournament-draw-footer { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 10px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
    .school-tournament-draw-footer button { width: 100%; min-height: 48px; padding: 9px 10px; font-size: 0.67rem; }
    .school-tournament-draw-footer button[hidden] + .primary { grid-column: 1 / -1; }
}

@media (max-width: 767px) and (max-height: 680px) {
    .school-tournament-draw-header { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 6px; }
    .school-tournament-draw-main { padding-right: 14px; padding-left: 14px; }
    .school-tournament-draw-meta { gap: 5px; padding-bottom: 4px; }
    .school-tournament-draw-arena { grid-template-rows: minmax(0, 1fr) 66px minmax(0, 1fr); gap: 5px; padding: 2px 0; }
    .school-tournament-draw-mark { width: 64px; height: 52px; margin-bottom: 2px; }
    .school-tournament-draw-mark i { font-size: 2.4rem; }
    .school-tournament-draw-team > small { margin-bottom: 2px; }
    .school-tournament-draw-versus { width: 60px; height: 60px; }
    .school-tournament-draw-versus strong { font-size: 1.25rem; }
    .school-tournament-draw-footer { gap: 6px; padding: 6px 12px max(8px, env(safe-area-inset-bottom)); }
    .school-tournament-draw-footer button { min-height: 40px; padding: 6px 8px; }
}

@media (max-height: 610px) and (min-width: 768px) {
    .school-tournament-draw-header { padding-top: 10px; padding-bottom: 6px; }
    .school-tournament-draw-brand > span { width: 40px; height: 40px; }
    .school-tournament-draw-arena { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); }
    .school-tournament-draw-mark { width: 66px; height: 66px; margin-bottom: 7px; font-size: 1.2rem; }
    .school-tournament-draw-mark i { font-size: 2.65rem; }
    .school-tournament-draw-team > small { margin-bottom: 3px; font-size: 0.6rem; }
    .school-tournament-draw-team h2 { font-size: var(--draw-team-name-size, 3.4rem); }
    .school-tournament-draw-team h2.name-long { line-height: 1.08; }
    .school-tournament-draw-team h2.name-very-long { line-height: 1.12; }
    .school-tournament-draw-versus { width: 88px; height: 88px; }
    .school-tournament-draw-versus strong { font-size: 1.8rem; }
    .school-tournament-draw-footer { padding-top: 6px; padding-bottom: 8px; }
}

@keyframes school-tournament-draw-impact-line-mobile {
    0% { opacity: 0; transform: translateY(-50%) scaleX(0.08); }
    35% { opacity: 1; transform: translateY(-50%) scaleX(1); }
    100% { opacity: 0.28; transform: translateY(-50%) scaleX(0.88); }
}

body.school-tournament-champion-open { overflow: hidden; }

.school-tournament-champion-reveal {
    position: fixed;
    z-index: 13000;
    inset: 0;
    display: grid;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: #06101f;
    color: #fff;
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 240ms ease, transform 360ms cubic-bezier(0.16, 0.9, 0.24, 1);
}

.school-tournament-champion-reveal.is-open { opacity: 1; transform: scale(1); }
.school-tournament-champion-reveal.is-closing { opacity: 0; transform: scale(1.02); pointer-events: none; }

.school-tournament-champion-backdrop,
.school-tournament-champion-backdrop > span { position: absolute; inset: 0; pointer-events: none; }
.school-tournament-champion-backdrop { z-index: 0; overflow: hidden; background: #06101f; }
.school-tournament-champion-backdrop .champion-plane.left { right: 48%; background: #073454; clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); }
.school-tournament-champion-backdrop .champion-plane.right { left: 48%; background: #591126; clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%); }
.school-tournament-champion-backdrop::before,
.school-tournament-champion-backdrop::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #facc15;
    box-shadow: 0 0 14px #facc15, 0 0 34px rgba(250, 204, 21, 0.72);
    opacity: 0;
    transform: translateX(-50%) scaleY(0.08);
}
.school-tournament-champion-backdrop::after { width: 1px; background: #fff; }
.school-tournament-champion-reveal.is-active .school-tournament-champion-backdrop::before,
.school-tournament-champion-reveal.is-active .school-tournament-champion-backdrop::after { animation: school-tournament-champion-center-line 1s cubic-bezier(0.16,0.9,0.24,1) both; }

.school-tournament-champion-rays { z-index: 3; top: 50% !important; left: 50% !important; width: 1px; height: 1px; }
.school-tournament-champion-rays i {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 72vmax;
    background: #facc15;
    opacity: 0;
    filter: drop-shadow(0 0 8px #facc15);
    transform-origin: 50% 0;
    transform: rotate(var(--champion-ray)) translateY(-4%);
}
.school-tournament-champion-reveal.is-active .school-tournament-champion-rays i { animation: school-tournament-champion-ray 1.25s ease-out var(--champion-ray-delay) both; }

.school-tournament-champion-confetti { z-index: 10; overflow: hidden; }
.school-tournament-champion-confetti i {
    position: absolute;
    top: -28px;
    left: var(--confetti-x);
    width: 8px;
    height: 18px;
    background: var(--confetti-color);
    opacity: 0;
    transform: rotate(var(--confetti-rotate));
}
.school-tournament-champion-reveal.is-active .school-tournament-champion-confetti i { animation: school-tournament-champion-confetti var(--confetti-duration) cubic-bezier(0.18,0.72,0.26,1) var(--confetti-delay) both; }

.school-tournament-champion-header {
    position: relative;
    z-index: 20;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(16px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 10px max(22px, env(safe-area-inset-left));
}
.school-tournament-champion-header > div { display: flex; min-width: 0; align-items: center; gap: 11px; }
.school-tournament-champion-header > div > i { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; color: #facc15; font-size: 1.5rem; text-shadow: 0 0 16px rgba(250,204,21,0.9); }
.school-tournament-champion-header span { display: flex; min-width: 0; flex-direction: column; }
.school-tournament-champion-header small { color: #fde68a; font-size: 0.65rem; font-weight: 900; }
.school-tournament-champion-header strong { max-width: min(70vw, 920px); overflow: hidden; font-size: 1.08rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.school-tournament-champion-header nav { display: flex; flex: 0 0 auto; gap: 8px; }
.school-tournament-champion-header button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: 50%;
    background: rgba(3, 10, 22, 0.68);
    color: #fff;
    font-size: 1.08rem;
    backdrop-filter: blur(8px);
}
.school-tournament-champion-header button:hover { border-color: #facc15; color: #fde68a; }
.school-tournament-champion-header button.is-muted { color: #fca5a5; }

.school-tournament-champion-main {
    position: relative;
    z-index: 12;
    display: grid;
    min-height: 0;
    place-items: center;
    padding: 4px 22px;
    text-align: center;
}
.school-tournament-champion-pending { display: none; align-items: center; flex-direction: column; }
.school-tournament-champion-pending i { color: #facc15; font-size: 4rem; filter: drop-shadow(0 0 18px rgba(250,204,21,0.72)); }
.school-tournament-champion-pending strong { margin-top: 18px; font-size: 2.25rem; font-weight: 900; }
.school-tournament-champion-pending span { margin-top: 5px; color: #bae6fd; font-size: 0.9rem; font-weight: 750; }
.school-tournament-champion-reveal.is-pending .school-tournament-champion-pending { display: flex; }
.school-tournament-champion-reveal.is-pending .school-tournament-champion-content,
.school-tournament-champion-reveal.is-pending .school-tournament-champion-footer { visibility: hidden; pointer-events: none; }

.school-tournament-champion-content { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; }
.school-tournament-champion-trophy {
    position: relative;
    display: grid;
    width: 190px;
    height: 170px;
    place-items: center;
    color: #facc15;
    opacity: 0;
    transform: translateY(50px) scale(0.45);
}
.school-tournament-champion-trophy::before,
.school-tournament-champion-trophy::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 3px solid #facc15;
    transform: rotate(45deg) scale(0.62);
    box-shadow: 0 0 18px rgba(250,204,21,0.65), inset 0 0 14px rgba(250,204,21,0.32);
}
.school-tournament-champion-trophy::after { inset: 28px; border-width: 1px; transform: rotate(-45deg) scale(0.76); }
.school-tournament-champion-trophy > i { position: absolute; z-index: 3; top: -7px; font-size: 3.1rem; text-shadow: 0 0 18px rgba(250,204,21,0.95); transform: rotate(-8deg); }
.school-tournament-champion-trophy > strong { position: relative; z-index: 2; font-size: 6.4rem; line-height: 1; text-shadow: 0 0 20px rgba(250,204,21,0.8), 0 14px 20px rgba(0,0,0,0.55); }
.school-tournament-champion-reveal.is-active .school-tournament-champion-trophy { animation: school-tournament-champion-trophy 1s cubic-bezier(0.12,0.92,0.18,1.18) 0.15s both; }

.school-tournament-champion-content > p { margin: 7px 0 0; color: #fde68a; font-size: 1.15rem; font-weight: 900; opacity: 0; }
.school-tournament-champion-content > p i { margin: 0 8px; font-size: 0.72em; }
.school-tournament-champion-name {
    max-width: min(94vw, 1700px);
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: var(--champion-name-size, 7rem);
    font-weight: 900;
    line-height: 1.02;
    text-wrap: balance;
    text-shadow: 0 8px 30px rgba(0,0,0,0.64), 0 0 5px rgba(255,255,255,0.92), 0 0 28px rgba(250,204,21,0.48);
    opacity: 0;
    transform: scale(0.72);
}
.school-tournament-champion-title {
    margin-top: 11px;
    border-top: 3px solid #facc15;
    border-bottom: 3px solid #facc15;
    padding: 5px 24px;
    color: #fef3c7;
    font-size: 1.32rem;
    font-weight: 950;
    opacity: 0;
    box-shadow: 0 0 20px rgba(250,204,21,0.36);
}
.school-tournament-champion-reveal.is-active .school-tournament-champion-content > p { animation: school-tournament-champion-copy 0.6s ease 0.82s both; }
.school-tournament-champion-reveal.is-active .school-tournament-champion-name { animation: school-tournament-champion-name 0.85s cubic-bezier(0.12,0.9,0.2,1.15) 0.64s both; }
.school-tournament-champion-reveal.is-active .school-tournament-champion-title { animation: school-tournament-champion-copy 0.65s ease 1.08s both; }

.school-tournament-champion-footer {
    position: relative;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px max(16px, env(safe-area-inset-bottom));
}
.school-tournament-champion-footer button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 7px;
    padding: 9px 16px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    backdrop-filter: blur(8px);
}
.school-tournament-champion-footer .download { border-color: #facc15; background: #facc15; color: #422006; }
.school-tournament-champion-footer .close { background: rgba(3,10,22,0.68); }
.school-tournament-champion-footer button.is-success { border-color: #34d399; background: #059669; color: #fff; }
.school-tournament-champion-footer button.is-error { border-color: #fca5a5; background: #b91c1c; color: #fff; }

@keyframes school-tournament-champion-center-line {
    0% { opacity: 0; transform: translateX(-50%) scaleY(0.08); }
    42% { opacity: 1; transform: translateX(-50%) scaleY(1); }
    100% { opacity: 0.42; transform: translateX(-50%) scaleY(0.88); }
}
@keyframes school-tournament-champion-ray {
    0% { opacity: 0; transform: rotate(var(--champion-ray)) translateY(-4%) scaleY(0.02); }
    38% { opacity: 0.68; }
    100% { opacity: 0.08; transform: rotate(var(--champion-ray)) translateY(-4%) scaleY(1); }
}
@keyframes school-tournament-champion-confetti {
    0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(var(--confetti-rotate)); }
    10% { opacity: 1; }
    100% { opacity: 0.92; transform: translate3d(var(--confetti-drift), calc(100dvh + 50px), 0) rotate(calc(var(--confetti-rotate) + 860deg)); }
}
@keyframes school-tournament-champion-trophy {
    0% { opacity: 0; transform: translateY(50px) scale(0.45) rotate(-7deg); }
    58% { opacity: 1; transform: translateY(-8px) scale(1.12) rotate(3deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes school-tournament-champion-name {
    0% { opacity: 0; transform: scale(0.72) translateY(28px); }
    65% { opacity: 1; transform: scale(1.07) translateY(-3px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes school-tournament-champion-copy {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.school-tournament-export-stage {
    position: fixed;
    z-index: -100;
    top: 0;
    left: -100000px;
    box-sizing: border-box;
    width: max-content;
    min-width: 1280px;
    padding: 42px 48px 30px;
    background: #eef3f8;
    color: #172033;
    font-family: inherit;
}
.school-tournament-export-header {
    display: flex;
    min-height: 104px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-top: 7px solid #facc15;
    padding: 18px 22px;
    background: #07172c;
    color: #fff;
}
.school-tournament-export-brand { display: flex; min-width: 0; align-items: center; gap: 15px; }
.school-tournament-export-brand > span { display: grid; width: 62px; height: 62px; flex: 0 0 auto; place-items: center; background: #facc15; color: #422006; font-size: 1.8rem; clip-path: polygon(50% 0, 92% 22%, 92% 72%, 50% 100%, 8% 72%, 8% 22%); }
.school-tournament-export-brand small { color: #67e8f9; font-size: 0.72rem; font-weight: 900; }
.school-tournament-export-brand h1 { margin: 2px 0 0; font-size: 1.8rem; font-weight: 900; }
.school-tournament-export-result { display: flex; flex: 0 0 auto; align-items: flex-end; flex-direction: column; text-align: right; }
.school-tournament-export-result small { color: #cbd5e1; font-size: 0.68rem; font-weight: 750; }
.school-tournament-export-result strong { margin-top: 5px; color: #fde68a; font-size: 1.08rem; font-weight: 900; }
.school-tournament-export-bracket { padding: 28px 4px 16px; }
.school-tournament-export-stage .school-tournament-bracket { min-width: 0; min-height: max(540px, calc(var(--first-round-matches) * 150px)); gap: 32px; }
.school-tournament-export-stage .school-tournament-round,
.school-tournament-export-stage .school-tournament-champion-column { width: 252px; flex-basis: 252px; }
.school-tournament-export-stage .school-tournament-match::after { right: -33px; width: 32px; }
.school-tournament-export-stage .school-tournament-team-slot { min-height: 44px; grid-template-columns: 25px minmax(0,1fr) 18px; padding: 6px 7px; }
.school-tournament-export-stage .school-tournament-team-slot strong { overflow: visible; font-size: 0.72rem; line-height: 1.25; text-overflow: clip; white-space: normal; }
.school-tournament-export-stage .school-tournament-team-slot .slot-mark { width: 24px; height: 24px; }
.school-tournament-export-stage .school-tournament-round > header,
.school-tournament-export-stage .school-tournament-champion-column > header { min-height: 70px; }
.school-tournament-export-stage .school-tournament-round-matches { min-height: calc(max(470px, calc(var(--first-round-matches) * 150px - 70px))); }
.school-tournament-export-stage .school-tournament-round > header strong,
.school-tournament-export-stage .school-tournament-champion-column > header strong { font-size: 0.86rem; }
.school-tournament-export-stage .school-tournament-champion-card { min-height: 210px; }
.school-tournament-export-stage .school-tournament-champion-card > strong { font-size: 1.02rem; }
.school-tournament-export-stage button { animation: none !important; }
.school-tournament-export-stage > footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 2px solid #cbd5e1; padding: 15px 4px 0; color: #64748b; font-size: 0.68rem; font-weight: 750; }
.school-tournament-export-stage > footer strong { color: #0369a1; }

@media (max-width: 767px) {
    .school-tournament-champion-header { padding-right: 12px; padding-left: 12px; }
    .school-tournament-champion-header > div { gap: 6px; }
    .school-tournament-champion-header > div > i { width: 38px; height: 38px; font-size: 1.12rem; }
    .school-tournament-champion-header small { font-size: 0.5rem; }
    .school-tournament-champion-header strong { max-width: 47vw; font-size: 0.72rem; }
    .school-tournament-champion-header nav { gap: 5px; }
    .school-tournament-champion-header button { width: 40px; height: 40px; font-size: 0.95rem; }
    .school-tournament-champion-main { padding-right: 12px; padding-left: 12px; }
    .school-tournament-champion-trophy { width: 120px; height: 108px; }
    .school-tournament-champion-trophy > i { top: -4px; font-size: 2rem; }
    .school-tournament-champion-trophy > strong { font-size: 4rem; }
    .school-tournament-champion-content > p { font-size: 0.72rem; }
    .school-tournament-champion-name { max-width: 96vw; font-size: var(--champion-name-size, 3rem); }
    .school-tournament-champion-title { margin-top: 7px; border-width: 2px; padding: 4px 15px; font-size: 0.82rem; }
    .school-tournament-champion-pending i { font-size: 2.6rem; }
    .school-tournament-champion-pending strong { margin-top: 13px; font-size: 1.45rem; }
    .school-tournament-champion-pending span { font-size: 0.7rem; }
    .school-tournament-champion-footer { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 6px; padding: 7px 10px max(12px, env(safe-area-inset-bottom)); }
    .school-tournament-champion-footer button { min-height: 43px; padding: 7px 8px; font-size: 0.59rem; }
}

@media (max-height: 620px) and (min-width: 768px) {
    .school-tournament-champion-trophy { width: 116px; height: 100px; }
    .school-tournament-champion-trophy > i { font-size: 2rem; }
    .school-tournament-champion-trophy > strong { font-size: 3.9rem; }
    .school-tournament-champion-content > p { margin-top: 2px; font-size: 0.75rem; }
    .school-tournament-champion-title { margin-top: 5px; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
    .school-tournament-champion-reveal,
    .school-tournament-champion-trophy,
    .school-tournament-champion-name,
    .school-tournament-champion-content > p,
    .school-tournament-champion-title { transition: none; animation: none !important; opacity: 1; transform: none; }
    .school-tournament-champion-rays i,
    .school-tournament-champion-confetti i,
    .school-tournament-champion-backdrop::before,
    .school-tournament-champion-backdrop::after { animation: none !important; }
}

.school-tournament-bracket-panel {
    min-width: 0;
    padding: 16px 0 16px 16px;
    background: #fff;
}

.school-tournament-bracket-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px 13px 0;
    border-bottom: 1px solid #e2e8f0;
}

.school-tournament-bracket-heading > div:first-child { display: flex; min-width: 0; flex-direction: column; }
.school-tournament-bracket-heading > div:first-child > span { color: #172033; font-size: 0.88rem; font-weight: 900; }
.school-tournament-bracket-heading small { margin-top: 3px; color: #64748b; font-size: 0.62rem; font-weight: 700; }

.school-tournament-bracket-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.school-tournament-save-state {
    display: inline-flex;
    min-height: 30px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.59rem;
    font-weight: 850;
}

.school-tournament-save-state.saved { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-tournament-save-state.saving { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.school-tournament-save-state.error { border-color: #fecaca; background: #fff1f2; color: #dc2626; }

.school-tournament-export-button,
.school-tournament-fullscreen-button {
    display: inline-flex;
    min-height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #bae6fd;
    border-radius: 7px;
    padding: 6px 10px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: 0.62rem;
    font-weight: 900;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.school-tournament-export-button { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-tournament-export-button:hover { border-color: #34d399; background: #d1fae5; transform: translateY(-1px); }
.school-tournament-export-button:disabled { border-color: #e2e8f0; background: #f8fafc; color: #94a3b8; cursor: not-allowed; transform: none; }
.school-tournament-export-button.is-busy { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.school-tournament-export-button.is-success { border-color: #34d399; background: #059669; color: #fff; }
.school-tournament-export-button.is-error { border-color: #fca5a5; background: #b91c1c; color: #fff; }

.school-tournament-fullscreen-button:hover {
    border-color: #38bdf8;
    background: #e0f2fe;
    transform: translateY(-1px);
}

.school-tournament-fullscreen-button.is-active {
    border-color: #7dd3fc;
    background: #0284c7;
    color: #fff;
}

.school-tournament-bracket-empty {
    display: flex;
    min-height: 475px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 14px 16px 0 0;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #94a3b8;
    text-align: center;
}

.school-tournament-bracket-empty i { margin-bottom: 11px; color: #38bdf8; font-size: 2rem; }
.school-tournament-bracket-empty h4 { margin: 0; color: #475569; font-size: 0.9rem; font-weight: 900; }
.school-tournament-bracket-empty p { max-width: 330px; margin: 5px 12px 0; font-size: 0.66rem; font-weight: 700; line-height: 1.45; }

.school-tournament-bracket-scroll {
    max-width: 100%;
    margin-top: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px 12px 2px;
    cursor: grab;
    scrollbar-color: #94a3b8 #e2e8f0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y pinch-zoom;
}

.school-tournament-bracket-scroll.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.school-tournament-bracket-scroll.is-dragging * {
    user-select: none;
}

.school-tournament-bracket {
    display: flex;
    width: max-content;
    min-width: 100%;
    min-height: max(500px, calc(var(--first-round-matches) * 126px));
    align-items: stretch;
    gap: 26px;
    padding: 0 4px 4px;
}

.school-tournament-round,
.school-tournament-champion-column {
    display: flex;
    width: 226px;
    flex: 0 0 226px;
    flex-direction: column;
}

.school-tournament-round > header,
.school-tournament-champion-column > header {
    display: flex;
    min-height: 62px;
    flex-direction: column;
    border: 1px solid #dbe7f0;
    border-top: 3px solid #0ea5e9;
    border-radius: 7px;
    padding: 8px 10px;
    background: #f8fafc;
}

.school-tournament-round > header span,
.school-tournament-champion-column > header span { color: #0284c7; font-size: 0.55rem; font-weight: 900; }
.school-tournament-round > header strong,
.school-tournament-champion-column > header strong { margin-top: 1px; color: #172033; font-size: 0.76rem; font-weight: 900; }
.school-tournament-round > header small,
.school-tournament-champion-column > header small { margin-top: 1px; color: #64748b; font-size: 0.55rem; font-weight: 700; }

.school-tournament-round-matches {
    display: flex;
    min-height: calc(max(438px, calc(var(--first-round-matches) * 126px - 62px)));
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-around;
    gap: 12px;
    padding: 12px 0;
}

.school-tournament-match {
    position: relative;
    z-index: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px;
    background: #fff;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.07);
}

.school-tournament-match::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -27px;
    width: 26px;
    border-top: 2px solid #94a3b8;
}

.school-tournament-match.is-decided { border-color: #86efac; }
.school-tournament-match-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px 5px; }
.school-tournament-match-label span { color: #64748b; font-size: 0.54rem; font-weight: 900; }
.school-tournament-match-label small { color: #94a3b8; font-size: 0.5rem; font-weight: 750; }
.school-tournament-match.is-decided .school-tournament-match-label small { color: #059669; }

.school-tournament-team-slot {
    display: grid;
    width: 100%;
    min-height: 38px;
    grid-template-columns: 22px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    padding: 5px 6px;
    color: #334155;
    text-align: left;
}

.school-tournament-team-slot + .school-tournament-team-slot { margin-top: 5px; }
.school-tournament-team-slot.team { border-radius: 6px; background: #fff; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease; }
.school-tournament-team-slot.team:disabled { cursor: default; }
.school-tournament-team-slot.team:not(:disabled):hover { border-color: #38bdf8; background: #f0f9ff; transform: translateX(2px); }
.school-tournament-team-slot .slot-mark { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 5px; background: #e2e8f0; color: #64748b; font-size: 0.52rem; font-weight: 900; }
.school-tournament-team-slot strong { overflow: hidden; font-size: 0.66rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.school-tournament-team-slot > i { color: #94a3b8; font-size: 0.65rem; text-align: center; }
.school-tournament-team-slot.waiting { border-style: dashed; border-radius: 6px; background: #f8fafc; color: #94a3b8; cursor: default; }
.school-tournament-team-slot.waiting > i { color: #cbd5e1; }
.school-tournament-team-slot.waiting span { grid-column: 2 / -1; font-size: 0.56rem; font-weight: 750; }
.school-tournament-team-slot.is-winner { border-color: #34d399; background: #ecfdf5; color: #047857; }
.school-tournament-team-slot.is-winner .slot-mark { background: #10b981; color: #fff; }
.school-tournament-team-slot.is-winner > i { color: #059669; }
.school-tournament-team-slot.is-loser { color: #94a3b8; opacity: 0.62; }
.school-tournament-team-slot.recent-winner { animation: schoolTournamentWinnerPop 620ms ease; }

@keyframes schoolTournamentWinnerPop {
    0% { transform: scale(1); box-shadow: none; }
    42% { transform: scale(1.035); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.17); }
    100% { transform: scale(1); box-shadow: none; }
}

.school-tournament-champion-column > header { border-top-color: #f59e0b; background: #fffbeb; }
.school-tournament-champion-column > header span { color: #d97706; }
.school-tournament-champion-card {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: auto 0;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 18px 12px;
    background: #fffbeb;
    color: #a16207;
    text-align: center;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.13);
}

.school-tournament-champion-card > i { margin-bottom: 12px; color: #f59e0b; font-size: 2.5rem; }
.school-tournament-champion-card > span { color: #92400e; font-size: 0.59rem; font-weight: 850; }
.school-tournament-champion-card > strong { max-width: 100%; margin-top: 6px; overflow-wrap: anywhere; color: #78350f; font-size: 0.92rem; font-weight: 900; }
.school-tournament-champion-card > small { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; border-radius: 999px; padding: 5px 8px; background: #fff; color: #a16207; font-size: 0.55rem; font-weight: 850; }
.school-tournament-champion-column:not(.has-champion) .school-tournament-champion-card { border-style: dashed; background: #f8fafc; color: #94a3b8; }
.school-tournament-champion-column:not(.has-champion) .school-tournament-champion-card > i,
.school-tournament-champion-column:not(.has-champion) .school-tournament-champion-card > span,
.school-tournament-champion-column:not(.has-champion) .school-tournament-champion-card > strong { color: #94a3b8; }

html.school-tournament-fullscreen-open,
body.school-tournament-fullscreen-open {
    overflow: hidden;
}

.school-tournament-bracket-panel:fullscreen,
.school-tournament-bracket-panel:-webkit-full-screen,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback {
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    height: var(--tournament-fullscreen-height, 100dvh);
    max-width: none;
    box-sizing: border-box;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.school-tournament-bracket-panel.school-tournament-fullscreen-fallback {
    position: fixed;
    z-index: 10050;
    inset: 0;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket-heading,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-heading,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-heading {
    min-height: 72px;
    flex: 0 0 auto;
    padding: 12px 18px;
    background: #f8fafc;
    box-shadow: 0 1px 0 #dbe7f0;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket-heading > div:first-child > span,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-heading > div:first-child > span,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-heading > div:first-child > span {
    font-size: 1rem;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket-heading small,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-heading small,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-heading small {
    font-size: 0.68rem;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket-scroll,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-scroll,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-scroll {
    width: 100%;
    max-width: none;
    min-height: 0;
    flex: 1 1 auto;
    margin-top: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 18px 22px 24px;
    background: #fff;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket-empty,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-empty,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-empty {
    width: auto;
    min-height: 0;
    flex: 1 1 auto;
    margin: 18px;
}

.school-tournament-bracket-panel:fullscreen .school-tournament-bracket,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket {
    min-width: max-content;
    min-height: max(var(--tournament-fullscreen-content-height, calc(100dvh - 114px)), calc(var(--first-round-matches) * var(--tournament-fullscreen-match-step, 154px)));
    gap: var(--tournament-fullscreen-gap, 34px);
}

.school-tournament-bracket-panel:fullscreen .school-tournament-round,
.school-tournament-bracket-panel:fullscreen .school-tournament-champion-column,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-round,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-champion-column,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-round,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-champion-column {
    width: var(--tournament-fullscreen-column, 250px);
    flex-basis: var(--tournament-fullscreen-column, 250px);
}

.school-tournament-bracket-panel:fullscreen .school-tournament-match::after,
.school-tournament-bracket-panel:-webkit-full-screen .school-tournament-match::after,
.school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-match::after {
    right: calc((var(--tournament-fullscreen-gap, 34px) + 1px) * -1);
    width: var(--tournament-fullscreen-gap, 34px);
}

.school-tournament-bracket-panel.school-tournament-is-fullscreen {
    --tournament-fullscreen-round-kicker: 0.7rem;
    --tournament-fullscreen-round-title: 1rem;
    --tournament-fullscreen-round-meta: 0.67rem;
    --tournament-fullscreen-match-label: 0.66rem;
    --tournament-fullscreen-match-meta: 0.61rem;
    --tournament-fullscreen-team-font: 0.9rem;
    --tournament-fullscreen-slot-font: 0.7rem;
    --tournament-fullscreen-team-height: 46px;
    --tournament-fullscreen-round-header: 74px;
    --tournament-fullscreen-match-step: 154px;
    --tournament-fullscreen-champion-font: 1.18rem;
}

.school-tournament-bracket-panel.school-tournament-is-fullscreen[data-fullscreen-size="regular"] {
    --tournament-fullscreen-round-kicker: 0.76rem;
    --tournament-fullscreen-round-title: 1.06rem;
    --tournament-fullscreen-round-meta: 0.72rem;
    --tournament-fullscreen-match-label: 0.72rem;
    --tournament-fullscreen-match-meta: 0.66rem;
    --tournament-fullscreen-team-font: 0.94rem;
    --tournament-fullscreen-slot-font: 0.71rem;
    --tournament-fullscreen-team-height: 50px;
    --tournament-fullscreen-round-header: 82px;
    --tournament-fullscreen-match-step: 166px;
    --tournament-fullscreen-champion-font: 1.28rem;
}

.school-tournament-bracket-panel.school-tournament-is-fullscreen[data-fullscreen-size="large"] {
    --tournament-fullscreen-round-kicker: 0.84rem;
    --tournament-fullscreen-round-title: 1.18rem;
    --tournament-fullscreen-round-meta: 0.78rem;
    --tournament-fullscreen-match-label: 0.79rem;
    --tournament-fullscreen-match-meta: 0.72rem;
    --tournament-fullscreen-team-font: 1.04rem;
    --tournament-fullscreen-slot-font: 0.78rem;
    --tournament-fullscreen-team-height: 56px;
    --tournament-fullscreen-round-header: 90px;
    --tournament-fullscreen-match-step: 182px;
    --tournament-fullscreen-champion-font: 1.42rem;
}

.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-bracket-heading > div:first-child > span { font-size: 1.12rem; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-bracket-heading small { font-size: 0.76rem; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-save-state,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-export-button,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-fullscreen-button { min-height: 38px; font-size: 0.74rem; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-round > header,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-column > header { min-height: var(--tournament-fullscreen-round-header); justify-content: center; padding: 10px 13px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-round > header span,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-column > header span { font-size: var(--tournament-fullscreen-round-kicker); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-round > header strong,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-column > header strong { font-size: var(--tournament-fullscreen-round-title); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-round > header small,
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-column > header small { font-size: var(--tournament-fullscreen-round-meta); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-round-matches { min-height: calc(max(calc(var(--tournament-fullscreen-content-height) - var(--tournament-fullscreen-round-header)), calc(var(--first-round-matches) * var(--tournament-fullscreen-match-step) - var(--tournament-fullscreen-round-header)))); gap: 16px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen[data-fullscreen-size="compact"] .school-tournament-round-matches { gap: 12px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-match { padding: 10px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-match-label { padding-bottom: 7px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-match-label span { font-size: var(--tournament-fullscreen-match-label); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-match-label small { font-size: var(--tournament-fullscreen-match-meta); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-team-slot { min-height: var(--tournament-fullscreen-team-height); grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 8px; padding: 7px 8px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-team-slot .slot-mark { width: 27px; height: 27px; font-size: var(--tournament-fullscreen-slot-font); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-team-slot strong { font-size: var(--tournament-fullscreen-team-font); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-team-slot.waiting span { font-size: var(--tournament-fullscreen-match-meta); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-card { min-height: 230px; padding: 22px 16px; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-card > i { font-size: 3.2rem; }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-card > span { font-size: var(--tournament-fullscreen-round-meta); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-card > strong { font-size: var(--tournament-fullscreen-champion-font); }
.school-tournament-bracket-panel.school-tournament-is-fullscreen .school-tournament-champion-card > small { font-size: var(--tournament-fullscreen-match-meta); }

@media (max-width: 767px) {
    .school-tournament-access-modal .swal2-html-container { margin: 10px 12px 0; }
    .school-tournament-access-owner { grid-template-columns: 40px minmax(0, 1fr); gap: 9px; padding: 9px; }
    .school-tournament-access-owner > span { width: 40px; height: 40px; }
    .school-tournament-access-owner b { display: none; }
    .school-tournament-access-toolbar { grid-template-columns: 1fr; }
    .school-tournament-access-toolbar > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-tournament-access-toolbar button { width: 100%; }
    .school-tournament-access-list { max-height: 44vh; }
    .school-tournament-access-option { min-height: 62px; }
    .dashboard-quick-menu.dashboard-activity-quick-menu { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .school-tournament-toolbar { align-items: stretch; flex-direction: column; padding: 14px 12px; }
    .school-tournament-picker { grid-template-columns: 1fr; }
    .school-tournament-picker .school-activity-primary-button { width: 100%; }
    .school-tournament-header { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
    .school-tournament-title-block { align-items: flex-start; gap: 9px; }
    .school-tournament-title-icon { width: 42px; height: 42px; font-size: 1.1rem; }
    .school-tournament-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
    .school-tournament-title-line h3 { max-width: 56vw; font-size: 0.88rem; white-space: normal; }
    .school-tournament-title-block p { display: grid; gap: 4px; font-size: 0.59rem; }
    .school-tournament-header-actions { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; }
    .school-tournament-header-actions button { width: 100%; min-height: 38px; padding: 6px 7px; font-size: 0.58rem; }
    .school-tournament-header-actions button span { display: inline; }
    .school-tournament-readonly { min-height: 36px; justify-content: center; border: 1px solid #e2e8f0; border-radius: 7px; background: #f8fafc; }
    .school-tournament-layout { display: block; min-height: 0; }
    .school-tournament-team-panel { border-right: 0; border-bottom: 1px solid #dbe7f0; padding: 12px; }
    .school-tournament-team-list { min-height: 120px; max-height: 285px; }
    .school-tournament-team-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-tournament-team-actions button { min-width: 0; padding: 7px 4px; font-size: 0.58rem; }
    .school-tournament-bracket-panel { padding: 12px 0 12px 12px; }
    .school-tournament-bracket-heading { align-items: flex-start; padding: 0 12px 10px 0; }
    .school-tournament-bracket-tools { gap: 5px; }
    .school-tournament-bracket-heading small { max-width: 210px; line-height: 1.35; }
    .school-tournament-save-state span { display: none; }
    .school-tournament-save-state { width: 30px; min-height: 30px; justify-content: center; padding: 4px; }
    .school-tournament-export-button,
    .school-tournament-fullscreen-button { width: 34px; min-height: 34px; padding: 5px; }
    .school-tournament-export-button span,
    .school-tournament-fullscreen-button span { display: none; }
    .school-tournament-bracket-empty { min-height: 260px; margin-right: 12px; }
    .school-tournament-bracket { min-height: max(440px, calc(var(--first-round-matches) * 118px)); }
    .school-tournament-round,
    .school-tournament-champion-column { width: 210px; flex-basis: 210px; }
    .school-tournament-round-matches { min-height: calc(max(378px, calc(var(--first-round-matches) * 118px - 62px))); }

    .school-tournament-bracket-panel:fullscreen .school-tournament-bracket-heading,
    .school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-heading,
    .school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-heading {
        align-items: center;
        padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    }

    .school-tournament-bracket-panel:fullscreen .school-tournament-bracket-heading small,
    .school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-heading small,
    .school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-heading small {
        max-width: 58vw;
    }

    .school-tournament-bracket-panel:fullscreen .school-tournament-bracket-scroll,
    .school-tournament-bracket-panel:-webkit-full-screen .school-tournament-bracket-scroll,
    .school-tournament-bracket-panel.school-tournament-fullscreen-fallback .school-tournament-bracket-scroll {
        padding: 14px 14px max(18px, env(safe-area-inset-bottom));
    }

    #view-tournaments { padding: 6px; }
    .school-tournaments-page-header { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px 12px; }
    .school-tournaments-page-icon { width: 48px; height: 48px; font-size: 1.3rem; }
    .school-tournaments-page-title { align-items: flex-start; gap: 10px; }
    .school-tournaments-page-title h2 { font-size: 1.08rem; }
    .school-tournaments-page-title div > span { font-size: 0.63rem; line-height: 1.4; }
    .school-tournaments-page-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .school-tournament-live-status { min-width: 0; }
    .school-tournament-page-refresh { width: 44px; padding: 7px; }
    .school-tournament-page-refresh span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .school-tournament-live-dot { animation: none; }
    .school-tournament-draw-reveal,
    .school-tournament-draw-plane,
    .school-tournament-draw-team,
    .school-tournament-draw-progress > i { transition: none; }
    .school-tournament-draw-light,
    .school-tournament-draw-impact-line,
    .school-tournament-draw-sparks i,
    .school-tournament-draw-mark,
    .school-tournament-draw-mark::before,
    .school-tournament-draw-mark i,
    .school-tournament-draw-preparing > span i,
    .school-tournament-draw-reveal.is-complete .school-tournament-draw-complete { animation: none !important; }
    .school-tournament-draw-reveal.is-impact .school-tournament-draw-versus { animation: none; opacity: 1; transform: rotate(45deg) scale(1); }
}

/* Manual subject attendance cards follow the school activity roster pattern. */
.manual-subject-page #manual-pending-list.manual-subject-pending-grid,
.manual-subject-page #manual-checked-list.manual-subject-checked-list,
.manual-assembly-page #manual-assembly-pending-list.manual-assembly-daily-list,
.manual-assembly-page #manual-assembly-checked-list.manual-assembly-daily-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)) !important;
    align-items: stretch;
    gap: 12px !important;
}

.manual-subject-page .manual-attendance-card,
.manual-assembly-page .manual-attendance-card {
    display: flex;
    min-width: 0;
    min-height: 0 !important;
    flex-direction: column;
    justify-content: flex-start !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid #dbe7f0;
    border-left: 4px solid #cbd5e1;
    border-radius: 8px !important;
    padding: 0 !important;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.055);
}

.manual-subject-page .manual-attendance-card.present { border-left-color: #10b981; }
.manual-subject-page .manual-attendance-card.late { border-left-color: #f59e0b; }
.manual-subject-page .manual-attendance-card.leave { border-left-color: #38bdf8; }
.manual-subject-page .manual-attendance-card.absent { border-left-color: #ef4444; }
.manual-assembly-page .manual-attendance-card.present { border-left-color: #10b981; }
.manual-assembly-page .manual-attendance-card.late { border-left-color: #f59e0b; }
.manual-assembly-page .manual-attendance-card.leave { border-left-color: #38bdf8; }
.manual-assembly-page .manual-attendance-card.absent { border-left-color: #ef4444; }
.manual-assembly-page .manual-attendance-card.duty { border-left-color: #8b5cf6; }

.manual-attendance-card .manual-subject-student-main {
    display: grid !important;
    min-width: 0;
    min-height: 150px;
    flex: 0 0 auto !important;
    grid-template-columns: 100px minmax(0, 1fr) !important;
    align-items: center;
    justify-content: initial !important;
    gap: 15px;
    padding: 13px 14px;
    text-align: left !important;
}

.manual-attendance-card .manual-subject-photo-wrap {
    position: relative;
    display: block !important;
    width: auto !important;
    padding: 0 !important;
}

.manual-attendance-card .manual-subject-photo {
    display: block;
    width: 100px !important;
    height: 134px !important;
    border: 2px solid #fff;
    border-radius: 7px !important;
    background: #e2e8f0;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.manual-attendance-card .manual-subject-photo-hint {
    right: 50%;
    bottom: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transform: translateX(50%);
    border-radius: 5px;
    padding: 3px 5px;
    font-size: 0.52rem;
    opacity: 0;
}

.manual-attendance-card .manual-subject-photo-wrap:hover .manual-subject-photo-hint {
    opacity: 1;
}

.manual-attendance-card .manual-subject-student-info {
    width: auto !important;
    min-width: 0;
    text-align: left !important;
}

.manual-attendance-room {
    display: inline-block;
    border-radius: 5px;
    padding: 3px 7px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.64rem;
    font-weight: 900;
}

.manual-attendance-room-row {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.manual-attendance-duty-toggle {
    display: inline-flex;
    min-height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    padding: 4px 7px;
    background: #faf5ff;
    color: #7e22ce;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.manual-attendance-duty-toggle:hover,
.manual-attendance-duty-toggle.active {
    border-color: #8b5cf6;
    background: #8b5cf6;
    color: #fff;
}

.manual-attendance-card .manual-subject-student-name {
    margin: 7px 0 2px;
    overflow: visible;
    color: #172033;
    font-size: 1rem !important;
    font-weight: 900;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.manual-attendance-card .manual-subject-student-id {
    margin: 0;
    color: #64748b;
    font-size: 0.72rem !important;
    font-weight: 750;
}

.manual-attendance-status {
    display: inline-block;
    margin-top: 8px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.64rem;
    font-weight: 900;
}

.manual-attendance-status.pending { background: #f1f5f9; color: #64748b; }
.manual-attendance-status.present { background: #dcfce7; color: #047857; }
.manual-attendance-status.late { background: #fef3c7; color: #b45309; }
.manual-attendance-status.leave { background: #e0f2fe; color: #0369a1; }
.manual-attendance-status.absent { background: #fee2e2; color: #b91c1c; }
.manual-attendance-status.duty { background: #f3e8ff; color: #7e22ce; }

.manual-attendance-card .manual-subject-status-actions {
    display: grid !important;
    box-sizing: border-box;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 40px !important;
    gap: 6px !important;
    border-top: 1px solid #e2e8f0;
    padding: 8px;
    background: #f8fafc;
}

.manual-attendance-card .manual-subject-status-btn {
    min-width: 0;
    min-height: 42px !important;
    border: 1px solid;
    border-radius: 6px !important;
    padding: 6px 4px !important;
    background: #fff;
    font-size: 0.78rem !important;
    font-weight: 900;
    line-height: 1;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.manual-attendance-card .manual-subject-status-btn.present { border-color: #a7f3d0; color: #047857; }
.manual-attendance-card .manual-subject-status-btn.late { border-color: #fde68a; color: #b45309; }
.manual-attendance-card .manual-subject-status-btn.leave { border-color: #bae6fd; color: #0369a1; }
.manual-attendance-card .manual-subject-status-btn.absent { border-color: #fecaca; color: #b91c1c; }
.manual-attendance-card .manual-subject-status-btn.reset { border-color: #cbd5e1; color: #64748b; }
.manual-attendance-card .manual-subject-status-btn.present.active { border-color: #10b981; background: #10b981; color: #fff; }
.manual-attendance-card .manual-subject-status-btn.late.active { border-color: #f59e0b; background: #f59e0b; color: #fff; }
.manual-attendance-card .manual-subject-status-btn.leave.active { border-color: #0ea5e9; background: #0ea5e9; color: #fff; }
.manual-attendance-card .manual-subject-status-btn.absent.active { border-color: #ef4444; background: #ef4444; color: #fff; }
.manual-attendance-card .manual-subject-status-btn:disabled { cursor: default; opacity: 0.48; }

@media (max-width: 767px) {
    .manual-subject-page #manual-pending-list.manual-subject-pending-grid,
    .manual-subject-page #manual-checked-list.manual-subject-checked-list,
    .manual-assembly-page #manual-assembly-pending-list.manual-assembly-daily-list,
    .manual-assembly-page #manual-assembly-checked-list.manual-assembly-daily-list {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .manual-attendance-card .manual-subject-student-main {
        min-height: 147px;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        gap: 11px;
        padding: 11px;
    }

    .manual-attendance-card .manual-subject-photo {
        width: 92px !important;
        height: 123px !important;
    }

    .manual-attendance-card .manual-subject-photo-hint {
        display: none;
    }

    .manual-attendance-card .manual-subject-student-name {
        margin-top: 6px;
        font-size: 1rem !important;
    }

    .manual-attendance-card .manual-subject-student-id {
        font-size: 0.74rem !important;
    }

    .manual-attendance-status {
        margin-top: 6px;
        padding: 3px 8px;
        font-size: 0.62rem;
    }

    .manual-attendance-card .manual-subject-status-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr)) 36px !important;
        gap: 5px !important;
        padding: 8px;
    }

    .manual-attendance-card .manual-subject-status-btn {
        min-height: 42px !important;
        font-size: 0.76rem !important;
    }
}

/* Restore the projector-friendly student portraits on desktop manual attendance. */
@media (min-width: 1024px) {
    .manual-subject-page #manual-pending-list.manual-subject-pending-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
        gap: 1.25rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-attendance-card {
        min-height: 31rem !important;
        justify-content: space-between !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-main {
        display: flex !important;
        min-height: 0;
        flex: 1 1 auto !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start !important;
        gap: 0.85rem;
        padding: 1rem;
        text-align: center !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-photo-wrap {
        display: flex !important;
        width: 100% !important;
        justify-content: center;
        padding-top: 0.2rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-photo {
        width: min(22vw, 20rem) !important;
        height: min(22vw, 20rem) !important;
        border-width: 4px;
        border-radius: 1.6rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-info {
        width: 100% !important;
        text-align: center !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-name {
        margin-top: 0.65rem;
        font-size: 1.25rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-id {
        font-size: 1rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-attendance-status {
        font-size: 0.76rem;
    }

    .manual-subject-page #manual-pending-list .manual-subject-status-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr)) 52px !important;
        gap: 0.45rem !important;
        padding: 0.75rem;
    }

    .manual-subject-page #manual-pending-list .manual-subject-status-btn {
        min-height: 3.1rem !important;
        padding-right: 0.2rem !important;
        padding-left: 0.2rem !important;
        font-size: 1.08rem !important;
    }

    .manual-subject-page #manual-checked-list.manual-subject-checked-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 0.65rem !important;
    }
}

@media (min-width: 1440px) {
    .manual-subject-page #manual-pending-list.manual-subject-pending-grid {
        grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)) !important;
    }

    .manual-subject-page #manual-pending-list .manual-attendance-card {
        min-height: 34rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-photo {
        width: min(24vw, 23rem) !important;
        height: min(24vw, 23rem) !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-name {
        font-size: 1.38rem !important;
    }

    .manual-subject-page #manual-pending-list .manual-subject-student-id {
        font-size: 1.08rem !important;
    }
}

/* =========================================================
   SCHOOL ACTIVITIES
   ========================================================= */
.dashboard-quick-menu-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.dashboard-quick-menu-heading .dashboard-quick-tabs {
    width: 100%;
}

.dashboard-quick-tabs {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #f1f5f9;
}

.dashboard-quick-tab {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 6px;
    padding: 6px 12px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.dashboard-quick-tab.active {
    background: #fff;
    color: #0369a1;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.1);
}

.activity-quick-button {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    color: #172033;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 8px 18px rgba(15,23,42,0.08);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.activity-quick-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.55;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.45) 1px, transparent 1px), linear-gradient(rgba(255,255,255,0.45) 1px, transparent 1px);
    background-size: 18px 18px;
}

.activity-quick-button:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 13px 26px rgba(15,23,42,0.13);
}

.activity-quick-create { background: #dcfce7 !important; border-color: #86efac !important; }
.activity-quick-attendance { background: #e0f2fe !important; border-color: #7dd3fc !important; }
.activity-quick-report { background: #fef3c7 !important; border-color: #fcd34d !important; }
.activity-quick-main { background: #e0f2fe !important; border-color: #7dd3fc !important; }
.activity-quick-tournament { background: #ffedd5 !important; border-color: #fdba74 !important; }
.document-quick-salary { background: #eef2ff !important; border-color: #a5b4fc !important; }
.document-quick-travel { background: #ecfeff !important; border-color: #67e8f9 !important; }
.document-quick-leave { background: #fff7ed !important; border-color: #fdba74 !important; }
.document-quick-library { background: #f0f9ff !important; border-color: #7dd3fc !important; }

.activity-quick-icon {
    position: relative;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin-bottom: 9px;
    border-radius: 8px;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 8px 15px rgba(15,23,42,0.17);
    transition: transform 180ms ease;
}

.activity-quick-button:hover .activity-quick-icon { transform: scale(1.07); }
.activity-quick-create .activity-quick-icon { background: #059669; }
.activity-quick-attendance .activity-quick-icon { background: #0284c7; }
.activity-quick-report .activity-quick-icon { background: #d97706; }
.activity-quick-main .activity-quick-icon { background: #0284c7; }
.activity-quick-tournament .activity-quick-icon { background: #ea580c; }
.document-quick-salary .activity-quick-icon { background: #4f46e5; }
.document-quick-travel .activity-quick-icon { background: #0891b2; }
.document-quick-leave .activity-quick-icon { background: #ea580c; }
.document-quick-library .activity-quick-icon { background: #0369a1; }
.activity-quick-label { font-size: 0.88rem; font-weight: 900; line-height: 1.2; }
.activity-quick-caption { margin-top: 4px; color: #64748b; font-size: 0.66rem; font-weight: 700; line-height: 1.25; }

.document-quick-salary-icon {
    animation: documentQuickReady 3.2s ease-in-out infinite;
}

.document-quick-travel-icon,
.document-quick-library-icon,
.document-quick-leave-icon {
    animation: documentQuickReady 3.2s ease-in-out infinite;
}

.document-quick-stamp {
    position: absolute;
    right: -0.25rem;
    bottom: -0.2rem;
    display: grid;
    width: 1.18rem;
    height: 1.18rem;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 0.5rem;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35);
    animation: documentQuickStamp 3.2s ease-in-out infinite;
}

.document-quick-travel-pin,
.document-quick-leave-mark {
    position: absolute;
    right: -0.25rem;
    bottom: -0.2rem;
    display: grid;
    width: 1.18rem;
    height: 1.18rem;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 0.48rem;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.22);
    animation: documentQuickStamp 3.2s ease-in-out infinite;
}

.document-quick-travel-pin { background: #2563eb; }
.document-quick-leave-mark { background: #f59e0b; }

@keyframes documentQuickReady {
    0%, 45%, 100% { transform: translateY(0); }
    58%, 72% { transform: translateY(-2px); }
}

@keyframes documentQuickStamp {
    0%, 45%, 100% { opacity: 0.72; transform: scale(0.82); }
    60% { opacity: 1; transform: scale(1.16); }
    74%, 88% { opacity: 1; transform: scale(1); }
}

#school-documents-records { scroll-margin-top: 7rem; }
#school-documents-records-heading:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
    .document-quick-library-icon,
    .document-quick-library .document-quick-stamp { animation: none !important; }
}

.activity-quick-main::after {
    content: "";
    position: absolute;
    top: 0;
    left: -44%;
    z-index: 2;
    width: 44%;
    height: 3px;
    border-radius: 0 999px 999px 0;
    background: #0ea5e9;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.72);
    pointer-events: none;
    animation: activityQuickTimeline 3.4s ease-in-out infinite;
}

.activity-calendar-glyph {
    transform-origin: 50% 68%;
    animation: activityCalendarReady 3.4s ease-in-out infinite;
}

.activity-calendar-status {
    position: absolute;
    right: -0.28rem;
    bottom: -0.22rem;
    display: grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 0.52rem;
    box-shadow: 0 3px 8px rgba(21, 128, 61, 0.35);
    animation: activityCalendarConfirm 3.4s ease-in-out infinite;
}

.activity-quick-tournament::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 0;
    width: 18px;
    height: 18px;
    border-top: 2px solid rgba(234, 88, 12, 0.42);
    border-right: 2px solid rgba(234, 88, 12, 0.42);
    pointer-events: none;
    animation: activityTournamentBracket 2.8s ease-in-out infinite;
}

.activity-quick-tournament-icon {
    animation: activityTrophyAura 2.8s ease-in-out infinite;
}

.activity-trophy-glyph {
    transform-origin: 50% 76%;
    animation: activityTrophyVictory 2.8s ease-in-out infinite;
}

.activity-trophy-spark {
    position: absolute;
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 1px;
    background: #fef08a;
    opacity: 0;
    transform: rotate(45deg) scale(0.45);
    box-shadow: 0 0 7px rgba(254, 240, 138, 0.9);
    animation: activityTrophySpark 2.8s ease-out infinite;
}

.activity-trophy-spark-one { top: 0.3rem; left: -0.12rem; }
.activity-trophy-spark-two { top: -0.12rem; right: 0.28rem; animation-delay: 0.18s; }
.activity-trophy-spark-three { right: -0.18rem; bottom: 0.45rem; animation-delay: 0.34s; }

@keyframes activityQuickTimeline {
    0%, 16% { opacity: 0; transform: translateX(0); }
    26%, 70% { opacity: 1; }
    84%, 100% { opacity: 0; transform: translateX(330%); }
}

@keyframes activityCalendarReady {
    0%, 54%, 100% { transform: rotate(0) scale(1); }
    64% { transform: rotate(-5deg) scale(1.04); }
    72% { transform: rotate(4deg) scale(1.07); }
    80% { transform: rotate(0) scale(1); }
}

@keyframes activityCalendarConfirm {
    0%, 48%, 100% { opacity: 0.72; transform: scale(0.82); }
    62% { opacity: 1; transform: scale(1.18); }
    74%, 88% { opacity: 1; transform: scale(1); }
}

@keyframes activityTournamentBracket {
    0%, 100% { opacity: 0.2; transform: scale(0.82); }
    48%, 68% { opacity: 0.72; transform: scale(1.08); }
}

@keyframes activityTrophyAura {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 8px 15px rgba(15,23,42,0.17); }
    58% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.48), 0 8px 20px rgba(245, 158, 11, 0.62); }
}

@keyframes activityTrophyVictory {
    0%, 42%, 100% { transform: translateY(0) rotate(0) scale(1); }
    54% { transform: translateY(-3px) rotate(-4deg) scale(1.08); }
    64% { transform: translateY(-3px) rotate(4deg) scale(1.08); }
    76% { transform: translateY(0) rotate(0) scale(1); }
}

@keyframes activityTrophySpark {
    0%, 42%, 100% { opacity: 0; transform: rotate(45deg) scale(0.4); }
    58% { opacity: 1; transform: rotate(45deg) scale(1.2); }
    76% { opacity: 0; transform: rotate(45deg) scale(1.7); }
}

@media (prefers-reduced-motion: reduce) {
    .activity-quick-main::after,
    .activity-calendar-glyph,
    .activity-calendar-status,
    .activity-quick-tournament::after,
    .activity-quick-tournament-icon,
    .activity-trophy-glyph,
    .activity-trophy-spark {
        animation: none !important;
    }
}

.school-activities-shell {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    color: #172033;
}

.school-activities-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border: 1px solid #dbe7f0;
    border-top: 4px solid #0ea5e9;
    border-radius: 8px 8px 0 0;
    background: #fff;
}

.school-activities-title-wrap { display: flex; min-width: 0; align-items: center; gap: 16px; }
.school-activities-title-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 1.7rem;
    border: 1px solid #bae6fd;
}
.school-activities-eyebrow { margin: 0 0 3px; color: #0284c7; font-size: 0.7rem; font-weight: 900; text-transform: uppercase; }
.school-activities-title-wrap h2 { margin: 0; font-size: 1.45rem; font-weight: 900; line-height: 1.2; }
.school-activities-title-wrap > div > p:last-child { margin: 5px 0 0; color: #64748b; font-size: 0.82rem; font-weight: 650; }
.school-activity-refresh-button {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 9px 14px;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 850;
}
.school-activity-refresh-button:hover { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }

.school-activity-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border-right: 1px solid #dbe7f0;
    border-bottom: 1px solid #dbe7f0;
    border-left: 1px solid #dbe7f0;
    background: #dbe7f0;
}

.school-activity-mode-btn {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 16px;
    background: #f8fafc;
    color: #64748b;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
}
.school-activity-mode-btn > i { font-size: 1.35rem; }
.school-activity-mode-btn span { display: flex; min-width: 0; flex-direction: column; }
.school-activity-mode-btn strong { font-size: 0.88rem; line-height: 1.2; }
.school-activity-mode-btn small { margin-top: 3px; font-size: 0.66rem; font-weight: 700; }
.school-activity-mode-btn:hover { background: #f0f9ff; color: #0369a1; }
.school-activity-mode-btn.active { background: #fff; color: #0369a1; box-shadow: inset 0 -3px 0 #0ea5e9; }

.school-activity-panel {
    min-height: 560px;
    padding: 22px;
    border-right: 1px solid #dbe7f0;
    border-bottom: 1px solid #dbe7f0;
    border-left: 1px solid #dbe7f0;
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.school-activity-toolbar,
.school-activity-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.school-activity-toolbar-copy h3 { margin: 0; font-size: 1.08rem; font-weight: 900; }
.school-activity-toolbar-copy p,
.school-activity-picker-row p { margin: 4px 0 0; color: #64748b; font-size: 0.75rem; font-weight: 650; }
.school-activity-primary-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 7px;
    padding: 10px 16px;
    background: #0284c7;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    box-shadow: 0 7px 16px rgba(2,132,199,0.23);
}
.school-activity-primary-button:hover { background: #0369a1; }

.school-activity-list-filters,
.school-activity-attendance-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(150px, 220px);
    gap: 10px;
    margin: 16px 0;
}
.school-activity-attendance-controls { grid-template-columns: minmax(240px, 1fr) minmax(130px, 190px) minmax(130px, 190px); }
.school-activity-search-field { position: relative; display: block; }
.school-activity-search-field i { position: absolute; top: 50%; left: 14px; color: #94a3b8; transform: translateY(-50%); }
.school-activity-search-field input,
.school-activity-list-filters select,
.school-activity-attendance-controls select,
.school-activity-picker-control select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 750;
    outline: none;
}
.school-activity-search-field input { padding: 10px 14px 10px 42px; }
.school-activity-list-filters select,
.school-activity-attendance-controls select,
.school-activity-picker-control select { padding: 8px 34px 8px 12px; }
.school-activity-search-field input:focus,
.school-activity-list-filters select:focus,
.school-activity-attendance-controls select:focus,
.school-activity-picker-control select:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.14); }

.school-activity-list { display: grid; gap: 10px; }
.school-activity-list-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid #dbe7f0;
    border-left: 4px solid #0ea5e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(15,23,42,0.055);
    overflow: hidden;
}
.school-activity-list-card.is-closed { border-left-color: #94a3b8; background: #f8fafc; }
.school-activity-card-date { display: flex; align-items: center; justify-content: center; flex-direction: column; background: #f0f9ff; color: #0369a1; border-right: 1px solid #dbeafe; }
.school-activity-list-card.is-closed .school-activity-card-date { background: #f1f5f9; color: #64748b; }
.school-activity-card-date span { font-size: 1.55rem; font-weight: 950; line-height: 1; }
.school-activity-card-date small { margin-top: 5px; font-size: 0.7rem; font-weight: 850; }
.school-activity-card-body { min-width: 0; padding: 14px 16px; }
.school-activity-card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.school-activity-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.school-activity-visibility-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid; border-radius: 999px; padding: 3px 7px; font-size: 0.56rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.school-activity-visibility-badge.all { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-activity-visibility-badge.owner { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.school-activity-card-title-row h3 { margin: 5px 0 0; font-size: 1rem; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.school-activity-state { display: inline-flex; align-items: center; gap: 5px; border: 1px solid; border-radius: 999px; padding: 3px 8px; font-size: 0.62rem; font-weight: 900; }
.school-activity-state.open { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-activity-state.closed { border-color: #cbd5e1; background: #f1f5f9; color: #64748b; }
.school-activity-progress-value { flex: 0 0 auto; color: #0284c7; font-size: 0.9rem; font-weight: 950; }
.school-activity-card-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 9px; color: #64748b; font-size: 0.69rem; font-weight: 700; }
.school-activity-card-meta span { display: inline-flex; min-width: 0; align-items: center; gap: 5px; }
.school-activity-card-meta i { width: 14px; color: #38bdf8; text-align: center; }
.school-activity-card-progress { height: 5px; margin-top: 11px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.school-activity-card-progress span { display: block; height: 100%; border-radius: inherit; background: #0ea5e9; }
.school-activity-card-counts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; color: #64748b; font-size: 0.66rem; font-weight: 700; }
.school-activity-card-counts strong { color: #172033; }
.school-activity-card-actions { display: grid; grid-template-columns: repeat(2, minmax(74px, 1fr)); align-content: center; gap: 7px; padding: 10px; border-left: 1px solid #e2e8f0; background: #f8fafc; }
.school-activity-card-actions button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; border: 1px solid; border-radius: 6px; padding: 7px 9px; font-size: 0.7rem; font-weight: 850; }
.school-activity-card-actions .attendance { border-color: #bae6fd; background: #e0f2fe; color: #0369a1; }
.school-activity-card-actions .report { border-color: #fde68a; background: #fffbeb; color: #a16207; }
.school-activity-card-actions .edit { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.school-activity-card-actions .delete { border-color: #fecaca; background: #fef2f2; color: #dc2626; }

.school-activity-picker-row > div:first-child label { display: block; color: #172033; font-size: 0.92rem; font-weight: 900; }
.school-activity-picker-control { display: grid; grid-template-columns: minmax(260px, 460px) 44px; gap: 8px; }
.school-activity-picker-control button { display: grid; min-height: 44px; place-items: center; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #475569; }
.school-activity-picker-control button:hover { border-color: #7dd3fc; color: #0284c7; }
.school-activity-empty-state { display: flex; min-height: 340px; align-items: center; justify-content: center; flex-direction: column; padding: 28px; color: #94a3b8; text-align: center; }
.school-activity-empty-state.compact { min-height: 220px; border: 1px dashed #cbd5e1; border-radius: 8px; }
.school-activity-empty-state > i { margin-bottom: 13px; color: #bae6fd; font-size: 3rem; }
.school-activity-empty-state h3 { margin: 0; color: #475569; font-size: 1rem; font-weight: 900; }
.school-activity-empty-state p { margin: 6px 0 0; font-size: 0.75rem; font-weight: 650; }
.school-activity-loading { display: flex; min-height: 180px; align-items: center; justify-content: center; gap: 10px; color: #0284c7; font-size: 0.8rem; font-weight: 850; }

.school-activity-selected-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.school-activity-selected-header h3 { margin: 6px 0 5px; font-size: 1.12rem; font-weight: 900; }
.school-activity-selected-header p { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 0; color: #526075; font-size: 0.7rem; font-weight: 700; }
.school-activity-selected-header p i { margin-right: 4px; color: #0284c7; }
.school-activity-selected-total { display: flex; min-width: 68px; height: 62px; align-items: center; justify-content: center; flex-direction: column; border: 1px solid #7dd3fc; border-radius: 8px; background: #fff; color: #0369a1; }
.school-activity-selected-total strong { font-size: 1.35rem; font-weight: 950; line-height: 1; }
.school-activity-selected-total span { margin-top: 4px; font-size: 0.65rem; font-weight: 850; }
.school-activity-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.school-activity-summary-grid > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 48px; border: 1px solid; border-radius: 7px; padding: 8px 10px; }
.school-activity-summary-grid i { font-size: 0.82rem; }
.school-activity-summary-grid span { font-size: 0.68rem; font-weight: 800; }
.school-activity-summary-grid strong { font-size: 1rem; font-weight: 950; }
.school-activity-summary-grid .total { border-color: #cbd5e1; background: #f8fafc; color: #475569; }
.school-activity-summary-grid .present { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-activity-summary-grid .late { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.school-activity-summary-grid .leave { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.school-activity-summary-grid .absent { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.school-activity-summary-grid .pending { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }

.school-activity-camera-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 12px 0;
    border: 1px solid #a5f3fc;
    border-left: 4px solid #06b6d4;
    border-radius: 8px;
    padding: 12px 14px;
    background: #ecfeff;
}
.school-activity-camera-copy { display: flex; min-width: 0; align-items: center; gap: 11px; }
.school-activity-camera-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    background: #0891b2;
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 6px 14px rgba(8,145,178,0.2);
}
.school-activity-camera-copy h3 { margin: 0; color: #164e63; font-size: 0.88rem; font-weight: 900; }
.school-activity-camera-copy p { margin: 3px 0 0; color: #527181; font-size: 0.66rem; font-weight: 700; }
.school-activity-camera-buttons { display: grid; flex: 0 0 auto; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 8px; }
.school-activity-camera-buttons button {
    display: grid;
    min-height: 54px;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid;
    border-radius: 7px;
    padding: 8px 11px;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.school-activity-camera-buttons button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 15px rgba(15,23,42,0.11); }
.school-activity-camera-buttons button > i { font-size: 1.2rem; text-align: center; }
.school-activity-camera-buttons button span { display: flex; min-width: 0; flex-direction: column; }
.school-activity-camera-buttons button strong { font-size: 0.72rem; font-weight: 900; line-height: 1.2; }
.school-activity-camera-buttons button small { margin-top: 2px; font-size: 0.57rem; font-weight: 750; opacity: 0.72; }
.school-activity-camera-buttons .face { border-color: #67e8f9; background: #fff; color: #0e7490; }
.school-activity-camera-buttons .qr { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.school-activity-camera-buttons button:disabled { cursor: not-allowed; filter: grayscale(0.65); opacity: 0.48; }
.school-activity-scanner-wrapper { min-height: 28rem; }

.school-activity-bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 7px; background: #f8fafc; }
.school-activity-bulk-actions > span { color: #526075; font-size: 0.72rem; font-weight: 850; }
.school-activity-bulk-actions > span i { margin-right: 5px; color: #8b5cf6; }
.school-activity-bulk-actions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.school-activity-bulk-actions button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 5px; border: 1px solid; border-radius: 6px; padding: 7px 10px; font-size: 0.68rem; font-weight: 850; }
.school-activity-bulk-actions .present { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.school-activity-bulk-actions .absent { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.school-activity-bulk-actions .clear { border-color: #cbd5e1; background: #fff; color: #64748b; }

.school-activity-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 10px; }
.school-activity-student-card { border: 1px solid #dbe7f0; border-left: 4px solid #cbd5e1; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,0.05); overflow: hidden; }
.school-activity-student-card.present { border-left-color: #10b981; }
.school-activity-student-card.late { border-left-color: #f59e0b; }
.school-activity-student-card.leave { border-left-color: #38bdf8; }
.school-activity-student-card.absent { border-left-color: #ef4444; }
.school-activity-student-main { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 11px; }
.school-activity-student-main img { width: 70px; height: 94px; border: 2px solid #fff; border-radius: 7px; background: #e2e8f0; object-fit: cover; box-shadow: 0 3px 10px rgba(15,23,42,0.14); }
.school-activity-student-copy { min-width: 0; }
.school-activity-student-room { display: inline-block; border-radius: 5px; padding: 2px 6px; background: #e0f2fe; color: #0369a1; font-size: 0.6rem; font-weight: 900; }
.school-activity-student-copy h4 { margin: 6px 0 2px; font-size: 0.88rem; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.school-activity-student-copy p { margin: 0; color: #64748b; font-size: 0.66rem; font-weight: 700; }
.school-activity-student-status { display: inline-block; margin-top: 6px; border-radius: 99px; padding: 3px 8px; font-size: 0.62rem; font-weight: 900; }
.school-activity-student-status.present { background: #dcfce7; color: #047857; }
.school-activity-student-status.late { background: #fef3c7; color: #b45309; }
.school-activity-student-status.leave { background: #e0f2fe; color: #0369a1; }
.school-activity-student-status.absent { background: #fee2e2; color: #b91c1c; }
.school-activity-student-status.pending { background: #f1f5f9; color: #64748b; }
.school-activity-student-copy small { display: block; max-width: 100%; margin-top: 5px; color: #526075; font-size: 0.6rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-activity-student-copy small i { margin-right: 4px; color: #38bdf8; }
.school-activity-status-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 34px; gap: 5px; padding: 8px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.school-activity-status-buttons button { min-height: 34px; border: 1px solid; border-radius: 6px; background: #fff; font-size: 0.66rem; font-weight: 900; }
.school-activity-status-buttons button.present { border-color: #a7f3d0; color: #047857; }
.school-activity-status-buttons button.late { border-color: #fde68a; color: #b45309; }
.school-activity-status-buttons button.leave { border-color: #bae6fd; color: #0369a1; }
.school-activity-status-buttons button.absent { border-color: #fecaca; color: #b91c1c; }
.school-activity-status-buttons button.reset { border-color: #cbd5e1; color: #64748b; }
.school-activity-status-buttons button.present.active { background: #10b981; border-color: #10b981; color: #fff; }
.school-activity-status-buttons button.late.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.school-activity-status-buttons button.leave.active { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.school-activity-status-buttons button.absent.active { background: #ef4444; border-color: #ef4444; color: #fff; }
.school-activity-status-buttons.disabled { opacity: 0.58; }
.school-activity-status-buttons button:disabled { cursor: not-allowed; }

.school-activity-report-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 16px 0 12px; }
.school-activity-report-actions button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; border: 1px solid; border-radius: 7px; padding: 9px 13px; font-size: 0.74rem; font-weight: 900; }
.school-activity-report-actions .print { border-color: #cbd5e1; background: #fff; color: #334155; }
.school-activity-report-actions .word { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.school-activity-report-actions .line { border-color: #86efac; background: #dcfce7; color: #047857; }
.school-activity-report-document { border: 1px solid #cbd5e1; background: #e2e8f0; padding: 18px; overflow-x: auto; }
.school-activity-report-paper { min-width: 760px; max-width: 1180px; margin: 0 auto; padding: 28px; background: #fff; color: #172033; box-shadow: 0 5px 18px rgba(15,23,42,0.12); font-family: "Sarabun", "Tahoma", sans-serif; }
.school-activity-report-paper header { border-bottom: 2px solid #172033; padding-bottom: 14px; text-align: center; }
.school-activity-report-paper header p { margin: 0 0 4px; color: #64748b; font-size: 0.68rem; font-weight: 800; }
.school-activity-report-paper h1 { margin: 0; font-size: 1.35rem; font-weight: 950; }
.school-activity-report-paper h2 { margin: 5px 0 0; font-size: 1.02rem; font-weight: 850; }
.school-activity-report-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.school-activity-report-meta > div { border: 1px solid #cbd5e1; padding: 8px; }
.school-activity-report-meta span { display: block; color: #64748b; font-size: 0.6rem; font-weight: 750; }
.school-activity-report-meta strong { display: block; margin-top: 3px; font-size: 0.72rem; }
.school-activity-report-description { margin: 10px 0 0; border: 1px solid #cbd5e1; padding: 8px; font-size: 0.7rem; }
.school-activity-report-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin: 10px 0; }
.school-activity-report-summary > div { border: 1px solid #cbd5e1; padding: 7px; text-align: center; }
.school-activity-report-summary span { display: block; font-size: 0.62rem; font-weight: 850; }
.school-activity-report-summary strong { margin: 0 3px; font-size: 1.12rem; font-weight: 950; }
.school-activity-report-summary small { font-size: 0.55rem; }
.school-activity-report-summary .present { border-color: #6ee7b7; background: #ecfdf5; color: #047857; }
.school-activity-report-summary .late { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.school-activity-report-summary .leave { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }
.school-activity-report-summary .absent { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.school-activity-report-summary .pending { border-color: #c4b5fd; background: #f5f3ff; color: #6d28d9; }
.school-activity-report-rate { margin: 8px 0; padding: 8px; background: #f1f5f9; font-size: 0.72rem; text-align: center; }
.school-activity-report-table-wrap { overflow-x: auto; }
.school-activity-report-paper table { width: 100%; border-collapse: collapse; font-size: 0.66rem; }
.school-activity-report-paper th,
.school-activity-report-paper td { border: 1px solid #94a3b8; padding: 5px 6px; }
.school-activity-report-paper th { background: #e2e8f0; text-align: center; font-weight: 900; }
.school-activity-report-paper td:first-child,
.school-activity-report-paper td:nth-child(2),
.school-activity-report-paper td:nth-child(4),
.school-activity-report-paper td:nth-child(5) { text-align: center; }
.school-activity-report-paper .report-status { font-weight: 900; }
.school-activity-report-paper .report-status.present { color: #047857; }
.school-activity-report-paper .report-status.late { color: #b45309; }
.school-activity-report-paper .report-status.leave { color: #0369a1; }
.school-activity-report-paper .report-status.absent { color: #b91c1c; }
.school-activity-report-paper .report-status.pending { color: #64748b; }
.school-activity-report-paper footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; color: #526075; font-size: 0.62rem; font-weight: 700; }

.school-activity-form-popup { border-radius: 8px !important; }
.school-activity-form-title { display: inline-flex; align-items: center; gap: 9px; color: #172033; font-size: 1.2rem; font-weight: 950; }
.school-activity-form-title i { color: #0284c7; }
.school-activity-form { max-height: 66vh; padding: 2px 3px 4px; overflow-y: auto; color: #334155; text-align: left; }
.school-activity-form > label,
.school-activity-form-grid label { display: block; }
.school-activity-form label > span,
.school-activity-form-section-label { display: block; margin-bottom: 5px; color: #475569; font-size: 0.7rem; font-weight: 850; }
.school-activity-form label > span b,
.school-activity-form-section-label b { color: #dc2626; }
.school-activity-form input,
.school-activity-form textarea,
.school-activity-form select { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #172033; font-size: 0.78rem; font-weight: 700; outline: none; }
.school-activity-form input,
.school-activity-form select { min-height: 42px; padding: 9px 11px; }
.school-activity-form textarea { padding: 10px 11px; resize: vertical; }
.school-activity-form input:focus,
.school-activity-form textarea:focus,
.school-activity-form select:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.14); }
.school-activity-form > label,
.school-activity-form-grid,
.school-activity-form-section,
.school-activity-form-status { margin-bottom: 12px; }
.school-activity-form-grid { display: grid; gap: 10px; }
.school-activity-form-grid.three { grid-template-columns: 1.2fr 1fr 1fr; }
.school-activity-form-section { border: 1px solid #dbe7f0; border-radius: 7px; padding: 11px; background: #f8fafc; }
.school-activity-target-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.school-activity-target-options > label { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 9px; min-height: 60px; border: 1px solid #cbd5e1; border-radius: 7px; padding: 9px 11px; background: #fff; cursor: pointer; }
.school-activity-target-options > label.selected { border-color: #38bdf8; background: #f0f9ff; box-shadow: inset 0 0 0 1px #38bdf8; }
.school-activity-target-options input { width: 17px; min-height: 17px; height: 17px; padding: 0; accent-color: #0284c7; }
.school-activity-target-options input:disabled,
.school-activity-room-options input:disabled { cursor: not-allowed; }
.school-activity-target-options label:has(input:disabled),
.school-activity-room-options label:has(input:disabled) { cursor: not-allowed; opacity: 0.72; }
.school-activity-target-options i { color: #0284c7; font-size: 1.1rem; }
.school-activity-target-options span { margin: 0 !important; }
.school-activity-target-options strong,
.school-activity-target-options small { display: block; }
.school-activity-target-options strong { font-size: 0.75rem; }
.school-activity-target-options small { margin-top: 2px; color: #64748b; font-size: 0.59rem; font-weight: 650; }
.school-activity-visibility-options > label:first-child > i { color: #059669; }
.school-activity-visibility-options > label:last-child > i { color: #7c3aed; }
.school-activity-visibility-options > label:last-child.selected { border-color: #a78bfa; background: #f5f3ff; box-shadow: inset 0 0 0 1px #a78bfa; }
.school-activity-visibility-note { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: #64748b; font-size: 0.61rem; font-weight: 700; line-height: 1.35; }
.school-activity-visibility-note i { color: #7c3aed; }
.school-activity-room-picker { display: grid; gap: 8px; max-height: 240px; margin-top: 9px; overflow-y: auto; }
.school-activity-target-locked { display: flex; align-items: center; gap: 7px; margin: 9px 0 0; border-left: 3px solid #f59e0b; padding: 7px 9px; background: #fffbeb; color: #92400e; font-size: 0.64rem; font-weight: 750; }
.school-activity-room-group { border: 1px solid #dbe7f0; border-radius: 6px; padding: 8px; background: #fff; }
.school-activity-room-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.school-activity-room-group legend { color: #334155; font-size: 0.68rem; font-weight: 900; }
.school-activity-room-group-heading button { color: #0284c7; font-size: 0.6rem; font-weight: 850; }
.school-activity-room-group-heading button:disabled { color: #94a3b8; cursor: not-allowed; }
.school-activity-room-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.school-activity-room-options label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dbe7f0; border-radius: 5px; padding: 5px 8px; background: #f8fafc; cursor: pointer; }
.school-activity-room-options input { width: 14px; min-height: 14px; height: 14px; padding: 0; accent-color: #0284c7; }
.school-activity-room-options label > span { margin: 0; color: #475569; font-size: 0.64rem; }
.school-activity-form-status { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); align-items: center; gap: 10px; margin-bottom: 0 !important; }
.school-activity-form-status > span { margin: 0 !important; }
.school-activity-form-confirm,
.school-activity-form-cancel { border-radius: 7px !important; font-weight: 850 !important; }

@media (max-width: 767px) {
    .dashboard-quick-menu-heading { align-items: stretch; flex-direction: column; gap: 9px; }
    .dashboard-quick-tabs { width: 100%; }
    .dashboard-quick-tab { min-height: 38px; gap: 4px; padding: 5px 4px; font-size: 0.64rem; }
    .dashboard-activity-quick-menu .activity-quick-button { padding: 0.35rem 0.2rem !important; }
    .activity-quick-icon { width: 2.4rem; height: 2.4rem; margin-bottom: 0.25rem; border-radius: 0.7rem; font-size: 1.25rem; }
    .activity-quick-label { min-height: 2.5em; display: flex; align-items: center; justify-content: center; font-size: 0.64rem; line-height: 1.25; }
    .activity-quick-caption { display: none; }

    .school-activities-header { align-items: flex-start; padding: 15px 13px; border-top-width: 3px; }
    .school-activities-title-wrap { gap: 10px; }
    .school-activities-title-icon { width: 45px; height: 45px; font-size: 1.25rem; }
    .school-activities-eyebrow { font-size: 0.58rem; }
    .school-activities-title-wrap h2 { font-size: 1.02rem; }
    .school-activities-title-wrap > div > p:last-child { font-size: 0.65rem; line-height: 1.35; }
    .school-activity-refresh-button { width: 42px; min-height: 42px; padding: 0; }
    .school-activity-refresh-button span { display: none; }
    .school-activity-mode-btn { min-height: 78px; flex-direction: column; gap: 5px; padding: 9px 4px; text-align: center; }
    .school-activity-mode-btn > i { font-size: 1.15rem; }
    .school-activity-mode-btn strong { font-size: 0.66rem; line-height: 1.2; }
    .school-activity-mode-btn small { display: none; }
    .school-activity-panel { min-height: 520px; padding: 12px; }
    .school-activity-toolbar,
    .school-activity-picker-row { align-items: stretch; flex-direction: column; gap: 10px; }
    .school-activity-toolbar-copy h3 { font-size: 0.94rem; }
    .school-activity-primary-button { width: 100%; }
    .school-activity-list-filters,
    .school-activity-attendance-controls { grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
    .school-activity-list-card { grid-template-columns: 54px minmax(0, 1fr); }
    .school-activity-card-date span { font-size: 1.2rem; }
    .school-activity-card-body { padding: 11px 10px; }
    .school-activity-card-title-row h3 { font-size: 0.84rem; }
    .school-activity-card-meta { display: grid; grid-template-columns: 1fr; gap: 5px; font-size: 0.62rem; }
    .school-activity-card-actions { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #e2e8f0; border-left: 0; padding: 7px; }
    .school-activity-card-actions button { min-width: 0; min-height: 38px; padding: 6px; }
    .school-activity-card-actions button span { display: none; }
    .school-activity-picker-control { grid-template-columns: minmax(0, 1fr) 42px; }
    .school-activity-selected-header { align-items: flex-start; padding: 12px; }
    .school-activity-selected-header h3 { font-size: 0.9rem; }
    .school-activity-selected-header p { display: grid; grid-template-columns: 1fr; gap: 4px; }
    .school-activity-selected-total { min-width: 56px; height: 55px; }
    .school-activity-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .school-activity-summary-grid > div { min-height: 46px; grid-template-columns: auto minmax(0, 1fr); gap: 5px; padding: 7px; }
    .school-activity-summary-grid strong { grid-column: 2; font-size: 0.9rem; }
    .school-activity-camera-actions { align-items: stretch; flex-direction: column; gap: 10px; padding: 11px; }
    .school-activity-camera-icon { width: 40px; height: 40px; font-size: 1rem; }
    .school-activity-camera-copy h3 { font-size: 0.8rem; }
    .school-activity-camera-copy p { font-size: 0.6rem; line-height: 1.3; }
    .school-activity-camera-buttons { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-activity-camera-buttons button { min-width: 0; min-height: 58px; grid-template-columns: 28px minmax(0, 1fr); gap: 5px; padding: 7px; }
    .school-activity-camera-buttons button > i { font-size: 1.05rem; }
    .school-activity-camera-buttons button strong { font-size: 0.64rem; }
    .school-activity-camera-buttons button small { font-size: 0.52rem; }
    .school-activity-bulk-actions { align-items: stretch; flex-direction: column; }
    .school-activity-bulk-actions > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .school-activity-bulk-actions button { min-width: 0; padding: 7px 4px; font-size: 0.58rem; }
    .school-activity-student-grid { grid-template-columns: 1fr; }
    .school-activity-student-main { grid-template-columns: 82px minmax(0, 1fr); }
    .school-activity-student-main img { width: 82px; height: 110px; }
    .school-activity-student-copy h4 { font-size: 0.86rem; }
    .school-activity-status-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)) 36px; }
    .school-activity-status-buttons button { min-height: 38px; }
    .school-activity-report-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .school-activity-report-actions button { min-width: 0; min-height: 52px; flex-direction: column; gap: 3px; padding: 6px 3px; font-size: 0.58rem; line-height: 1.2; }
    .school-activity-report-document { padding: 8px; }
    .school-activity-report-paper { min-width: 0; padding: 14px; }
    .school-activity-report-paper h1 { font-size: 1.05rem; }
    .school-activity-report-paper h2 { font-size: 0.88rem; }
    .school-activity-report-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-activity-report-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .school-activity-report-paper table { min-width: 650px; }
    .school-activity-report-paper footer { align-items: flex-start; flex-direction: column; gap: 5px; }
    .school-activity-form { max-height: 69vh; }
    .school-activity-form-grid.three,
    .school-activity-target-options { grid-template-columns: 1fr; }
    .school-activity-form-status { grid-template-columns: 1fr; }
}

/* Student directory cards reuse the compact school-activity roster language. */
.management-student-grid {
    align-items: stretch;
}

.management-student-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.management-student-main,
.management-student-actions,
.management-student-action,
.management-room-permission {
    box-sizing: border-box;
}

.management-student-photo {
    display: block;
    box-sizing: border-box;
    width: 70px;
    height: 94px;
    flex-shrink: 0;
    overflow: hidden;
    border: 4px solid #fff;
    border-radius: 8px;
    padding: 0;
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    cursor: zoom-in;
}

.management-student-photo img,
.school-activity-student-main .management-student-photo img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center top;
}

.management-student-photo:focus-visible,
.management-student-name:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 3px;
}

.management-student-number {
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.management-student-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 5px;
}

.management-profile-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    line-height: 1.5;
    letter-spacing: 0;
}

.management-profile-status li {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
    white-space: normal;
}

.management-profile-status li > i {
    flex: 0 0 14px;
    text-align: center;
}

.management-profile-status .is-saved { color: #166534; }
.management-profile-status .is-saved > i { color: #15803d; }
.management-profile-status .is-missing { color: #64748b; }
.management-profile-status .is-missing > i { color: #94a3b8; }

.management-student-card > .management-profile-status {
    margin: 0;
    padding: 0 12px 12px;
}

.management-roster-table th,
.management-roster-table td {
    padding: 10px 8px;
}

.management-roster-table .management-student-details {
    min-width: 235px;
    white-space: normal;
}

.management-roster-table .management-student-photo {
    margin: 0 auto;
}

.management-roster-table .management-student-name {
    font-size: 1rem;
}

.management-student-name {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    gap: 6px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #172033;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.management-student-name > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.management-student-name > i {
    flex: 0 0 auto;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.58rem;
}

.management-student-copy > p i {
    margin-right: 3px;
    color: #94a3b8;
}

.management-student-copy .school-activity-student-status i {
    margin-right: 3px;
}

.management-student-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    gap: 5px;
    border-top: 1px solid #e2e8f0;
    padding: 8px;
    background: #f8fafc;
}

.management-student-action {
    display: inline-flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid;
    border-radius: 6px;
    padding: 6px 4px;
    background: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.1;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.management-student-action:active {
    transform: scale(0.97);
}

.management-student-action > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.management-student-action.scanner { border-color: #d8b4fe; color: #7e22ce; }
.management-student-action.scanner.active { border-color: #8b5cf6; background: #8b5cf6; color: #fff; }
.management-student-action.photo { border-color: #bae6fd; color: #0369a1; }
.management-student-action.edit { border-color: #fde68a; color: #b45309; }
.management-student-action.delete { border-color: #fecaca; color: #b91c1c; }

.management-room-permission {
    display: grid;
    width: 100%;
    min-height: 58px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
}

.management-room-permission-ready {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.management-room-permission-button {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
    cursor: pointer;
}

.management-room-permission-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255,255,255,0.82);
    font-size: 0.92rem;
}

.management-room-permission-copy {
    min-width: 0;
}

.management-room-permission-copy strong,
.management-room-permission-copy small {
    display: block;
}

.management-room-permission-copy strong {
    overflow-wrap: anywhere;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.25;
}

.management-room-permission-copy small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 750;
    line-height: 1.25;
}

.management-room-permission-count {
    display: inline-flex;
    min-width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    padding: 0 7px;
    background: #fff;
    color: currentColor;
    font-size: 0.72rem;
    font-weight: 900;
}

.management-primary-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 8px;
}

.management-primary-action {
    --management-action-accent: #2563eb;
    --management-action-bg: #eff6ff;
    --management-action-border: #bfdbfe;
    display: grid;
    min-width: 0;
    min-height: 58px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid var(--management-action-border);
    border-left: 4px solid var(--management-action-accent);
    border-radius: 8px;
    padding: 8px 10px 8px 8px;
    background: var(--management-action-bg);
    color: #172033;
    text-align: left;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.07);
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.management-primary-action:hover {
    filter: saturate(1.08);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.1);
}

.management-primary-action:active {
    transform: scale(0.98);
}

.management-primary-action > i {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--management-action-accent);
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--management-action-accent) 28%, transparent);
}

.management-primary-action > span {
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: keep-all;
}

.management-primary-action.is-import {
    --management-action-accent: #059669;
    --management-action-bg: #ecfdf5;
    --management-action-border: #a7f3d0;
}

.management-primary-action.is-add {
    --management-action-accent: #0891b2;
    --management-action-bg: #ecfeff;
    --management-action-border: #a5f3fc;
}

.management-primary-action.is-delete-level {
    --management-action-accent: #d97706;
    --management-action-bg: #fffbeb;
    --management-action-border: #fde68a;
}

.management-primary-action.is-clear {
    --management-action-accent: #dc2626;
    --management-action-bg: #fef2f2;
    --management-action-border: #fecaca;
    color: #991b1b;
}

.management-csv-guide {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #334155;
}

.management-permission-actions {
    --management-permission-width: 270px;
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 14px;
    padding: 3px 3px 7px;
    scroll-padding-inline: 3px;
    scrollbar-width: thin;
}

.management-permission-actions:not(:has(> :not(.hidden))) {
    display: none;
}

.management-profile-lock-actions:not(.hidden) {
    display: contents;
}

.management-permission-actions > #management-room-photo-permission-action,
.management-profile-lock-actions > .management-room-permission {
    flex: 1 0 var(--management-permission-width);
    width: auto;
    min-width: 0;
}

.management-permission-actions > #management-room-photo-permission-action > .management-room-permission {
    height: 100%;
}

.management-permission-actions .management-room-permission-button {
    transition: background-color 140ms ease, border-color 140ms ease;
}

.management-permission-actions .management-room-permission-button:hover:not(:disabled) {
    border-color: #7dd3fc;
    background: #e0f2fe;
}

.management-permission-actions button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.management-permission-actions:focus-visible,
.management-permission-actions button:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 1px;
}

@media (max-width: 767px) {
    .management-permission-actions {
        --management-permission-width: 250px;
    }
}

.management-csv-guide > summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #1e40af;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.management-csv-guide > summary::-webkit-details-marker {
    display: none;
}

.management-csv-guide-title {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.3;
}

.management-csv-guide-title > i {
    flex: 0 0 auto;
    font-size: 0.96rem;
}

.management-csv-guide-chevron {
    flex: 0 0 auto;
    font-size: 0.72rem;
    transition: transform 180ms ease;
}

.management-csv-guide[open] .management-csv-guide-chevron {
    transform: rotate(180deg);
}

.management-csv-guide-content {
    border-top: 1px solid #bfdbfe;
    padding: 12px 14px 14px;
    background: #f8fbff;
    font-size: 0.75rem;
    line-height: 1.55;
    animation: management-csv-guide-reveal 180ms ease-out;
}

@keyframes management-csv-guide-reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .management-page-shell {
        min-height: 0 !important;
        border: 1px solid #dbe7f0;
        border-radius: 8px !important;
        padding: 10px !important;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
    }

    .management-primary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .management-primary-action {
        min-height: 68px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 8px;
        padding: 9px 8px 9px 7px;
    }

    .management-primary-action > i {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .management-primary-action > span {
        font-size: 0.76rem;
        line-height: 1.25;
    }

    .management-csv-guide {
        margin-bottom: 12px;
    }

    .management-csv-guide > summary {
        min-height: 46px;
        padding: 9px 11px;
    }

    .management-csv-guide-title {
        font-size: 0.76rem;
    }

    .management-csv-guide-content {
        padding: 10px 11px 12px;
        font-size: 0.68rem;
    }

    .management-room-toolbar {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .management-room-nav {
        width: 100%;
        min-height: 46px;
        border-radius: 8px !important;
        padding: 8px 10px !important;
        box-shadow: none !important;
    }

    .management-room-back,
    .management-room-label {
        font-size: 0.76rem !important;
    }

    .management-room-nav > span.mx-3 {
        margin-right: 9px;
        margin-left: 9px;
    }

    #management-room-photo-permission-action,
    .management-room-permission {
        width: 100%;
    }

    .management-student-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .management-student-card .management-student-main {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 11px;
        padding: 11px;
    }

    .management-student-photo {
        width: 82px;
        height: 110px;
    }

    .management-student-copy h4 {
        font-size: 0.9rem;
    }

    .management-student-actions {
        grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    }
}

@media (max-width: 639px) {
    #management-folders.management-folders-levels,
    #management-folders.management-folders-rooms {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #management-folders.management-folders-levels .management-folder-level-card {
        min-width: 0;
        min-height: 104px;
        border-radius: 12px;
        padding: 10px 4px;
    }

    #management-folders.management-folders-levels .management-folder-level-icon {
        margin-bottom: 6px;
        font-size: 1.7rem;
    }

    #management-folders.management-folders-levels .management-folder-level-name {
        font-size: 0.72rem;
        line-height: 1.3;
    }

    #management-folders.management-folders-levels .management-folder-level-count {
        max-width: 100%;
        overflow: hidden;
        padding: 3px 6px;
        font-size: 0.62rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #management-folders.management-folders-rooms .management-folder-room-card {
        min-width: 0;
        min-height: 112px;
        border-radius: 12px;
        padding: 9px 4px;
    }

    #management-folders.management-folders-rooms .management-folder-room-icon {
        margin-bottom: 6px;
        font-size: 1.7rem;
    }

    #management-folders.management-folders-rooms .management-folder-room-name {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    #management-folders.management-folders-rooms .management-folder-room-stats {
        width: 100%;
        justify-content: center;
        gap: 3px;
        margin-top: 6px;
    }

    #management-folders.management-folders-rooms .management-folder-room-count,
    #management-folders.management-folders-rooms .management-folder-room-face-count {
        min-width: 0;
        overflow: hidden;
        padding: 3px 4px;
        font-size: 0.56rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 359px) {
    .management-student-action {
        min-height: 44px;
        flex-direction: column;
        gap: 2px;
        padding: 4px 2px;
    }

    .management-student-action > i {
        font-size: 0.68rem;
    }

    .management-student-action > span {
        max-width: 100%;
        font-size: 0.56rem;
    }
}

/* Student profile details: one readable flow on phones, balanced columns on desktop. */
.student-profile-modal {
    box-sizing: border-box;
    padding: 16px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.student-profile-dialog {
    display: flex;
    width: min(100%, 980px);
    max-height: 92vh;
    max-height: calc(100dvh - 32px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dbe7f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.student-profile-header {
    position: relative;
    flex: 0 0 auto;
    border-top: 4px solid #20b8df;
    border-bottom: 1px solid #dceaf2;
    padding: 18px 66px 18px 20px;
    background: #f5fbfe;
}

.student-profile-hero {
    display: grid;
    min-width: 0;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.student-profile-photo {
    display: block;
    width: 108px;
    height: 144px;
    border: 4px solid #fff;
    border-radius: 10px;
    background: #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
    cursor: zoom-in;
    object-fit: cover;
    object-position: center top;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.student-profile-photo:hover {
    box-shadow: 0 9px 24px rgba(15, 23, 42, 0.2);
    transform: translateY(-2px);
}

.student-profile-heading {
    min-width: 0;
}

.student-profile-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 900;
}

.student-profile-heading h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.3rem, 2.3vw, 1.9rem);
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.student-profile-identity-list {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
}

.student-profile-identity-item,
.student-profile-status-badge {
    display: inline-flex;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.2;
}

.student-profile-identity-item {
    border: 1px solid #cfe6f3;
    background: #fff;
    color: #334155;
}

.student-profile-identity-item i {
    color: #0ea5e9;
}

.student-profile-status-badge.locked {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.student-profile-status-badge.editable {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.student-profile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe7f0;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
    transition: background-color 150ms ease, color 150ms ease, transform 120ms ease;
}

.student-profile-close:hover {
    background: #fff1f2;
    color: #dc2626;
}

.student-profile-close:active {
    transform: scale(0.95);
}

.student-profile-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 20px 22px;
    background: #fff;
}

.student-profile-overview,
.student-profile-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.student-profile-section,
.student-profile-media-section {
    min-width: 0;
    border: 1px solid #dfe8ef;
    border-radius: 10px;
    background: #fff;
}

.student-profile-section {
    padding: 16px;
}

.student-profile-section.personal {
    border-top: 3px solid #38bdf8;
}

.student-profile-section.family {
    border-top: 3px solid #34d399;
}

.student-profile-section-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.student-profile-section-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eaf7fd;
    color: #0284c7;
}

.student-profile-section.family .student-profile-section-icon {
    background: #ecfdf5;
    color: #059669;
}

.student-profile-section-heading > div,
.student-profile-media-heading > div {
    min-width: 0;
}

.student-profile-section-heading h3 {
    margin: 0;
    color: #172033;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.25;
}

.student-profile-section-heading p {
    margin: 2px 0 0;
    color: #8492a6;
    font-size: 0.65rem;
    font-weight: 650;
    line-height: 1.25;
}

.student-profile-detail-list,
.student-profile-family-list {
    border-top: 1px solid #edf2f7;
}

.student-profile-detail-row {
    display: grid;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
}

.student-profile-detail-row:last-child,
.student-profile-family-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.student-profile-detail-row > i {
    color: #38a3d1;
    text-align: center;
}

.student-profile-detail-row > div,
.student-profile-family-value {
    min-width: 0;
}

.student-profile-detail-row span,
.student-profile-detail-row strong {
    display: block;
}

.student-profile-detail-row span {
    color: #8492a6;
    font-size: 0.62rem;
    font-weight: 700;
}

.student-profile-detail-row strong {
    margin-top: 1px;
    color: #263449;
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.student-profile-phone-link {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    border: 1px solid #bae6fd;
    border-radius: 7px;
    padding: 5px 8px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}

.student-profile-phone-link:hover {
    border-color: #38bdf8;
    background: #e0f2fe;
}

.student-profile-phone-link:active,
.student-profile-contact:active {
    transform: scale(0.97);
}

.student-profile-family-row {
    display: grid;
    min-width: 0;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
}

.student-profile-family-label {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 0.65rem;
    font-weight: 900;
}

.student-profile-family-label.father { background: #eff6ff; color: #1d4ed8; }
.student-profile-family-label.mother { background: #fdf2f8; color: #be185d; }
.student-profile-family-label.guardian { background: #ecfdf5; color: #047857; }

.student-profile-family-value {
    color: #334155;
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.student-profile-family-value > span:first-child {
    display: inline;
}

.student-profile-contact {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 5px;
    margin: 3px 0 0 5px;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 0.64rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 140ms ease, transform 100ms ease;
}

.student-profile-contact:hover { filter: brightness(0.96); }

.student-profile-contact.blue { background: #eff6ff; color: #1d4ed8; }
.student-profile-contact.pink { background: #fdf2f8; color: #be185d; }
.student-profile-contact.green { background: #ecfdf5; color: #047857; }
.student-profile-contact.hidden { display: none; }

.student-profile-media-grid {
    margin-top: 14px;
}

.student-profile-media-section {
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.student-profile-media-heading {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.student-profile-media-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 900;
}

.student-profile-media-heading > div i {
    color: #f59e0b;
}

.student-profile-media-section:last-child .student-profile-media-heading > div i {
    color: #0d9488;
}

.student-profile-media-heading small {
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 650;
}

.student-profile-nav-button {
    display: inline-flex;
    min-height: 32px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #99f6e4;
    border-radius: 7px;
    padding: 6px 10px;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 0.66rem;
    font-weight: 900;
}

.student-profile-nav-button.hidden {
    display: none;
}

.student-profile-media-frame {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 220px;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 8px;
    background: #f8fafc;
    aspect-ratio: 4 / 3;
}

.student-profile-media-frame.house {
    border-style: dashed;
}

.student-profile-media-frame img,
.student-profile-media-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.student-profile-media-frame img {
    cursor: zoom-in;
    object-fit: cover;
}

.student-profile-media-frame iframe {
    position: absolute;
    inset: 0;
}

.student-profile-media-frame img.hidden,
.student-profile-media-frame iframe.hidden,
.student-profile-empty-media.hidden {
    display: none;
}

.student-profile-empty-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 750;
}

.student-profile-empty-media i {
    font-size: 1.7rem;
    opacity: 0.65;
}

.student-profile-lock-action {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    border-top: 1px solid #edf2f7;
    padding-top: 10px;
}

.student-profile-lock-button {
    display: inline-flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.25;
}

.student-profile-lock-button.unlock {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.student-profile-lock-button.lock {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

@media (max-width: 640px) {
    .student-profile-modal {
        align-items: center;
        padding: 8px;
    }

    .student-profile-dialog {
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .student-profile-header {
        padding: 13px 48px 13px 13px;
    }

    .student-profile-hero {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 11px;
    }

    .student-profile-photo {
        width: 82px;
        height: 109px;
        border-width: 3px;
        border-radius: 8px;
    }

    .student-profile-eyebrow {
        gap: 5px;
        margin-bottom: 4px;
        font-size: 0.64rem;
    }

    .student-profile-heading h2 {
        font-size: 1rem;
        line-height: 1.32;
    }

    .student-profile-identity-list {
        gap: 4px;
        margin-top: 7px;
    }

    .student-profile-identity-item,
    .student-profile-status-badge {
        min-height: 25px;
        gap: 4px;
        border-radius: 6px;
        padding: 4px 6px;
        font-size: 0.59rem;
    }

    .student-profile-close {
        top: 11px;
        right: 10px;
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .student-profile-body {
        padding: 10px 10px 14px;
    }

    .student-profile-overview,
    .student-profile-media-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .student-profile-section,
    .student-profile-media-section {
        border-radius: 9px;
    }

    .student-profile-section {
        padding: 12px;
    }

    .student-profile-section-heading {
        gap: 8px;
        margin-bottom: 9px;
    }

    .student-profile-section-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 7px;
        font-size: 0.78rem;
    }

    .student-profile-section-heading h3 {
        font-size: 0.82rem;
    }

    .student-profile-section-heading p {
        font-size: 0.58rem;
    }

    .student-profile-detail-row,
    .student-profile-family-row {
        padding: 8px 0;
    }

    .student-profile-detail-row span {
        font-size: 0.58rem;
    }

    .student-profile-detail-row strong,
    .student-profile-family-value {
        font-size: 0.7rem;
    }

    .student-profile-phone-link {
        min-height: 32px;
        font-size: 0.66rem;
    }

    .student-profile-family-row {
        grid-template-columns: 66px minmax(0, 1fr);
        gap: 8px;
    }

    .student-profile-family-label {
        font-size: 0.59rem;
    }

    .student-profile-contact {
        margin-left: 3px;
        font-size: 0.58rem;
    }

    .student-profile-media-grid {
        margin-top: 10px;
    }

    .student-profile-media-section {
        padding: 11px;
    }

    .student-profile-media-heading {
        margin-bottom: 8px;
    }

    .student-profile-media-heading > div {
        font-size: 0.75rem;
    }

    .student-profile-media-heading small {
        display: none;
    }

    .student-profile-media-frame {
        min-height: 180px;
    }
}

@media (max-width: 359px) {
    .student-profile-hero {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 9px;
    }

    .student-profile-photo {
        width: 72px;
        height: 96px;
    }

    .student-profile-heading h2 {
        font-size: 0.92rem;
    }

    .student-profile-identity-item,
    .student-profile-status-badge {
        font-size: 0.54rem;
    }
}

/* Keep the four activity workflows balanced inside the wider desktop dashboard. */
@media (min-width: 768px) {
    .dashboard-quick-menu.dashboard-activity-quick-menu {
        grid-template-columns: repeat(auto-fit, minmax(124px, 150px)) !important;
        justify-content: start;
    }

    .dashboard-activity-quick-menu > .activity-quick-button {
        min-height: 0;
        aspect-ratio: 1 / 1;
    }
}

/* =========================================================
   ATTENDANCE WORKSPACES
   Shared visual language for camera and manual attendance.
   ========================================================= */
.attendance-workspace-shell {
    --attendance-accent: #0ea5e9;
    --attendance-accent-dark: #0369a1;
    --attendance-accent-soft: #e0f2fe;
    --attendance-accent-border: #bae6fd;
    --attendance-accent-ring: rgba(14, 165, 233, 0.14);
    width: 100%;
    max-width: 74rem;
    margin: 0 auto;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #dbe7f0;
    border-radius: 8px !important;
    background: #fff;
    color: #172033;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07) !important;
}

.attendance-workspace--assembly {
    --attendance-accent: #2563eb;
    --attendance-accent-dark: #1d4ed8;
    --attendance-accent-soft: #dbeafe;
    --attendance-accent-border: #bfdbfe;
    --attendance-accent-ring: rgba(37, 99, 235, 0.14);
}

.attendance-workspace--manual {
    --attendance-accent: #059669;
    --attendance-accent-dark: #047857;
    --attendance-accent-soft: #d1fae5;
    --attendance-accent-border: #a7f3d0;
    --attendance-accent-ring: rgba(5, 150, 105, 0.14);
    max-width: none;
}

.attendance-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex: 0 0 auto;
    padding: 20px 22px;
    border-top: 4px solid var(--attendance-accent);
    border-bottom: 1px solid #dbe7f0;
    background: #fff;
}

.attendance-workspace-title-wrap {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 15px;
}

.attendance-workspace-title-icon {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--attendance-accent-border);
    border-radius: 8px;
    background: var(--attendance-accent-soft);
    color: var(--attendance-accent-dark);
    font-size: 1.55rem;
}

.attendance-workspace-eyebrow {
    margin: 0 0 3px;
    color: var(--attendance-accent-dark);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
}

.attendance-workspace-title-wrap h2 {
    margin: 0;
    color: #172033;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.22;
}

.attendance-workspace-title-wrap > div > p:last-child {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 0.79rem;
    font-weight: 650;
    line-height: 1.35;
}

.attendance-workspace-badge {
    display: inline-flex;
    min-height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--attendance-accent-border);
    border-radius: 999px;
    padding: 8px 13px;
    background: var(--attendance-accent-soft);
    color: var(--attendance-accent-dark);
    font-size: 0.72rem;
    font-weight: 900;
}

.attendance-line-summary-row {
    display: flex;
    justify-content: flex-end;
    margin: -2px 0 16px;
}

.attendance-line-summary-trigger {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #049f44;
    border-radius: 7px;
    padding: 9px 14px;
    background: #06c755;
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(6, 199, 85, 0.2);
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.attendance-line-summary-trigger:hover {
    background: #05ad4a;
    box-shadow: 0 8px 18px rgba(6, 199, 85, 0.26);
    transform: translateY(-1px);
}

.attendance-line-summary-trigger:focus-visible {
    outline: 3px solid rgba(6, 199, 85, 0.24);
    outline-offset: 2px;
}

.attendance-line-summary-trigger .fa-line {
    font-size: 1.25rem;
}

.attendance-line-swal {
    overflow: hidden !important;
    border: 1px solid #d8e4dd !important;
    border-radius: 8px !important;
    padding: 0 0 18px !important;
    background: #fff !important;
}

.attendance-line-swal .swal2-close {
    top: 7px;
    right: 7px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #526278;
    font-size: 1.8rem;
}

.attendance-line-swal .swal2-html-container {
    margin: 0 !important;
    padding: 0 20px !important;
    overflow: visible !important;
}

.attendance-line-popup {
    color: #172033;
    text-align: left;
}

.attendance-line-popup-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 -20px 16px;
    padding: 19px 58px 17px 20px;
    border-top: 4px solid #06c755;
    border-bottom: 1px solid #dfe9e3;
    background: #f5fcf7;
}

.attendance-line-popup-icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    place-items: center;
    border-radius: 8px;
    background: #06c755;
    color: #fff;
    font-size: 1.8rem;
}

.attendance-line-popup-head h3,
.attendance-line-popup-head p {
    margin: 0;
}

.attendance-line-popup-head h3 {
    color: #153022;
    font-size: 1.24rem;
    line-height: 1.25;
    font-weight: 900;
}

.attendance-line-popup-head p {
    margin-top: 4px;
    color: #4d6558;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 750;
}

.attendance-line-date {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #dce6ee;
    border-radius: 7px;
    background: #f8fafc;
    color: #33445a;
    font-size: 0.9rem;
    font-weight: 800;
}

.attendance-line-date > i {
    color: #0784b3;
}

.attendance-line-date > span {
    margin-left: auto;
    color: #0c7251;
    white-space: nowrap;
}

.attendance-line-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 11px;
}

.attendance-line-stats > div {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 5px;
    padding: 11px;
    border: 1px solid #dce5ec;
    border-top: 3px solid currentColor;
    border-radius: 7px;
    background: #fff;
}

.attendance-line-stats .present { color: #078c60; }
.attendance-line-stats .leave { color: #087ea4; }
.attendance-line-stats .absent { color: #dc3434; }

.attendance-line-stats span,
.attendance-line-stats small {
    font-size: 0.84rem;
    font-weight: 850;
}

.attendance-line-stats strong {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 900;
}

.attendance-line-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.attendance-line-secondary span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid #dce5ec;
    border-radius: 6px;
    background: #f8fafc;
    color: #526278;
    font-size: 0.8rem;
    font-weight: 800;
}

.attendance-line-secondary i { color: #63758a; }
.attendance-line-secondary b { color: #172033; }

.attendance-line-absent-list,
.attendance-line-message-preview {
    margin-top: 13px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fff;
}

.attendance-line-absent-list h4,
.attendance-line-message-preview h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #e5ebf0;
    color: #28394e;
    font-size: 0.92rem;
    line-height: 1.3;
    font-weight: 900;
}

.attendance-line-absent-list h4 i { color: #dc3434; }
.attendance-line-message-preview h4 i { color: #06a94a; }

.attendance-line-absent-list ol {
    max-height: 170px;
    margin: 0;
    padding: 7px 12px 7px 40px;
    overflow-y: auto;
}

.attendance-line-absent-list li {
    padding: 6px 0;
    color: #293a50;
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 800;
}

.attendance-line-absent-list li small {
    display: block;
    margin-top: 2px;
    color: #728094;
    font-size: 0.75rem;
    font-weight: 700;
}

.attendance-line-no-absent {
    margin: 0;
    padding: 15px 12px;
    color: #078c60;
    font-size: 0.92rem;
    font-weight: 900;
}

.attendance-line-no-absent i { margin-right: 7px; }

.attendance-line-message-preview pre {
    max-height: 230px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    background: #f8fafc;
    color: #26374d;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: Tahoma, "Leelawadee UI", "Noto Sans Thai", Arial, sans-serif;
    font-size: 0.86rem;
    line-height: 1.65;
    font-weight: 650;
}

.attendance-line-swal .swal2-actions {
    width: calc(100% - 40px);
    margin: 15px 20px 0 !important;
    gap: 8px;
}

.attendance-line-copy-confirm,
.attendance-line-cancel {
    min-height: 44px;
    border-radius: 7px !important;
    padding: 9px 16px !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
}

.attendance-line-copy-confirm {
    background: #06c755 !important;
    box-shadow: none !important;
}

.attendance-line-copy-confirm:hover { background: #05ad4a !important; }
.attendance-line-cancel { background: #e9eef3 !important; color: #425267 !important; }

@media (max-width: 560px) {
    .attendance-line-summary-row {
        margin-top: -3px;
        margin-bottom: 13px;
    }

    .attendance-line-summary-row .attendance-line-summary-trigger {
        width: 100%;
    }

    .attendance-line-summary-trigger {
        min-height: 44px;
        padding: 9px 11px;
        font-size: 0.76rem;
    }

    .attendance-line-swal .swal2-html-container {
        padding: 0 12px !important;
    }

    .attendance-line-popup-head {
        gap: 10px;
        margin-right: -12px;
        margin-bottom: 12px;
        margin-left: -12px;
        padding: 15px 48px 14px 12px;
    }

    .attendance-line-popup-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 1.55rem;
    }

    .attendance-line-popup-head h3 { font-size: 1.05rem; }
    .attendance-line-popup-head p { font-size: 0.78rem; }

    .attendance-line-date {
        flex-wrap: wrap;
        padding: 8px 9px;
        font-size: 0.8rem;
    }

    .attendance-line-date > span {
        width: 100%;
        margin-left: 22px;
    }

    .attendance-line-stats {
        gap: 6px;
    }

    .attendance-line-stats > div {
        grid-template-columns: 1fr auto;
        gap: 2px 4px;
        padding: 9px 7px;
    }

    .attendance-line-stats strong { font-size: 1.42rem; }
    .attendance-line-stats small { display: none; }

    .attendance-line-secondary span {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        padding-right: 5px;
        padding-left: 5px;
        font-size: 0.74rem;
    }

    .attendance-line-absent-list h4,
    .attendance-line-message-preview h4 {
        font-size: 0.86rem;
    }

    .attendance-line-absent-list li { font-size: 0.84rem; }
    .attendance-line-message-preview pre { font-size: 0.8rem; }

    .attendance-line-swal .swal2-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        width: calc(100% - 24px);
        margin: 12px 12px 0 !important;
    }

    .attendance-line-copy-confirm,
    .attendance-line-cancel {
        width: 100%;
        margin: 0 !important;
    }
}

@media print {
    .attendance-line-summary-row,
    .attendance-line-summary-trigger {
        display: none !important;
    }
}

.attendance-workspace-controls {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 17px 20px;
    border-bottom: 1px solid #dbe7f0;
    background: #f8fafc;
}

.attendance-workspace-controls-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.attendance-workspace-controls-heading > span {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    background: var(--attendance-accent-soft);
    color: var(--attendance-accent-dark);
    font-size: 0.95rem;
}

.attendance-workspace-controls-heading h3 {
    margin: 0;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.2;
}

.attendance-workspace-controls-heading p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.25;
}

.attendance-workspace-fields {
    display: grid;
    gap: 10px;
}

.attendance-workspace-fields-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attendance-workspace-fields-manual {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    align-items: start;
}

.attendance-workspace-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.attendance-workspace-field label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 0.73rem;
    font-weight: 900;
}

.attendance-workspace-field label i {
    color: var(--attendance-accent-dark);
}

.attendance-workspace-field select,
.attendance-workspace-field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px !important;
    padding: 8px 12px !important;
    background: #fff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
    outline: none;
}

.attendance-workspace-field select:focus,
.attendance-workspace-field input:focus {
    border-color: var(--attendance-accent) !important;
    box-shadow: 0 0 0 3px var(--attendance-accent-ring);
}

.attendance-workspace-controls .subject-room-picker {
    min-width: 0;
}

.attendance-workspace-controls .subject-room-picker > div:not(.attendance-timetable-preset) {
    border-radius: 7px !important;
    background: #fff !important;
}

#scan-wrapper.attendance-workspace-shell .scan-live-layout,
#assembly-wrapper.attendance-workspace-shell .scan-live-layout {
    width: auto;
    margin: 20px 20px 0;
}

.attendance-workspace-shell .attendance-camera-stage {
    border-width: 1px !important;
    border-color: #a5f3fc !important;
    border-radius: 8px !important;
    background: #ecfeff;
    box-shadow: 0 7px 20px rgba(8, 145, 178, 0.1);
}

.attendance-workspace-shell .scan-side-panel {
    gap: 12px;
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: none;
}

.attendance-workspace-shell .scan-side-hero,
.attendance-workspace-shell .scan-side-count,
.attendance-workspace-shell .scan-side-room,
.attendance-workspace-shell .scan-side-checked-list-wrap,
.attendance-workspace-shell .scan-side-checked-item {
    border-radius: 7px;
}

.attendance-camera-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    border-left: 4px solid #06b6d4;
    padding: clamp(16px, 2.4vw, 28px);
    background: #ecfeff !important;
    color: #164e63;
    text-align: left;
}

.attendance-camera-overlay.hidden {
    display: none !important;
}

.attendance-camera-stage:has(.attendance-camera-overlay:not(.hidden)) {
    height: clamp(190px, 30vw, 320px) !important;
    min-height: clamp(190px, 30vw, 320px) !important;
    aspect-ratio: auto !important;
}

.attendance-camera-launch-head {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.attendance-camera-prompt-icon {
    display: grid;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #0e7490;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 7px 16px rgba(8, 145, 178, 0.2);
}

.attendance-camera-launch-head h3 {
    margin: 0;
    color: #164e63;
    font-size: 1.14rem;
    font-weight: 900;
    line-height: 1.2;
}

.attendance-camera-launch-head p {
    margin: 5px 0 0;
    color: #527181;
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1.3;
}

.attendance-camera-mode-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.attendance-camera-mode-button {
    display: grid;
    min-width: 0;
    min-height: 86px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.055);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.attendance-camera-mode-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 17px rgba(15, 23, 42, 0.1);
}

.attendance-camera-mode-button > i {
    width: 48px;
    color: inherit;
    font-size: 1.65rem;
    text-align: center;
}

.attendance-camera-mode-button span,
.attendance-camera-mode-button strong,
.attendance-camera-mode-button small {
    display: block;
    min-width: 0;
}

.attendance-camera-mode-button strong {
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.2;
}

.attendance-camera-mode-button small {
    margin-top: 4px;
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.25;
    opacity: 0.76;
}

.attendance-camera-mode-face {
    border-color: #67e8f9;
    background: #fff;
    color: #0e7490;
}

.attendance-camera-mode-qr {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

@media (min-width: 1024px) {
    .scan-live-layout:has(.attendance-camera-overlay:not(.hidden)) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .scan-live-layout:has(.attendance-camera-overlay:not(.hidden)) .scan-side-panel {
        display: none !important;
    }
}

.attendance-workspace-history {
    margin: 20px !important;
    padding-top: 17px;
    border-top: 1px solid #e2e8f0;
}

.attendance-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 900;
}

.attendance-section-title > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 7px;
    background: var(--attendance-accent-soft);
    color: var(--attendance-accent-dark);
}

.attendance-history-log {
    border-radius: 7px !important;
    background: #f8fafc !important;
}

.attendance-workspace-body {
    padding: 20px;
}

.attendance-workspace-body > .attendance-workspace-controls {
    margin-bottom: 16px !important;
    border: 1px solid #dbe7f0;
    border-radius: 8px;
}

.attendance-summary-grid {
    gap: 8px !important;
}

.attendance-summary-grid > div {
    min-height: 62px;
    border-color: #dbe7f0 !important;
    border-radius: 7px !important;
    background: #fff !important;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.045);
}

.attendance-summary-grid > div:nth-child(1) { border-top: 3px solid #10b981 !important; }
.attendance-summary-grid > div:nth-child(2) { border-top: 3px solid #f59e0b !important; }
.attendance-summary-grid > div:nth-child(3) { border-top: 3px solid #38bdf8 !important; }
.attendance-summary-grid > div:nth-child(4) { border-top: 3px solid #ef4444 !important; }

.attendance-list-heading {
    top: 0;
    min-height: 50px;
    padding: 8px 0 !important;
    border-bottom-color: #dbe7f0 !important;
}

.attendance-checked-section {
    padding-top: 17px;
    border-top: 1px solid #e2e8f0;
}

.scan-fullscreen-active.attendance-workspace-shell {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    box-shadow: none !important;
}

.scan-fullscreen-active.attendance-workspace-shell .scan-live-layout {
    width: 100% !important;
    margin: 0 !important;
}

.scan-fullscreen-active.attendance-workspace-shell .attendance-camera-stage {
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    box-shadow: none !important;
}

@media (max-width: 767px) {
    .attendance-workspace-shell {
        border-right: 0;
        border-left: 0;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .attendance-workspace-header {
        align-items: flex-start;
        padding: 14px 12px;
        border-top-width: 3px;
    }

    .attendance-workspace-title-wrap {
        gap: 10px;
    }

    .attendance-workspace-title-icon {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    .attendance-workspace-eyebrow {
        font-size: 0.56rem;
    }

    .attendance-workspace-title-wrap h2 {
        font-size: 1rem;
    }

    .attendance-workspace-title-wrap > div > p:last-child {
        font-size: 0.63rem;
        line-height: 1.3;
    }

    .attendance-workspace-badge {
        display: none;
    }

    .attendance-workspace-controls {
        padding: 12px;
    }

    .attendance-workspace-controls-heading {
        margin-bottom: 9px;
    }

    .attendance-workspace-controls-heading > span {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .attendance-workspace-controls-heading h3 {
        font-size: 0.78rem;
    }

    .attendance-workspace-controls-heading p {
        font-size: 0.59rem;
    }

    .attendance-workspace-fields-two,
    .attendance-workspace-fields-manual {
        grid-template-columns: 1fr;
    }

    .attendance-workspace-field select,
    .attendance-workspace-field input {
        min-height: 42px;
        font-size: 0.75rem;
    }

    #scan-wrapper.attendance-workspace-shell .scan-live-layout,
    #assembly-wrapper.attendance-workspace-shell .scan-live-layout {
        width: auto;
        margin: 12px 12px 0;
    }

    .attendance-camera-overlay {
        gap: 12px;
        padding: 12px;
    }

    .attendance-camera-launch-head {
        gap: 9px;
    }

    .attendance-camera-prompt-icon {
        width: 46px;
        height: 46px;
        font-size: 1.05rem;
    }

    .attendance-camera-launch-head h3 {
        font-size: 0.88rem;
    }

    .attendance-camera-launch-head p {
        margin-top: 3px;
        font-size: 0.58rem;
    }

    .attendance-camera-mode-grid {
        gap: 7px;
    }

    .attendance-camera-mode-button {
        min-height: 64px;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 6px;
        padding: 7px 8px;
    }

    .attendance-camera-mode-button > i {
        width: 34px;
        font-size: 1.02rem;
    }

    .attendance-camera-mode-button strong {
        font-size: 0.66rem;
    }

    .attendance-camera-mode-button small {
        font-size: 0.52rem;
    }

    .attendance-workspace-history {
        margin: 12px !important;
        padding-top: 12px;
    }

    .attendance-section-title {
        font-size: 0.76rem;
    }

    .attendance-section-title > span {
        width: 28px;
        height: 28px;
    }

    .attendance-workspace-body {
        padding: 12px;
    }

    .attendance-summary-grid > div {
        min-height: 55px;
    }

    .attendance-workspace-controls .subject-room-picker .rounded-2xl,
    .attendance-workspace-controls .subject-room-picker .rounded-xl {
        border-radius: 7px !important;
    }
}

/* Timetable-assisted subject attendance selection */
.attendance-timetable-preset {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    padding: 10px 12px;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #14532d;
    background: #f0fdf4;
}

.attendance-timetable-preset.is-upcoming {
    border-color: #fcd34d;
    color: #78350f;
    background: #fffbeb;
}

.attendance-timetable-preset-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #16a34a;
    font-size: 16px;
}

.attendance-timetable-preset.is-upcoming .attendance-timetable-preset-icon {
    background: #f59e0b;
}

.attendance-timetable-preset-main {
    min-width: 0;
}

.attendance-timetable-preset-main strong,
.attendance-timetable-preset-main span {
    display: block;
}

.attendance-timetable-preset-main strong {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

.attendance-timetable-preset-main span {
    margin-top: 2px;
    overflow: hidden;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-timetable-preset > b {
    padding: 5px 8px;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.attendance-timetable-preset.is-upcoming > b {
    color: #92400e;
    background: #fef3c7;
}

@media (max-width: 420px) {
    .attendance-timetable-preset {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px;
        padding: 9px 10px;
    }

    .attendance-timetable-preset-icon {
        width: 34px;
        height: 34px;
    }

    .attendance-timetable-preset > b {
        grid-column: 2;
        width: max-content;
        margin-top: 1px;
    }

    .attendance-timetable-preset-main span {
        white-space: normal;
    }
}

/* Subject schedule and automatic class reminders */
body.subject-schedule-modal-open {
    overflow: hidden;
}

.subject-card-schedule {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #78350f;
    background: rgba(255, 251, 235, 0.92);
}

.subject-card-schedule > i {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: #f59e0b;
}

.subject-card-schedule > div {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 5px;
}

.subject-card-schedule > div span {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
}

.subject-card-schedule > div b {
    color: #b45309;
}

.subject-card-schedule > em {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #92400e;
    background: #fde68a;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.subject-card-schedule > small {
    color: #a16207;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.subject-card-schedule.is-empty {
    grid-template-columns: 28px minmax(0, 1fr);
    border-color: #cbd5e1;
    color: #64748b;
    background: rgba(248, 250, 252, 0.9);
}

.subject-card-schedule.is-empty > i {
    color: #64748b;
    background: #e2e8f0;
}

.subject-schedule-dialog {
    height: min(92dvh, 860px);
    max-height: min(92dvh, 860px);
    border-radius: 20px;
}

.subject-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.subject-schedule-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

.subject-schedule-heading-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 12px;
    border: 1px solid #fdba74;
    color: #fff;
    background: #ea580c;
    box-shadow: 0 7px 16px rgba(234, 88, 12, 0.2);
    font-size: 20px;
}

.subject-schedule-eyebrow {
    margin: 0 0 2px;
    color: #ea580c;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.subject-schedule-heading h3 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.15;
}

.subject-schedule-subject-label {
    overflow: hidden;
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-schedule-close {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #475569;
    background: #f8fafc;
    font-size: 18px;
    transition: 160ms ease;
}

.subject-schedule-close:hover {
    border-color: #fecaca;
    color: #dc2626;
    background: #fef2f2;
}

.subject-schedule-body {
    position: relative;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    padding: 18px 22px 24px;
    overflow-y: auto;
    background: #f8fafc;
}

.subject-schedule-modal.is-loading .subject-schedule-body {
    opacity: 0.58;
    pointer-events: none;
}

.subject-schedule-intro {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
}

.subject-schedule-intro-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    color: #0369a1;
    background: #bae6fd;
    font-size: 17px;
}

.subject-schedule-intro strong {
    display: block;
    color: #0c4a6e;
    font-size: 14px;
    font-weight: 900;
}

.subject-schedule-intro p {
    margin: 2px 0 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}

.subject-schedule-count {
    padding: 6px 10px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.subject-schedule-intro-status {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
}

.subject-schedule-cron-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    background: #fff;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.subject-schedule-cron-status.is-healthy {
    border-color: #86efac;
    color: #166534;
    background: #dcfce7;
}

.subject-schedule-cron-status.is-stale {
    border-color: #fcd34d;
    color: #92400e;
    background: #fef3c7;
}

.subject-schedule-cron-setup-button {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid #93c5fd;
    border-radius: 7px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 10px;
    font-weight: 900;
    transition: 160ms ease;
}

.subject-schedule-cron-setup-button:hover {
    border-color: #2563eb;
    color: #fff;
    background: #2563eb;
}

.subject-schedule-cron-setup-button.hidden {
    display: none;
}

.subject-schedule-cron-config {
    color: #334155;
    text-align: left;
}

.subject-schedule-cron-config-note {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 15px;
    padding: 12px 13px;
    border-left: 4px solid #22c55e;
    background: #f0fdf4;
}

.subject-schedule-cron-config-note > i {
    color: #16a34a;
    font-size: 22px;
}

.subject-schedule-cron-config-note strong,
.subject-schedule-cron-config-note span {
    display: block;
}

.subject-schedule-cron-config-note strong {
    color: #166534;
    font-size: 14px;
}

.subject-schedule-cron-config-note span {
    margin-top: 2px;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
}

.subject-schedule-cron-config > label {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}

.subject-schedule-cron-config textarea {
    width: 100%;
    min-height: 104px;
    box-sizing: border-box;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    color: #0f172a;
    background: #f8fafc;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.55;
    direction: ltr;
}

.subject-schedule-cron-config textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.subject-schedule-cron-config details {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.subject-schedule-cron-config summary {
    cursor: pointer;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.subject-schedule-cron-config details textarea {
    min-height: 104px;
    margin-top: 9px;
}

.subject-schedule-cron-config > p {
    margin: 11px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.subject-schedule-cron-config > p i {
    margin-right: 4px;
    color: #2563eb;
}

.subject-schedule-readonly-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 4px solid #8b5cf6;
    color: #5b21b6;
    background: #f5f3ff;
    font-size: 12px;
    font-weight: 700;
}

.subject-schedule-readonly-note.hidden {
    display: none;
}

.subject-schedule-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 20px 0 10px;
}

.subject-schedule-toolbar h4 {
    margin: 0;
    color: #1e293b;
    font-size: 15px;
    font-weight: 900;
}

.subject-schedule-toolbar h4 i {
    margin-right: 6px;
    color: #2563eb;
}

.subject-schedule-toolbar p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 11px;
}

.subject-schedule-add-button,
.subject-schedule-test-button,
.subject-schedule-save-button,
.subject-schedule-cancel-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    transition: 160ms ease;
}

.subject-schedule-add-button {
    border: 1px solid #86efac;
    color: #166534;
    background: #dcfce7;
}

.subject-schedule-add-button:hover {
    color: #fff;
    background: #16a34a;
}

.subject-schedule-add-button.hidden,
.subject-schedule-save-button.hidden {
    display: none;
}

.subject-schedule-list {
    display: grid;
    gap: 10px;
}

.subject-schedule-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 112px;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.05);
    transition: 160ms ease;
}

.subject-schedule-row:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.subject-schedule-row.is-disabled {
    border-style: dashed;
    background: #f8fafc;
}

.subject-schedule-row-index {
    display: flex;
    min-height: 66px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #9a3412;
    background: #ffedd5;
}

.subject-schedule-row-index span {
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
}

.subject-schedule-row-index small {
    margin-top: 4px;
    font-size: 9px;
    font-weight: 800;
}

.subject-schedule-fields {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.25fr) minmax(100px, .72fr) minmax(100px, .72fr) minmax(125px, .82fr);
    gap: 9px;
}

.subject-schedule-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.subject-schedule-field > span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
}

.subject-schedule-field > span i {
    width: 13px;
    color: #3b82f6;
    text-align: center;
}

.subject-schedule-field select,
.subject-schedule-field input {
    width: 100%;
    min-width: 0;
    height: 39px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    outline: none;
    color: #0f172a;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.subject-schedule-field select:focus,
.subject-schedule-field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.subject-schedule-field select:disabled,
.subject-schedule-field input:disabled {
    color: #475569;
    background: #f1f5f9;
}

.subject-schedule-minute-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.subject-schedule-minute-input b {
    color: #475569;
    font-size: 11px;
}

.subject-schedule-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: end;
    gap: 7px;
}

.subject-schedule-enabled {
    display: flex;
    min-width: 0;
    height: 39px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid #86efac;
    border-radius: 7px;
    color: #166534;
    background: #f0fdf4;
    cursor: pointer;
}

.subject-schedule-enabled input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.subject-schedule-enabled span {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #22c55e;
    font-size: 10px;
}

.subject-schedule-enabled b {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-schedule-row.is-disabled .subject-schedule-enabled {
    border-color: #cbd5e1;
    color: #64748b;
    background: #f1f5f9;
}

.subject-schedule-row.is-disabled .subject-schedule-enabled span {
    background: #94a3b8;
}

.subject-schedule-delete {
    display: grid;
    width: 38px;
    height: 39px;
    place-items: center;
    border: 1px solid #fecaca;
    border-radius: 7px;
    color: #dc2626;
    background: #fff1f2;
}

.subject-schedule-delete:hover {
    color: #fff;
    background: #dc2626;
}

.subject-schedule-empty {
    display: grid;
    min-height: 190px;
    place-items: center;
    align-content: center;
    padding: 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    text-align: center;
}

.subject-schedule-empty.hidden {
    display: none;
}

.subject-schedule-empty > span {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
    place-items: center;
    border-radius: 50%;
    color: #2563eb;
    background: #dbeafe;
    font-size: 20px;
}

.subject-schedule-empty strong {
    color: #334155;
    font-size: 15px;
    font-weight: 900;
}

.subject-schedule-empty p {
    margin: 4px 0 0;
    font-size: 12px;
}

.subject-schedule-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.subject-schedule-footer-note {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.subject-schedule-footer-note i {
    color: #0284c7;
}

.subject-schedule-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.subject-schedule-test-button {
    border: 1px solid #c4b5fd;
    color: #6d28d9;
    background: #f5f3ff;
}

.subject-schedule-test-button:hover {
    color: #fff;
    background: #7c3aed;
}

.subject-schedule-cancel-button {
    border: 1px solid #cbd5e1;
    color: #475569;
    background: #f8fafc;
}

.subject-schedule-save-button {
    border: 1px solid #2563eb;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 6px 13px rgba(37, 99, 235, 0.2);
}

.subject-schedule-save-button:hover {
    background: #1d4ed8;
}

.subject-schedule-footer button:disabled,
.subject-schedule-toolbar button:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 900px) {
    .subject-schedule-fields {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .subject-schedule-field-day,
    .subject-schedule-field-room {
        grid-column: span 2;
    }

    .subject-schedule-field-reminder {
        grid-column: span 2;
    }

    .subject-schedule-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .subject-schedule-row-actions {
        grid-column: 2;
        grid-template-columns: minmax(0, 1fr) 42px;
    }
}

@media (max-width: 640px) {
    .subject-schedule-modal {
        align-items: flex-end;
        padding: 0;
    }

    .subject-schedule-dialog {
        width: 100%;
        height: 96dvh;
        max-height: 96dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 18px 18px 0 0;
    }

    .subject-schedule-header {
        gap: 10px;
        padding: 13px 14px;
    }

    .subject-schedule-heading {
        gap: 10px;
    }

    .subject-schedule-heading-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 10px;
        font-size: 17px;
    }

    .subject-schedule-heading h3 {
        font-size: 18px;
    }

    .subject-schedule-subject-label {
        max-width: calc(100vw - 130px);
        font-size: 11px;
    }

    .subject-schedule-close {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .subject-schedule-body {
        padding: 12px 12px 18px;
    }

    .subject-schedule-intro {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
        padding: 11px;
    }

    .subject-schedule-intro-icon {
        width: 38px;
        height: 38px;
    }

    .subject-schedule-intro p {
        font-size: 11px;
    }

    .subject-schedule-intro-status {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .subject-schedule-count {
        width: max-content;
        padding: 4px 8px;
    }

    .subject-schedule-toolbar {
        align-items: center;
        margin-top: 15px;
    }

    .subject-schedule-toolbar p {
        display: none;
    }

    .subject-schedule-add-button {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .subject-schedule-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 9px;
        padding: 9px;
    }

    .subject-schedule-row-index {
        min-height: 54px;
    }

    .subject-schedule-row-index span {
        font-size: 18px;
    }

    .subject-schedule-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .subject-schedule-field-day,
    .subject-schedule-field-room,
    .subject-schedule-field-reminder {
        grid-column: span 2;
    }

    .subject-schedule-field select,
    .subject-schedule-field input {
        height: 42px;
        font-size: 13px;
    }

    .subject-schedule-row-actions {
        grid-column: 2;
    }

    .subject-schedule-footer {
        align-items: stretch;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .subject-schedule-footer-note {
        display: none;
    }

    .subject-schedule-footer-actions {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr 0.65fr 1.2fr;
    }

    .subject-schedule-footer-actions button {
        min-width: 0;
        min-height: 44px;
        padding: 8px;
        font-size: 11px;
    }

    .subject-card-schedule {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }

    .subject-card-schedule > small {
        display: none;
    }
}

body { font-family: 'Prompt', sans-serif; }
.view-section { display: none; }
.view-section.active { display: block; }
/* Confine dashboard layers so cards and menu animations stay below the topbar. */
#view-dashboard { isolation: isolate; }

.student-welcome-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Chrome Android GPU setup guide */
.scan-chrome-guide {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #a5f3fc;
}

.scan-chrome-guide-header {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.scan-chrome-guide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #2563eb;
    background: #ffffff;
    font-size: 25px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.scan-chrome-guide-header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.scan-chrome-guide-header p {
    margin: 3px 0 0;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.scan-chrome-guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #9a3412;
    background: #fff7ed;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.scan-chrome-guide-steps {
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.scan-chrome-guide-step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px;
}

.scan-chrome-guide-step + .scan-chrome-guide-step {
    border-top: 1px solid #e2e8f0;
}

.scan-chrome-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 900;
}

.scan-chrome-guide-step-green .scan-chrome-step-number {
    color: #047857;
    background: #d1fae5;
}

.scan-chrome-guide-step-violet .scan-chrome-step-number {
    color: #6d28d9;
    background: #ede9fe;
}

.scan-chrome-step-content {
    min-width: 0;
}

.scan-chrome-step-content strong,
.scan-chrome-step-content span,
.scan-chrome-step-content code {
    display: block;
}

.scan-chrome-step-content strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.scan-chrome-step-content span {
    margin-top: 2px;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.scan-chrome-step-content code {
    margin-top: 6px;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.scan-chrome-step-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scan-chrome-open-button,
.scan-chrome-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 800;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.scan-chrome-open-button {
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #2563eb;
    color: #ffffff;
    background: #2563eb;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.scan-chrome-copy-button {
    width: 44px;
    min-width: 44px;
    border: 1px solid #cbd5e1;
    color: #475569;
    background: #ffffff;
    font-size: 15px;
}

.scan-chrome-open-button:hover {
    color: #ffffff;
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

.scan-chrome-copy-button:hover {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #93c5fd;
}

.scan-chrome-open-button:focus-visible,
.scan-chrome-copy-button:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.3);
    outline-offset: 2px;
}

.scan-chrome-guide-footer {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    padding: 11px 12px;
    border-left: 3px solid #f59e0b;
    color: #78350f;
    background: #fffbeb;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
}

.scan-chrome-guide-footer i {
    margin-top: 3px;
    color: #d97706;
}

.chrome-flag-guide-popup {
    width: min(92vw, 520px) !important;
    border-radius: 8px !important;
}

.chrome-flag-modal-guide {
    margin-top: 4px;
    text-align: left;
}

.chrome-flag-modal-target {
    margin-bottom: 14px;
    padding: 13px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
}

.chrome-flag-modal-target strong,
.chrome-flag-modal-target span,
.chrome-flag-modal-target code {
    display: block;
}

.chrome-flag-modal-target strong {
    color: #172554;
    font-size: 15px;
}

.chrome-flag-modal-target span {
    margin-top: 3px;
    color: #334155;
    font-size: 13px;
}

.chrome-flag-modal-target code {
    margin-top: 9px;
    padding: 8px 9px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    color: #1d4ed8;
    background: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    user-select: all;
}

.chrome-flag-modal-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border-top: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
}

.chrome-flag-modal-step > b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ffffff;
    background: #2563eb;
    font-size: 13px;
}

.chrome-flag-modal-guide > p {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 12px 0 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.chrome-flag-modal-guide > p i {
    margin-top: 2px;
    color: #64748b;
}

.chrome-flag-guide-confirm {
    min-width: 130px;
    min-height: 46px;
    border-radius: 8px !important;
    font-weight: 800 !important;
}

@media (max-width: 640px) {
    .scan-chrome-guide-header {
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: start;
    }

    .scan-chrome-guide-icon {
        width: 42px;
        height: 42px;
        font-size: 23px;
    }

    .scan-chrome-guide-badge {
        grid-column: 2;
        justify-self: start;
    }

    .scan-chrome-guide-step {
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 14px 12px;
    }

    .scan-chrome-step-actions {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 2px;
    }

    .scan-chrome-open-button {
        flex: 1;
    }
}

.student-welcome-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.student-welcome-photo-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.student-welcome-photo {
    width: 100%;
    height: clamp(176px, 24vw, 240px);
    aspect-ratio: 3 / 4;
    display: block;
    object-fit: cover;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 4px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    cursor: zoom-in;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.student-welcome-photo:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.2);
}

.student-welcome-camera-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
    font-size: 13px;
    line-height: 1;
    transition: transform 160ms ease, color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.student-welcome-camera-btn:hover {
    transform: translateY(-1px) scale(1.04);
    background: #eff6ff;
}

.student-welcome-camera-btn.is-used,
.student-welcome-camera-btn:disabled {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.72);
    cursor: not-allowed;
    opacity: 0.9;
    transform: none;
}

.student-photo-source-popup {
    width: min(92vw, 520px) !important;
    padding: 1.4rem !important;
    border-radius: 24px !important;
}

.student-photo-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.student-photo-source-btn {
    min-width: 0;
    min-height: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 18px 10px;
    border: 1px solid;
    border-radius: 16px;
    text-align: center;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.student-photo-source-btn:hover,
.student-photo-source-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    outline: none;
}

.student-photo-source-btn.is-camera {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.student-photo-source-btn.is-gallery {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.student-photo-source-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 9px 18px rgba(15, 23, 42, 0.14);
}

.is-camera .student-photo-source-icon {
    background: #10b981;
}

.is-gallery .student-photo-source-icon {
    background: #3b82f6;
}

.student-photo-source-btn strong {
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
}

.student-photo-source-btn small {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.student-photo-crop-popup {
    width: min(94vw, 520px) !important;
    padding: 1.15rem 1.2rem 1.25rem !important;
    border-radius: 24px !important;
}

.student-photo-crop-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.student-photo-crop-heading {
    width: min(74vw, calc(52vh * 0.75), 300px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.student-photo-crop-heading span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.student-photo-crop-heading i {
    color: #2563eb;
}

.student-photo-crop-heading b {
    padding: 3px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
}

.student-photo-crop-frame {
    position: relative;
    width: min(74vw, calc(52vh * 0.75), 300px);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 4px solid #ffffff;
    border-radius: 18px;
    background: #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22), 0 0 0 2px #bfdbfe;
}

.student-photo-crop-frame canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

.student-photo-crop-frame canvas.is-dragging {
    cursor: grabbing;
}

.student-photo-crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, 0.55) 33.3%, rgba(255, 255, 255, 0.55) 33.7%, transparent 33.9%, transparent 66.1%, rgba(255, 255, 255, 0.55) 66.3%, rgba(255, 255, 255, 0.55) 66.7%, transparent 66.9%),
        linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, 0.55) 33.3%, rgba(255, 255, 255, 0.55) 33.7%, transparent 33.9%, transparent 66.1%, rgba(255, 255, 255, 0.55) 66.3%, rgba(255, 255, 255, 0.55) 66.7%, transparent 66.9%);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.student-photo-crop-controls {
    width: min(86vw, 390px);
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 9px;
}

.student-photo-crop-controls > button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
    color: #334155;
    font-size: 16px;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
}

.student-photo-crop-controls > button:hover,
.student-photo-crop-controls > button:focus-visible {
    color: #2563eb;
    border-color: #93c5fd;
    outline: none;
}

.student-photo-zoom-control {
    min-width: 0;
    height: 44px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
}

.student-photo-zoom-control input {
    width: 100%;
    accent-color: #2563eb;
}

.student-photo-crop-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 10px;
    margin: 14px 0 0 !important;
}

.student-photo-crop-confirm,
.student-photo-crop-cancel {
    width: 100%;
    min-height: 44px;
    margin: 0 !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.student-photo-confirm-preview img {
    width: min(52vw, 190px);
    aspect-ratio: 3 / 4;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    border: 4px solid #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
}

.student-welcome-qr-card {
    width: 100%;
    min-width: 0;
    height: clamp(176px, 24vw, 240px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) 32px;
    align-items: center;
    justify-items: center;
    gap: 5px;
    padding: 6px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 4px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
    color: #0f172a;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.student-welcome-qr-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.student-welcome-qr {
    width: 100%;
    max-width: min(218px, 98%);
    max-height: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
}

.student-welcome-qr-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 20px;
    padding: 2px 6px;
    align-self: center;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.student-welcome-info {
    width: 100%;
    min-width: 0;
    padding-right: 4px;
}

.student-welcome-meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 14px;
    row-gap: 4px;
    margin-top: 8px;
}

.student-welcome-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.student-welcome-meta i {
    opacity: 0.9;
}

#dash-student-name-display {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .student-welcome-layout {
        gap: 12px;
    }

    .student-welcome-main {
        gap: 8px;
    }

    .student-welcome-photo-wrap {
        width: 100%;
        min-width: 0;
    }

    .student-welcome-photo {
        width: 100%;
        height: clamp(176px, 54vw, 260px);
        border-radius: 24px;
    }

    .student-welcome-camera-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .student-welcome-qr-card {
        width: 100%;
        min-width: 0;
        height: clamp(176px, 54vw, 260px);
        grid-template-rows: minmax(0, 1fr) 32px;
        gap: 5px;
        padding: 6px;
        border-radius: 24px;
    }

    .student-welcome-qr {
        width: 100%;
        max-width: min(218px, 98%);
        height: auto;
        border-radius: 11px;
    }

    .student-welcome-meta {
        column-gap: 12px;
        row-gap: 3px;
        margin-top: 7px;
    }

    .student-welcome-meta span {
        font-size: 13px;
    }

    .student-photo-source-popup {
        padding: 1.15rem !important;
    }

    .student-photo-source-btn {
        min-height: 142px;
        padding: 15px 8px;
    }

    .student-photo-source-icon {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

@media (min-width: 768px) {
    .student-welcome-layout {
        display: grid;
        grid-template-columns: 146px 146px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
    }

    .student-welcome-main {
        display: contents;
    }

    .student-welcome-qr-card {
        width: 146px;
        height: 176px;
        display: grid;
        grid-template-rows: minmax(0, 1fr) 28px;
        gap: 4px;
        padding: 5px;
        border-radius: 20px;
    }

    .student-welcome-photo-wrap {
        width: 146px;
        min-width: 146px;
    }

    .student-welcome-photo {
        width: 146px;
        height: 176px;
    }

    .student-welcome-info {
        grid-column: 3;
        align-self: center;
        padding-right: 54px;
    }

    .student-welcome-info p {
        font-size: 1rem;
        margin-bottom: 0.65rem;
    }

    #dash-student-name-display {
        font-size: clamp(1.85rem, 2.6vw, 2.65rem);
        line-height: 1.18;
    }

    .student-welcome-meta {
        margin-top: 14px;
        column-gap: 22px;
        row-gap: 8px;
    }

    .student-welcome-meta span {
        font-size: 1rem;
    }
}

#app-scroll-main { overscroll-behavior-y: contain; }
.klassin-pull-refresh {
    position: fixed;
    z-index: 40;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #0284c7;
    font-size: 22px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -16px);
    transition: opacity 120ms ease;
}
.klassin-pull-refresh[hidden] { display: none; }
.klassin-pull-refresh.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, var(--pull-y, 0px)); }
.klassin-pull-refresh i { transform: rotate(var(--pull-rotate, 0deg)); }
.klassin-pull-refresh.is-ready { color: #047857; border-color: #6ee7b7; }
.klassin-pull-refresh.is-loading i { animation: klassin-pull-spin 800ms linear infinite; }
.klassin-pull-refresh:focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; }
@keyframes klassin-pull-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .klassin-pull-refresh { transition: none; }
    .klassin-pull-refresh.is-loading i { animation: none; }
}

.student-dashboard-status-grid {
    align-items: stretch;
}

.student-dashboard-status-card {
    min-height: 96px;
}

.student-welcome-today { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.3); }
.student-welcome-today:empty { display: none; }
#student-welcome-card, #student-dashboard-data { min-width: 0; }
/* Keep welcome-card layers below the sticky application header. */
#student-welcome-card, #admin-welcome-card { isolation: isolate; }
.student-welcome-today .student-dashboard-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.student-today-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.student-today-content { flex: 1; min-width: 0; }
.student-today-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.student-today-label { font-size: 12px; font-weight: 600; }
.student-today-line strong { font-size: 15px; line-height: 1.5; }
.student-today-line strong i { font-size: 12px; }
.student-today-meta { display: block; font-size: 11px; line-height: 1.55; opacity: .9; overflow-wrap: anywhere; }
.student-today-meta.student-today-advisor {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 10px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
}
.student-today-advisor i { font-size: 10px; }
.student-today-advisor-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; word-break: normal; }
.student-today-advisor:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
.student-today-advisor:disabled { cursor: default; }
.student-today-item.student-today-assembly,
.student-today-item.student-today-lesson {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
}
.student-today-assembly.assembly-status-present, .student-today-lesson.assembly-status-present { background: #dcfce7; border-color: #86efac; color: #166534; }
.student-today-assembly.assembly-status-late, .student-today-lesson.assembly-status-late { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.student-today-assembly.assembly-status-leave, .student-today-lesson.assembly-status-leave { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.student-today-assembly.assembly-status-absent, .student-today-lesson.assembly-status-absent { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.student-today-assembly.assembly-status-skipped, .student-today-lesson.assembly-status-skipped { background: #f3e8ff; border-color: #d8b4fe; color: #6b21a8; }
.student-today-leave { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; background: rgba(255,255,255,.16); color: inherit; font-size: 12px; }
.student-today-leave:hover { background: rgba(255,255,255,.28); }
.student-today-leave:focus-visible { outline: 2px solid white; outline-offset: 2px; }
#student-welcome-card { padding: 16px; }
#student-welcome-card > .fa-graduation-cap { display: none; }
#student-welcome-card .student-welcome-layout { display: grid; grid-template-columns: 80px minmax(0,1fr) 100px; align-items: center; gap: 14px; }
#student-welcome-card .student-welcome-main { display: contents; }
#student-welcome-card .student-welcome-photo-wrap { grid-column: 1; grid-row: 1; width: 80px; min-width: 0; align-self: start; }
#student-welcome-card .student-welcome-photo { width: 80px; height: 106px; border-radius: 8px; border-width: 2px; box-shadow: none; }
#student-welcome-card .student-welcome-camera-btn { position: absolute; right: -5px; bottom: -5px; margin: 0; width: 30px; height: 30px; font-size: 12px; }
#student-welcome-card .student-welcome-info { grid-column: 2; grid-row: 1; padding: 0; min-width: 0; }
#student-welcome-card .student-welcome-info > p { font-size: 12px; margin-bottom: 6px; line-height: 1.4; }
#student-welcome-card #dash-student-name-display { font-size: 22px; line-height: 1.4; letter-spacing: 0; }
#student-welcome-card .student-welcome-meta { margin-top: 6px; gap: 4px 12px; }
#student-welcome-card .student-welcome-meta span { font-size: 12px; }
#student-welcome-card .student-welcome-qr-card { grid-column: 3; grid-row: 1; width: 100px; height: 106px; padding: 5px; border-width: 2px; border-radius: 8px; grid-template-rows: minmax(0,1fr) 20px; gap: 2px; box-shadow: none; }
#student-welcome-card .student-welcome-qr { width: 74px; height: 74px; max-width: 100%; border-radius: 2px; }
#student-welcome-card .student-welcome-qr-card span { padding: 0; font-size: 11px; line-height: 20px; border-radius: 4px; }
@media (max-width: 767px) {
    #student-welcome-card { padding: 12px; }
    #student-welcome-card .student-welcome-layout { grid-template-columns: 60px minmax(0,1fr) 72px; gap: 10px; }
    #student-welcome-card .student-welcome-photo-wrap, #student-welcome-card .student-welcome-photo { width: 60px; min-width: 0; }
    #student-welcome-card .student-welcome-photo { height: 80px; }
    #student-welcome-card #dash-student-name-display { font-size: 16px; }
    #student-welcome-card .student-welcome-info > p { margin-bottom: 3px; font-size: 11px; }
    #student-welcome-card .student-welcome-qr-card { width: 72px; height: 86px; padding: 4px; grid-template-rows: 58px 16px; }
    #student-welcome-card .student-welcome-qr { width: 58px; height: 58px; }
    #student-welcome-card .student-welcome-qr-card span { font-size: 9px; line-height: 16px; min-height: 16px; }
    #student-welcome-card .student-welcome-qr-card span i { display: none; }
    .student-welcome-today .student-dashboard-status-grid { gap: 8px; }
    .student-today-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    .student-today-content { width: 100%; }
    .student-today-line { flex-direction: column; align-items: flex-start; gap: 2px; overflow-wrap: anywhere; }
    .student-today-leave span { display: none; }
}

#student-dashboard-data #student-quick-stats {
    margin-top: 0;
}

#student-dashboard-data {
    margin-top: 0 !important;
}

.student-quick-menu-panel {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.student-quick-menu-header {
    display: flex;
    align-items: center;
    min-height: 30px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.student-quick-menu-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #172033;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
}

.student-quick-menu-header i {
    color: #f59e0b;
}

.student-quick-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
}

.student-quick-menu-button {
    --student-quick-accent: #2563eb;
    --student-quick-surface: #eff6ff;
    --student-quick-border: #bfdbfe;
    display: flex;
    min-width: 0;
    min-height: 94px;
    padding: 10px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--student-quick-border);
    border-radius: 8px;
    background: var(--student-quick-surface);
    color: #172033;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.student-quick-menu-button.hidden {
    display: none !important;
}

.student-quick-menu-button:hover {
    transform: translateY(-2px);
    border-color: var(--student-quick-accent);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.11);
}

.student-quick-menu-button:active {
    transform: translateY(0) scale(0.98);
}

.student-quick-menu-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--student-quick-accent) 30%, transparent);
    outline-offset: 2px;
}

.student-quick-menu-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #ffffff;
    color: var(--student-quick-accent);
    font-size: 20px;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--student-quick-accent) 17%, transparent);
}

.student-quick-menu-label {
    width: 100%;
    color: #172033;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.student-quick-menu-assembly {
    --student-quick-accent: #dc2626;
    --student-quick-surface: #fff7f7;
    --student-quick-border: #fecaca;
}

.student-quick-menu-exam {
    --student-quick-accent: #4f46e5;
    --student-quick-surface: #f4f4ff;
    --student-quick-border: #c7d2fe;
}

.student-quick-menu-leave {
    --student-quick-accent: #d97706;
    --student-quick-surface: #fffbeb;
    --student-quick-border: #fde68a;
}

.student-quick-menu-profile {
    --student-quick-accent: #059669;
    --student-quick-surface: #ecfdf5;
    --student-quick-border: #a7f3d0;
}

.student-quick-menu-media {
    --student-quick-accent: #0891b2;
    --student-quick-surface: #ecfeff;
    --student-quick-border: #a5f3fc;
}

@media (max-width: 767px) {
    .student-quick-menu-panel {
        padding: 13px;
    }

    .student-quick-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .student-quick-menu-button {
        min-height: 92px;
        padding: 10px 5px;
        gap: 7px;
    }

    .student-quick-menu-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 18px;
    }

    .student-quick-menu-label {
        font-size: 12px;
    }
}

#student-dashboard-data .student-score-card {
    margin-top: 10px;
    margin-bottom: 10px;
}

.student-dashboard-status-card span[title],
.student-dashboard-status-card .truncate {
    min-width: 0;
}

.report-hero {
    position: relative;
    overflow: hidden;
    background: #f0f9ff;
}

.student-score-folders {
    width: 100%;
}

.student-score-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 11px;
}

.student-score-folder {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 122px;
    padding: 18px 12px 11px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    text-align: left;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    isolation: isolate;
}

.student-score-folder > * {
    position: relative;
    z-index: 2;
}

.student-score-folder::before {
    content: "";
    position: absolute;
    inset: 22px 0 0 0;
    border-radius: 18px 18px 14px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 0;
}

.student-score-folder::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48%;
    border-radius: 20px 20px 14px 14px;
    background: rgba(255, 255, 255, 0.34);
    transform: skewY(-2deg);
    transform-origin: left bottom;
    pointer-events: none;
    z-index: 0;
}

.student-score-folder:hover {
    transform: translateY(-4px) rotate(-0.8deg);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.13);
    border-color: rgba(14, 165, 233, 0.35);
}

.student-score-folder:active {
    transform: translateY(-1px) scale(0.99);
}

.student-score-folder-tab {
    position: absolute;
    top: 0;
    left: 12px;
    width: 68px;
    height: 24px;
    border-radius: 13px 13px 7px 7px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 4px 10px rgba(15, 23, 42, 0.06);
    z-index: 1;
}

.student-score-folder-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.42) 46%, transparent 68%);
    transform: translateX(-120%);
    animation: studentFolderShine 5.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

.student-score-folder-top,
.student-score-folder-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.student-score-folder-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #0f766e;
    font-size: 17px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    animation: studentFolderPeek 2.6s ease-in-out infinite;
}

.student-score-folder-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.85);
    font-size: 9.5px;
    font-weight: 900;
    white-space: nowrap;
}

.student-score-folder-badge.excellent,
.student-score-folder-badge.good {
    color: #15803d;
}

.student-score-folder-badge.warn {
    color: #b45309;
}

.student-score-folder-badge.danger {
    color: #be123c;
}

.student-score-folder-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 34px;
    margin-top: 8px;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 1000;
    line-height: 1.45;
    overflow: hidden;
}

.student-score-folder-meta {
    margin-top: 2px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 800;
}

.student-score-folder-progress {
    position: relative;
    height: 6px;
    margin: 8px 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

.student-score-folder-progress span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #22c55e);
    animation: studentScoreGrow 700ms ease both;
}

.student-score-folder-score strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 1000;
    line-height: 1;
}

.student-score-folder-score small {
    color: #475569;
    font-size: 9.5px;
    font-weight: 900;
    text-align: right;
}

.folder-theme-1 { background: linear-gradient(155deg, #bae6fd 0%, #e0f2fe 54%, #f8fafc 100%); }
.folder-theme-2 { background: linear-gradient(155deg, #fde68a 0%, #fef3c7 54%, #fff7ed 100%); }
.folder-theme-3 { background: linear-gradient(155deg, #c4b5fd 0%, #ede9fe 54%, #eff6ff 100%); }
.folder-theme-4 { background: linear-gradient(155deg, #86efac 0%, #dcfce7 54%, #ecfeff 100%); }
.folder-theme-5 { background: linear-gradient(155deg, #fda4af 0%, #ffe4e6 54%, #fff1f2 100%); }
.folder-theme-6 { background: linear-gradient(155deg, #f0abfc 0%, #fce7f3 54%, #eef2ff 100%); }

.student-score-empty {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
    color: #94a3b8;
    font-weight: 900;
    text-align: center;
}

.student-score-empty i {
    font-size: 34px;
}

.student-score-empty.small {
    min-height: auto;
    padding: 18px;
}

.student-score-swal-popup {
    border-radius: 24px !important;
}

.student-score-popup-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 1000;
}

.student-score-popup-title i {
    color: #f59e0b;
}

.student-score-popup {
    text-align: left;
}

.student-score-popup-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    margin-bottom: 12px;
}

.student-score-popup-summary p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.student-score-popup-summary strong {
    display: block;
    color: #0f172a;
    font-size: 28px;
    font-weight: 1000;
    line-height: 1.1;
}

.student-score-popup-summary span {
    flex: 0 0 auto;
    min-width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    border: 8px solid #22c55e;
    color: #0f172a;
    font-size: 20px;
    font-weight: 1000;
}

.student-score-popup-summary.warn span { border-color: #f59e0b; }
.student-score-popup-summary.danger span { border-color: #ef4444; }
.student-score-popup-summary.good span,
.student-score-popup-summary.excellent span { border-color: #22c55e; }

.student-score-popup-list {
    display: grid;
    gap: 9px;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 3px;
}

.student-score-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.student-score-detail-row p {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 1000;
    line-height: 1.35;
}

.student-score-detail-row p i {
    width: 22px;
    color: #6366f1;
}

.student-score-detail-row span {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 900;
}

.student-score-detail-row strong {
    flex: 0 0 auto;
    min-width: 82px;
    text-align: right;
    color: #0f172a;
    font-size: 16px;
    font-weight: 1000;
}

.student-score-detail-row.excellent,
.student-score-detail-row.good {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.student-score-detail-row.warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.student-score-detail-row.danger {
    background: #fff1f2;
    border-color: #fecdd3;
}

.student-score-detail-row.pending {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.student-score-detail-row.pending strong,
.student-score-detail-row.pending p i {
    color: #94a3b8;
}

@keyframes studentFolderFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes studentFolderPeek {
    0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); }
    45% { transform: translateY(-3px) rotate(2deg) scale(1.04); }
    70% { transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes studentFolderShine {
    0%, 72% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@keyframes studentScoreGrow {
    from { transform: scaleX(0); transform-origin: left center; }
    to { transform: scaleX(1); transform-origin: left center; }
}

@media (max-width: 640px) {
    .student-dashboard-status-grid {
        gap: 8px !important;
    }

    .student-dashboard-status-card {
        min-height: 88px;
        padding: 10px !important;
    }

    .student-dashboard-status-card .fa-user-tie {
        font-size: 8px !important;
    }

    .student-score-card {
        margin-top: 12px !important;
        margin-bottom: 12px !important;
        padding: 12px !important;
    }

    .student-score-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .student-score-folder {
        min-height: 118px;
        padding: 17px 10px 10px;
        border-radius: 14px;
    }

    .student-score-folder-icon {
        width: 32px;
        height: 32px;
        border-radius: 11px;
        font-size: 16px;
    }

    .student-score-folder-badge {
        padding: 3px 6px;
        font-size: 9px;
    }

    .student-score-folder-title {
        min-height: 33px;
        font-size: 12px;
    }

    .student-score-folder-score {
        align-items: flex-end;
    }

    .student-score-folder-score strong {
        font-size: 17px;
    }

    .student-score-folder-score small {
        font-size: 9px;
        max-width: 68px;
    }

    .student-score-popup-summary {
        padding: 13px;
    }

    .student-score-popup-summary strong {
        font-size: 22px;
    }

    .student-score-popup-summary span {
        min-width: 62px;
        height: 62px;
        border-width: 7px;
        font-size: 17px;
    }

    .student-score-detail-row {
        padding: 10px;
    }
}

/* Student score folders: compact subject-picker style */
.student-score-card {
    overflow: hidden;
}

.student-score-folder-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.student-score-folder {
    min-height: 138px;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 12px 12px;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #ffffff !important;
    box-shadow: 0 7px 16px rgba(251, 146, 60, 0.08);
    text-align: center;
}

.student-score-folder::before,
.student-score-folder::after,
.student-score-folder-tab {
    display: none;
}

.student-score-folder:hover {
    transform: translateY(-4px);
    border-color: #fb923c;
    box-shadow: 0 14px 28px rgba(251, 146, 60, 0.16);
}

.student-score-folder:active {
    transform: translateY(-1px) scale(0.985);
}

.student-score-folder-visual {
    position: relative;
    width: 64px;
    height: 50px;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 8px;
}

.student-score-folder-icon {
    position: relative;
    width: 48px;
    height: 36px;
    border-radius: 7px 7px 9px 9px;
    background: linear-gradient(180deg, #fdba74, #fb923c);
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 8px 15px rgba(251, 146, 60, 0.2);
    animation: studentFolderCollect 2.2s ease-in-out infinite;
}

.student-score-folder-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    top: -8px;
    width: 24px;
    height: 12px;
    border-radius: 7px 7px 0 0;
    background: #fed7aa;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    z-index: -1;
}

.student-score-folder-icon i {
    position: relative;
    z-index: 2;
}

.student-score-folder-mouth {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 9px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    transform-origin: center;
    animation: studentFolderMouth 2.2s ease-in-out infinite;
}

.student-score-file-line {
    position: absolute;
    left: 23px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    z-index: 4;
}

.student-score-file-line.line-a {
    top: 20px;
}

.student-score-file-line.line-b {
    top: 27px;
    width: 14px;
}

.student-score-digit {
    position: absolute;
    top: -10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #ea580c;
    font-size: 9px;
    font-weight: 1000;
    box-shadow: 0 5px 12px rgba(251, 146, 60, 0.14);
    opacity: 0;
    animation: studentScoreDrop 2.8s ease-in-out infinite;
}

.student-score-digit.digit-a {
    left: 0;
    animation-delay: 0s;
}

.student-score-digit.digit-b {
    right: 0;
    animation-delay: 0.55s;
}

.student-score-digit.digit-c {
    left: 20px;
    animation-delay: 1.1s;
}

.student-score-folder-code {
    display: block;
    max-width: 100%;
    color: #0f172a;
    font-size: 14px;
    font-weight: 1000;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-score-folder-title {
    display: block;
    min-height: 18px;
    max-width: 100%;
    margin-top: 2px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-score-folder-progress {
    width: min(100%, 116px);
    height: 5px;
    margin: 9px auto 6px;
    background: #f1f5f9;
}

.student-score-folder-progress span {
    background: linear-gradient(90deg, #fb923c, #22c55e);
}

.student-score-folder-score {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.student-score-folder-score strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1;
}

.student-score-folder-score small {
    max-width: 100%;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-score-folder-shine {
    background: linear-gradient(115deg, transparent 24%, rgba(251, 146, 60, 0.08) 44%, transparent 64%);
}

@keyframes studentScoreDrop {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(0.82);
    }
    18% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    56% {
        opacity: 1;
        transform: translateY(29px) scale(0.78);
    }
    74%, 100% {
        opacity: 0;
        transform: translateY(34px) scale(0.45);
    }
}

@keyframes studentFolderCollect {
    0%, 100% { transform: translateY(0) scale(1); }
    48% { transform: translateY(1px) scale(1.03); }
    62% { transform: translateY(0) scale(0.98); }
}

@keyframes studentFolderMouth {
    0%, 35%, 100% { transform: scaleX(1); opacity: 0.75; }
    50%, 65% { transform: scaleX(1.25); opacity: 1; }
}

@media (max-width: 640px) {
    .student-score-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .student-score-folder {
        min-height: 130px;
        padding: 14px 8px 10px;
    }

    .student-score-folder-visual {
        width: 58px;
        height: 46px;
    }

    .student-score-folder-icon {
        width: 44px;
        height: 33px;
        font-size: 20px;
    }

    .student-score-folder-code {
        font-size: 12.5px;
    }

    .student-score-folder-title {
        font-size: 9.5px;
    }
}

/* Student subject scores: dashboard launcher and full-page experience */
.student-score-card {
    width: 100%;
    margin: 14px 0 !important;
    padding: 0 !important;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.student-score-card-header {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.student-score-card-header-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 20px;
}

.student-score-card-header h3,
.student-score-card-header p {
    margin: 0;
}

.student-score-card-header h3 {
    color: #0f172a;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.3;
}

.student-score-card-header p {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.student-score-card-count {
    min-width: 68px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    background: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.score-theme-1 { --score-accent: #0284c7; --score-soft: #e0f2fe; --score-rgb: 2, 132, 199; }
.score-theme-2 { --score-accent: #7c3aed; --score-soft: #ede9fe; --score-rgb: 124, 58, 237; }
.score-theme-3 { --score-accent: #059669; --score-soft: #d1fae5; --score-rgb: 5, 150, 105; }
.score-theme-4 { --score-accent: #d97706; --score-soft: #fef3c7; --score-rgb: 217, 119, 6; }
.score-theme-5 { --score-accent: #db2777; --score-soft: #fce7f3; --score-rgb: 219, 39, 119; }
.score-theme-6 { --score-accent: #dc2626; --score-soft: #fee2e2; --score-rgb: 220, 38, 38; }

.student-score-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 12px;
}

.student-score-folder {
    position: relative;
    min-width: 0;
    min-height: 164px;
    display: grid;
    grid-template-rows: auto minmax(43px, auto) auto auto;
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    padding: 16px 17px 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff !important;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
    text-align: left;
    isolation: isolate;
    animation: studentScoreCardEnter 440ms both;
    animation-delay: calc(var(--folder-order, 0) * 55ms);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.student-score-folder::before {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent 35%, rgba(var(--score-rgb), 0.07) 50%, transparent 65%);
    transform: translateX(-110%);
    pointer-events: none;
    z-index: 0;
}

.student-score-folder::after,
.student-score-folder-tab,
.student-score-folder-shine,
.student-score-file-line,
.student-score-digit,
.student-score-folder-mouth {
    display: none;
}

.student-score-folder:hover,
.student-score-folder:focus-visible {
    transform: translateY(-3px);
    border-color: var(--score-accent);
    box-shadow: 0 14px 26px rgba(var(--score-rgb), 0.16);
    outline: none;
}

.student-score-folder:hover::before,
.student-score-folder:focus-visible::before {
    animation: studentScoreCardSweep 650ms ease;
}

.student-score-folder:active {
    transform: translateY(-1px) scale(0.99);
}

.student-score-folder-accent {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
    background: var(--score-accent);
    transition: width 180ms ease;
}

.student-score-folder:hover .student-score-folder-accent,
.student-score-folder:focus-visible .student-score-folder-accent {
    width: 7px;
}

.student-score-folder-topline,
.student-score-folder-footer {
    width: 100%;
    display: flex;
    align-items: center;
}

.student-score-folder-topline {
    justify-content: flex-start;
    gap: 12px;
}

.student-score-folder-visual {
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    margin: 0;
}

.student-score-folder-icon {
    position: relative;
    z-index: 2;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: var(--score-accent);
    background: var(--score-soft);
    box-shadow: none;
    font-size: 19px;
    animation: none;
    transition: transform 180ms ease;
}

.student-score-folder-icon::before {
    display: none;
}

.student-score-folder-sheet {
    position: absolute;
    z-index: 1;
    top: -4px;
    right: -4px;
    width: 27px;
    height: 34px;
    border: 1px solid rgba(var(--score-rgb), 0.28);
    border-radius: 5px;
    background: #ffffff;
    transform: rotate(8deg);
    transition: transform 180ms ease, top 180ms ease;
}

.student-score-folder:hover .student-score-folder-sheet,
.student-score-folder:focus-visible .student-score-folder-sheet {
    top: -9px;
    transform: rotate(13deg);
}

.student-score-folder:hover .student-score-folder-icon,
.student-score-folder:focus-visible .student-score-folder-icon {
    transform: rotate(-3deg) scale(1.04);
}

.student-score-folder-percent {
    color: var(--score-accent);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.student-score-folder-percent small {
    margin-left: 1px;
    font-size: 13px;
    font-weight: 800;
}

.student-score-folder-copy {
    min-width: 0;
    display: block;
}

.student-score-folder-code,
.student-score-folder-title {
    display: block;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.student-score-folder-code {
    color: #475569;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
}

.student-score-folder-title {
    margin-top: 2px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.student-score-folder-progress {
    width: 100%;
    height: 7px;
    margin: 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.student-score-folder-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--score-accent);
    transform-origin: left center;
    animation: studentScoreBarGrow 620ms 120ms both;
}

.student-score-folder-footer {
    min-width: 0;
    justify-content: flex-start;
    gap: 7px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.student-score-folder-footer > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-score-folder-footer strong {
    color: #0f172a;
    font-weight: 900;
}

.student-score-folder-open {
    margin-left: auto;
    color: var(--score-accent);
    font-size: 13px;
    font-weight: 800;
}

.student-score-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.65fr);
    align-items: stretch;
    gap: 12px;
    padding: 16px 0 8px;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.student-score-overview-total,
.student-score-overview-grade {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
}

.student-score-overview-grade {
    padding-left: 12px;
    border-left: 1px solid #cbd5e1;
    text-align: center;
}

.student-score-overview-label {
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.student-score-overview-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 6px;
}

.student-score-overview-value strong,
.student-score-grade-value {
    color: #0f172a;
    font-size: 36px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.student-score-grade-value {
    color: #0369a1;
}

.student-score-overview-value small,
.student-score-overview-caption {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.student-score-detail-summary .student-score-overview {
    margin-top: 20px;
    padding: 20px 0 8px;
    border-top: 1px solid #cbd5e1;
}

.student-score-detail-summary .student-score-overview-value strong,
.student-score-detail-summary .student-score-grade-value {
    font-size: 48px;
}

.student-score-folder-tone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

/* Compact dashboard subjects; the full score detail keeps its larger summary. */
.student-score-folder-grid.student-score-compact-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
.student-score-folder.student-score-folder-compact {
    grid-template-columns: minmax(0, 1fr) 150px 12px;
    grid-template-rows: auto;
    align-items: center;
    min-height: 94px;
    gap: 12px;
    padding: 12px 14px;
    box-shadow: none;
    animation: none;
    transition: border-color 160ms ease, background-color 160ms ease;
}
.student-score-folder-compact::before { display: none; }
.student-score-folder.student-score-folder-compact:hover,
.student-score-folder.student-score-folder-compact:active,
.student-score-folder.student-score-folder-compact:focus-visible {
    transform: none;
    box-shadow: none;
    border-color: #94a3b8;
    background: #f8fafc !important;
}
.student-score-folder.student-score-folder-compact:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}
.student-score-folder-compact .student-score-folder-copy {
    display: grid;
    gap: 3px;
    align-self: center;
    overflow-wrap: anywhere;
}
.student-score-folder-compact .student-score-folder-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
}
.student-score-folder-teacher,
.student-score-folder-metadata {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.student-score-folder-metadata { font-size: 11px; }
.student-score-folder-compact .student-score-overview {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.student-score-folder-compact .student-score-overview-label {
    font-size: 11px;
    line-height: 1.4;
}
.student-score-folder-compact .student-score-overview-grade {
    padding-left: 8px;
    border-color: #e2e8f0;
}
.student-score-folder-compact .student-score-grade-value { white-space: nowrap; }
.student-score-folder-compact .student-score-overview-value { gap: 2px 4px; }
.student-score-folder-compact .student-score-overview-value strong,
.student-score-folder-compact .student-score-grade-value {
    font-size: 26px;
    line-height: 1.25;
}
.student-score-folder-compact .student-score-overview-value small {
    font-size: 11px;
    line-height: 1.4;
}
.student-score-folder-compact .student-score-folder-arrow {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    transform: none;
}
@media (max-width: 600px) {
    .student-score-folder.student-score-folder-compact {
        grid-template-columns: minmax(0, 1fr) 144px 10px;
        gap: 8px;
        padding: 12px;
    }
    .student-score-folder-compact .student-score-overview {
        grid-template-columns: minmax(0, 1fr) 54px;
    }
    .student-score-folder-compact .student-score-overview-value strong,
    .student-score-folder-compact .student-score-grade-value { font-size: 24px; }
}
@media (max-width: 360px) {
    .student-score-folder.student-score-folder-compact {
        grid-template-columns: minmax(0, 1fr) 136px;
    }
    .student-score-folder-compact .student-score-folder-arrow { display: none; }
}

.student-score-folder-tone.excellent,
.student-score-folder-tone.good { color: #047857; background: #ecfdf5; }
.student-score-folder-tone.warn { color: #b45309; background: #fffbeb; }
.student-score-folder-tone.danger { color: #be123c; background: #fff1f2; }

.student-score-folder-arrow {
    flex: 0 0 auto;
    color: var(--score-accent);
    font-size: 11px;
    transition: transform 180ms ease;
}

.student-score-folder:hover .student-score-folder-arrow,
.student-score-folder:focus-visible .student-score-folder-arrow {
    transform: translateX(3px);
}

.student-score-empty {
    min-height: 150px;
    gap: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    background: #f8fafc;
}

.student-score-empty p {
    margin: 0;
}

.student-score-empty-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0284c7;
    background: #e0f2fe;
}

.student-score-empty-icon i {
    font-size: 20px;
}

.student-score-page-shell {
    width: min(100%, 1280px);
    margin: 0 auto;
    color: #0f172a;
    animation: studentScorePageReveal 320ms ease both;
}

.student-score-page-hero {
    position: relative;
    min-height: 132px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-top: 4px solid #0284c7;
    border-radius: 8px 8px 0 0;
    background: #ffffff;
}

.student-score-page-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 5px;
    background: linear-gradient(90deg, #0284c7 0 24%, #10b981 24% 49%, #f59e0b 49% 74%, #ec4899 74% 100%);
    opacity: 0.75;
}

.student-score-page-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.student-score-page-back:hover,
.student-score-page-back:focus-visible {
    color: #0369a1;
    border-color: #7dd3fc;
    background: #f0f9ff;
    outline: none;
}

.student-score-page-heading {
    min-width: 0;
}

.student-score-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0369a1;
    font-size: 11px;
    font-weight: 900;
}

.student-score-page-heading h2,
.student-score-page-heading p {
    margin: 0;
}

.student-score-page-heading h2 {
    margin-top: 3px;
    color: #0f172a;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.2;
}

.student-score-page-heading p {
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.student-score-page-count {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #047857;
    background: #ecfdf5;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.student-score-page-layout {
    display: grid;
    grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
    align-items: stretch;
    min-height: 570px;
    border: 1px solid #dbe3ee;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #ffffff;
}

.student-score-subject-nav {
    min-width: 0;
    padding: 20px 15px;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.student-score-subject-nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 5px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.student-score-subject-nav-heading span,
.student-score-subject-nav-heading small {
    display: block;
}

.student-score-subject-nav-heading span {
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
}

.student-score-subject-nav-heading small {
    margin-top: 1px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}

.student-score-subject-nav-heading > i {
    color: #94a3b8;
    font-size: 17px;
}

.student-score-subject-select-wrap {
    display: none;
}

.student-score-subject-list {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.student-score-subject-button {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 68px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 12px;
    align-items: center;
    gap: 9px;
    padding: 10px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #334155;
    background: transparent !important;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.student-score-subject-button:hover,
.student-score-subject-button:focus-visible {
    border-color: rgba(var(--score-rgb), 0.3);
    background: #ffffff !important;
    outline: none;
}

.student-score-subject-button.active {
    border-color: rgba(var(--score-rgb), 0.42);
    background: var(--score-soft) !important;
    box-shadow: inset 4px 0 0 var(--score-accent);
}

.student-score-subject-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--score-accent);
    background: var(--score-soft);
    font-size: 15px;
}

.student-score-subject-button.active .student-score-subject-icon {
    color: #ffffff;
    background: var(--score-accent);
}

.student-score-subject-copy {
    min-width: 0;
}

.student-score-subject-copy strong,
.student-score-subject-copy small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-score-subject-copy strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}

.student-score-subject-copy small {
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.student-score-subject-percent {
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.student-score-subject-percent.excellent,
.student-score-subject-percent.good { color: #047857; }
.student-score-subject-percent.warn { color: #b45309; }
.student-score-subject-percent.danger { color: #be123c; }

.student-score-subject-arrow {
    color: #94a3b8;
    font-size: 9px;
    transition: transform 160ms ease, color 160ms ease;
}

.student-score-subject-button.active .student-score-subject-arrow {
    color: var(--score-accent);
    transform: translateX(2px);
}

.student-score-page-detail {
    min-width: 0;
    padding: 22px;
    background: #ffffff;
}

.student-score-page-loading,
.student-score-page-state {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

.student-score-page-loading i {
    color: #0284c7;
    font-size: 28px;
}

.student-score-page-state > span {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0284c7;
    background: #e0f2fe;
    font-size: 25px;
}

.student-score-page-state h3,
.student-score-page-state p {
    margin: 0;
}

.student-score-page-state h3 {
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
}

.student-score-page-state p {
    font-size: 13px;
}

.student-score-page-state button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    padding: 9px 13px;
    border-radius: 8px;
    color: #ffffff;
    background: #0284c7;
    font-size: 12px;
    font-weight: 800;
}

.student-score-detail-summary {
    --score-tone: #0284c7;
    padding: 22px;
    border: 1px solid #dbeafe;
    border-top: 4px solid var(--score-tone);
    border-radius: 8px;
    background: #f8fafc;
    animation: studentScoreDetailIn 280ms ease both;
}

.student-score-detail-summary.excellent,
.student-score-detail-summary.good { --score-tone: #059669; }
.student-score-detail-summary.warn { --score-tone: #d97706; }
.student-score-detail-summary.danger { --score-tone: #dc2626; }

.student-score-detail-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.student-score-detail-subject {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-score-detail-subject-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 58px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--score-tone);
    font-size: 23px;
}

.student-score-detail-subject > div {
    min-width: 0;
}

.student-score-detail-code {
    display: inline-block;
    color: var(--score-tone);
    font-size: 12px;
    font-weight: 900;
}

.student-score-detail-subject h3,
.student-score-detail-subject p {
    margin: 0;
}

.student-score-detail-subject h3 {
    margin-top: 2px;
    color: #0f172a;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.student-score-detail-subject p {
    margin-top: 4px;
    color: var(--score-tone);
    font-size: 11px;
    font-weight: 900;
}

.student-score-detail-percent {
    position: relative;
    width: 104px;
    height: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 104px;
    border-radius: 50%;
    background: conic-gradient(var(--score-tone) calc(var(--score-percent, 0) * 1%), #e2e8f0 0);
    isolation: isolate;
}

.student-score-detail-percent::before {
    content: "";
    position: absolute;
    inset: 9px;
    z-index: -1;
    border-radius: 50%;
    background: #ffffff;
}

.student-score-detail-percent strong {
    color: #0f172a;
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}

.student-score-detail-percent strong small {
    font-size: 13px;
}

.student-score-detail-percent > span {
    margin-top: 4px;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
}

.student-score-detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.student-score-detail-metrics > div {
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid #e2e8f0;
}

.student-score-detail-metrics > div:first-child {
    padding-left: 0;
}

.student-score-detail-metrics > div:last-child {
    padding-right: 0;
    border-right: 0;
}

.student-score-detail-metrics span,
.student-score-detail-metrics strong {
    display: block;
}

.student-score-detail-metrics span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.student-score-detail-metrics strong {
    margin-top: 3px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 900;
}

.student-score-detail-metrics strong small {
    margin-left: 2px;
    color: #64748b;
    font-size: 12px;
}

.student-score-detail-progress {
    height: 9px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.student-score-detail-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--score-tone);
    transform-origin: left center;
    animation: studentScoreBarGrow 620ms ease both;
}

.student-score-topic-section {
    margin-top: 22px;
}

.student-score-topic-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.student-score-topic-heading > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-score-topic-heading-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 8px;
    color: #7c3aed;
    background: #ede9fe;
    font-size: 17px;
}

.student-score-topic-heading h3,
.student-score-topic-heading p {
    margin: 0;
}

.student-score-topic-heading h3 {
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
}

.student-score-topic-heading p {
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.student-score-topic-total {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 8px;
    color: #475569;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.student-score-page-list {
    display: grid;
}

.student-score-detail-row {
    position: relative;
    min-width: 0;
    min-height: 82px;
    display: grid;
    grid-template-columns: 28px 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 13px 6px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: transparent;
    animation: studentScoreRowEnter 320ms both;
    animation-delay: calc(var(--topic-order, 0) * 45ms);
    transition: background-color 150ms ease;
}

.student-score-detail-row:hover {
    background: #f8fafc;
}

.student-score-detail-row.excellent,
.student-score-detail-row.good,
.student-score-detail-row.warn,
.student-score-detail-row.danger,
.student-score-detail-row.pending {
    border-color: #e2e8f0;
    background: transparent;
}

.student-score-detail-index {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.student-score-detail-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 16px;
}

.student-score-detail-row.pending .student-score-detail-icon {
    color: #64748b;
    background: #f1f5f9;
}

.student-score-detail-copy {
    min-width: 0;
}

.student-score-detail-copy h4,
.student-score-detail-copy p {
    margin: 0;
}

.student-score-detail-copy h4 {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.student-score-detail-copy p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.student-score-detail-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
}

.student-score-detail-status.excellent,
.student-score-detail-status.good { color: #047857; background: #ecfdf5; }
.student-score-detail-status.warn { color: #b45309; background: #fffbeb; }
.student-score-detail-status.danger { color: #be123c; background: #fff1f2; }
.student-score-detail-status.pending { color: #64748b; background: #f1f5f9; }

.student-score-detail-result {
    min-width: 82px;
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: end;
    column-gap: 4px;
    text-align: right;
}

.student-score-detail-result strong {
    min-width: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.student-score-detail-result > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.student-score-detail-result small {
    grid-column: 1 / -1;
    margin-top: 4px;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
}

.student-score-detail-row.pending .student-score-detail-result strong,
.student-score-detail-row.pending .student-score-detail-result > span {
    color: #94a3b8;
}

.student-score-page-empty-list {
    margin-top: 18px;
}

@keyframes studentScoreCardEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes studentScoreCardSweep {
    from { transform: translateX(-110%); }
    to { transform: translateX(110%); }
}

@keyframes studentScoreBarGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes studentScorePageReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes studentScoreDetailIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes studentScoreRowEnter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
    .student-score-card {
        margin: 12px 0 !important;
        padding: 0 !important;
    }

    .student-score-card-header {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 9px;
        margin-bottom: 10px;
    }

    .student-score-card-header-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .student-score-card-header h3 {
        font-size: 16px;
    }

    .student-score-card-header p {
        font-size: 10px;
    }

    .student-score-card-count {
        min-width: 58px;
        padding: 6px 8px;
        font-size: 9px;
    }

    .student-score-folder-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .student-score-folder {
        min-height: 132px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        column-gap: 11px;
        row-gap: 7px;
        padding: 13px 13px 12px 16px;
    }

    .student-score-folder-topline {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .student-score-folder-percent {
        position: absolute;
        top: 69px;
        left: 0;
        width: 48px;
        font-size: 18px;
        text-align: center;
    }

    .student-score-folder-percent small {
        font-size: 10px;
    }

    .student-score-folder-copy {
        align-self: center;
    }

    .student-score-folder-code {
        font-size: 14px;
    }

    .student-score-folder-title {
        font-size: 18px;
    }

    .student-score-folder-progress {
        grid-column: 1;
        grid-row: 3;
        align-self: end;
    }

    .student-score-folder-footer {
        grid-column: 1;
        grid-row: 4;
    }

    .student-score-folder-tone {
        margin-left: auto;
    }

    .student-score-page-shell {
        width: 100%;
    }

    .student-score-page-hero {
        min-height: 0;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        padding: 16px 14px 18px;
    }

    .student-score-page-back {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
    }

    .student-score-page-back span {
        display: none;
    }

    .student-score-page-heading h2 {
        font-size: 23px;
    }

    .student-score-page-heading p {
        font-size: 11px;
    }

    .student-score-page-count {
        grid-column: 2;
        justify-self: start;
        min-height: 32px;
        padding: 6px 9px;
        font-size: 10px;
    }

    .student-score-page-layout {
        display: block;
        min-height: 0;
    }

    .student-score-subject-nav {
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .student-score-subject-nav-heading,
    .student-score-subject-list {
        display: none;
    }

    .student-score-subject-select-wrap {
        display: grid;
        gap: 6px;
    }

    .student-score-subject-select-wrap > span:first-child {
        color: #475569;
        font-size: 10px;
        font-weight: 900;
    }

    .student-score-subject-select-control {
        min-width: 0;
        min-height: 48px;
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) 18px;
        align-items: center;
        gap: 7px;
        padding: 0 11px;
        border: 1px solid #bae6fd;
        border-radius: 8px;
        color: #0284c7;
        background: #ffffff;
    }

    .student-score-subject-select-control select {
        min-width: 0;
        width: 100%;
        height: 46px;
        border: 0;
        outline: 0;
        color: #0f172a;
        background: transparent;
        font-size: 13px;
        font-weight: 800;
        appearance: none;
    }

    .student-score-subject-select-control > i:last-child {
        font-size: 10px;
        pointer-events: none;
    }

    .student-score-page-detail {
        padding: 14px;
        scroll-margin-top: 78px;
    }

    .student-score-detail-summary {
        padding: 16px 14px;
    }

    .student-score-detail-summary-head {
        align-items: flex-start;
        gap: 10px;
    }

    .student-score-detail-subject {
        align-items: flex-start;
        gap: 10px;
    }

    .student-score-detail-subject-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        font-size: 18px;
    }

    .student-score-detail-subject h3 {
        font-size: 18px;
    }

    .student-score-detail-percent {
        width: 78px;
        height: 78px;
        flex-basis: 78px;
    }

    .student-score-detail-percent::before {
        inset: 7px;
    }

    .student-score-detail-percent strong {
        font-size: 20px;
    }

    .student-score-detail-percent > span {
        font-size: 8px;
    }

    .student-score-detail-metrics {
        margin-top: 15px;
    }

    .student-score-detail-metrics > div {
        padding: 11px 8px;
    }

    .student-score-detail-metrics > div:first-child {
        padding-left: 0;
    }

    .student-score-detail-metrics > div:last-child {
        padding-right: 0;
    }

    .student-score-detail-metrics span {
        font-size: 8px;
    }

    .student-score-detail-metrics strong {
        font-size: 18px;
    }

    .student-score-topic-section {
        margin-top: 18px;
    }

    .student-score-topic-heading {
        align-items: flex-end;
        gap: 8px;
    }

    .student-score-topic-heading-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 15px;
    }

    .student-score-topic-heading h3 {
        font-size: 16px;
    }

    .student-score-topic-total {
        padding: 6px 7px;
        font-size: 9px;
    }

    .student-score-detail-row {
        min-height: 76px;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 12px 2px;
    }

    .student-score-detail-index {
        display: none;
    }

    .student-score-detail-icon {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .student-score-detail-copy h4 {
        font-size: 12px;
    }

    .student-score-detail-result {
        min-width: 64px;
    }

    .student-score-detail-result strong {
        font-size: 17px;
    }

    .student-score-detail-result > span {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-score-folder,
    .student-score-folder::before,
    .student-score-folder-icon,
    .student-score-folder-sheet,
    .student-score-folder-progress span,
    .student-score-page-shell,
    .student-score-detail-summary,
    .student-score-detail-progress span,
    .student-score-detail-row {
        animation: none !important;
        transition: none !important;
    }
}

.report-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: rgba(14, 165, 233, 0.16);
}

.report-watermark {
    position: absolute;
    pointer-events: none;
    color: rgba(2, 132, 199, 0.12);
    z-index: 0;
}

.report-watermark-printer {
    right: 1.25rem;
    top: 0.5rem;
    font-size: 5.5rem;
    line-height: 1;
    animation: reportPrinterWork 2.8s ease-in-out infinite;
}

.report-watermark-paper {
    right: 7.5rem;
    top: 1rem;
    font-size: 1.35rem;
    color: rgba(15, 118, 110, 0.14);
    animation: reportPaperFly 4.8s ease-in-out infinite;
}

.report-paper-two {
    right: 10rem;
    top: 2.8rem;
    animation-delay: 1.3s;
}

.report-paper-three {
    right: 5.4rem;
    top: 3.8rem;
    animation-delay: 2.4s;
}

.report-progress-track {
    position: relative;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.report-progress-fill {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    transform-origin: left center;
    animation: reportBarPulse 2.8s ease-in-out infinite;
}

.report-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 48%, transparent 100%);
    transform: translateX(-130%);
    animation: reportBarSheen 2.6s ease-in-out infinite;
}

.report-progress-assembly {
    background: #38bdf8;
    animation-delay: 0s;
}

.report-progress-learning {
    background: #10b981;
    animation-delay: 0.18s;
}

.report-progress-score {
    background: #8b5cf6;
    animation-delay: 0.36s;
}

.report-assembly-donut-block {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.report-assembly-donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-assembly-donut {
    width: 92px;
    height: 92px;
    border-radius: 999px;
    padding: 10px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(14, 165, 233, 0.12);
    animation: reportDonutFloat 3.2s ease-in-out infinite;
}

.report-assembly-donut-core {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 5px rgba(15, 23, 42, 0.08);
}

.report-assembly-donut-core strong {
    display: block;
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 900;
    margin-top: 0.2rem;
}

.report-assembly-donut-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.report-assembly-donut-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 30px;
    border-width: 1px;
    border-style: solid;
    border-radius: 0.7rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

.report-assembly-donut-chip i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75);
}

.report-assembly-donut-chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.dashboard-overview-donut-grid {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
}

.dashboard-overview-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.dashboard-overview-summary-pane {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard-overview-subjects {
    min-width: 0;
}

.dashboard-overview-donut {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    padding: 8px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05), 0 10px 22px rgba(14, 165, 233, 0.13);
    animation: reportDonutFloat 3.2s ease-in-out infinite;
}

.dashboard-overview-donut-core {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 5px rgba(15, 23, 42, 0.08);
}

.dashboard-overview-donut-core span {
    color: #94a3b8;
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 900;
}

.dashboard-overview-donut-core strong {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 900;
    margin-top: 0.18rem;
}

.dashboard-overview-card {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    #view-dashboard .dashboard-overview-column {
        position: relative;
        min-height: 0;
        height: auto;
    }

    #view-dashboard #dashboard-assembly-overview-card {
        position: absolute;
        inset: 0;
        min-height: 0;
    }

    #view-dashboard .dashboard-overview-card { min-height: 0; }
    #view-dashboard .dashboard-overview-card > :not(.dashboard-overview-subjects) { flex-shrink: 0; }
    #view-dashboard .dashboard-overview-subjects { min-height: 0; overflow: hidden; }
    #view-dashboard .dashboard-overview-subjects > :first-child { flex-shrink: 0; }
    #view-dashboard .dashboard-overview-subject-list { min-height: 0; max-height: none; grid-auto-rows: max-content; }
    #view-dashboard .dashboard-overview-subject-row { min-height: 132px; }
}

.exam-recalc-swal {
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 55%, #eef4ff 100%) !important;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18) !important;
}

.exam-recalc-progress {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding: 0.5rem;
    text-align: left;
}

.exam-recalc-progress-circle {
    --exam-recalc-angle: 0deg;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 50%, #ffffff 0 55%, transparent 56%),
        conic-gradient(#2563eb var(--exam-recalc-angle), #e2e8f0 0deg);
    box-shadow:
        inset 0 0 0 1px rgba(37, 99, 235, 0.08),
        0 18px 36px rgba(37, 99, 235, 0.16);
    transition: background 0.25s ease;
    position: relative;
}

.exam-recalc-progress-circle::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: inherit;
    border: 1px solid rgba(147, 197, 253, 0.5);
    box-shadow: inset 0 0 24px rgba(59, 130, 246, 0.08);
}

.exam-recalc-progress-core {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    align-content: center;
    background: #ffffff;
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 1;
}

.exam-recalc-progress-core strong {
    color: #1d4ed8;
    font-size: 2rem;
    font-weight: 1000;
    line-height: 1;
}

.exam-recalc-progress-core span {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
}

.exam-recalc-progress-info h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 1000;
}

.exam-recalc-progress-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.4rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 1000;
}

.exam-recalc-progress-title {
    margin: 0.25rem 0 0.9rem;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.35;
}

.exam-recalc-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.exam-recalc-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #2563eb, #7c3aed);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.28);
    transition: width 0.25s ease;
}

.exam-recalc-progress-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.65rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 900;
}

.exam-recalc-progress-student {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.8rem;
    max-width: 100%;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 900;
}

.exam-recalc-progress-student span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .exam-recalc-progress {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .exam-recalc-progress-meta {
        justify-content: center;
    }
}

.manual-assembly-month-empty {
    border: 1px dashed #a7f3d0;
    border-radius: 16px;
    background: #f0fdf4;
    color: #047857;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 220px;
    text-align: center;
    font-weight: 800;
}

.manual-assembly-month-empty i {
    font-size: 2.2rem;
    color: #10b981;
}

.manual-assembly-month-empty small {
    color: #64748b;
    font-weight: 700;
}

@media (min-width: 768px) {
    .manual-assembly-page {
        max-width: none;
        min-height: calc(100vh - 132px);
    }

    #manual-assembly-filter-panel {
        align-items: end;
    }

    #manual-assembly-summary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .manual-assembly-month-toolbar {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 18px;
        border: 1px solid #d1fae5;
        border-radius: 16px 16px 0 0;
        background: #f8fffb;
        padding: 14px 16px;
    }

    .manual-assembly-month-left {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .manual-assembly-month-heading {
        flex: 0 0 auto;
        min-width: 230px;
    }

    .manual-assembly-month-toolbar h3 {
        margin: 0;
        color: #064e3b;
        font-size: 1.05rem;
        font-weight: 900;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .manual-assembly-month-toolbar p {
        margin: 3px 0 0;
        color: #64748b;
        font-size: 0.86rem;
        font-weight: 800;
    }

    .manual-assembly-month-tools {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        max-width: none;
        padding-top: 1px;
        flex-wrap: wrap;
    }

    .manual-assembly-month-mode,
    .manual-assembly-month-bulk {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        min-height: 42px;
        padding: 5px;
        border: 1px solid #d1fae5;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .manual-assembly-month-bulk {
        border-color: #e2e8f0;
        background: #f8fafc;
    }

    .manual-assembly-tool-label {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 0 8px;
        border-right: 1px solid #e2e8f0;
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .manual-assembly-month-mode button,
    .manual-assembly-month-bulk button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 32px;
        border-radius: 10px;
        border: 1px solid #d1d5db;
        background: #fff;
        color: #475569;
        padding: 6px 10px;
        font-size: 0.75rem;
        font-weight: 900;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    }

    .manual-assembly-month-mode button {
        min-width: 42px;
        border-radius: 999px;
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .manual-assembly-month-mode button:hover,
    .manual-assembly-month-bulk button:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    }

    .manual-assembly-month-mode button:disabled,
    .manual-assembly-month-bulk button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
        transform: none;
        box-shadow: none;
    }

    .manual-assembly-month-mode button.present {
        background: #dcfce7;
        border-color: #bbf7d0;
        color: #047857;
    }

    .manual-assembly-month-mode button.late {
        background: #fef3c7;
        border-color: #fde68a;
        color: #b45309;
    }

    .manual-assembly-month-mode button.leave {
        background: #e0f2fe;
        border-color: #bae6fd;
        color: #0369a1;
    }

    .manual-assembly-month-mode button.absent {
        background: #fee2e2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .manual-assembly-month-mode button.active {
        border-width: 2px;
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 8px 18px rgba(15, 23, 42, 0.12);
        transform: translateY(-1px);
    }

    .manual-assembly-month-mode button.active.present {
        border-color: #22c55e;
    }

    .manual-assembly-month-mode button.active.late {
        border-color: #f59e0b;
    }

    .manual-assembly-month-mode button.active.leave {
        border-color: #38bdf8;
    }

    .manual-assembly-month-mode button.active.absent {
        border-color: #ef4444;
    }

    .manual-assembly-month-bulk button.present {
        background: #16a34a;
        border-color: #16a34a;
        color: #fff;
    }

    .manual-assembly-month-bulk button.absent {
        background: #dc2626;
        border-color: #dc2626;
        color: #fff;
    }

    .manual-assembly-month-bulk button.clear {
        background: #fff1f2;
        border-color: #fecdd3;
        color: #be123c;
    }

    .manual-assembly-month-bulk button.clear:hover {
        background: #e11d48;
        border-color: #e11d48;
        color: #fff;
    }

    .manual-assembly-month-bulk button.print {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .manual-assembly-month-bulk button.print:hover {
        background: #2563eb;
        border-color: #2563eb;
        color: #fff;
    }

    .manual-assembly-month-bulk button.select-date {
        background: #ffffff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .manual-assembly-month-bulk button.select-date:hover {
        background: #dbeafe;
        border-color: #93c5fd;
        color: #1e40af;
    }

    .manual-assembly-month-selected-count {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        border-radius: 999px;
        border: 1px solid #d1fae5;
        background: #ecfdf5;
        color: #047857;
        padding: 4px 9px;
        font-size: 0.72rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .manual-assembly-month-table-wrap {
        width: 100%;
        overflow: visible;
        border: 1px solid #d1fae5;
        border-top: 0;
        border-radius: 0 0 16px 16px;
        background: #fff;
    }

    .manual-assembly-month-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 0.76rem;
    }

    .manual-assembly-month-table th,
    .manual-assembly-month-table td {
        border-right: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
        text-align: center;
    }

    .manual-assembly-month-table thead th {
        position: sticky;
        top: 0;
        z-index: 4;
        background: #ecfdf5;
        color: #065f46;
        font-weight: 900;
    }

    .manual-assembly-month-index {
        position: sticky;
        left: 0;
        z-index: 3;
        width: 44px;
        padding: 8px 6px;
        color: #64748b;
        font-weight: 900;
        background: #fff !important;
    }

    .manual-assembly-month-student {
        position: sticky;
        left: 44px;
        z-index: 3;
        width: 230px;
        padding: 7px 8px;
        text-align: left !important;
        background: #fff !important;
        box-shadow: 5px 0 10px rgba(15, 23, 42, 0.05);
    }

    thead .manual-assembly-month-index,
    thead .manual-assembly-month-student {
        z-index: 5;
        background: #ecfdf5 !important;
    }

    .manual-assembly-month-student-inner {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    thead .manual-assembly-month-student {
        min-height: 52px;
    }

    .manual-assembly-month-student img {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        object-fit: cover;
        border: 2px solid #d1fae5;
        background: #f8fafc;
        flex: 0 0 auto;
    }

    .manual-assembly-month-student strong {
        display: block;
        color: #0f172a;
        line-height: 1.15;
        max-width: 165px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .manual-assembly-month-student span {
        display: block;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        margin-top: 2px;
    }

    .manual-assembly-month-duty-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-top: 5px;
        min-height: 24px;
        padding: 3px 8px;
        border-radius: 999px;
        border: 1px solid #e9d5ff;
        background: #faf5ff;
        color: #7e22ce;
        font-size: 0.68rem;
        font-weight: 900;
        line-height: 1;
        transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    }

    .manual-assembly-month-duty-btn:hover {
        transform: translateY(-1px);
        background: #9333ea;
        border-color: #9333ea;
        color: #fff;
        box-shadow: 0 6px 14px rgba(126, 34, 206, 0.16);
    }

    .manual-assembly-month-duty-btn.is-duty {
        border-color: #fecaca;
        background: #fff1f2;
        color: #be123c;
    }

    .manual-assembly-month-duty-btn.is-duty:hover {
        background: #e11d48;
        border-color: #e11d48;
        color: #fff;
        box-shadow: 0 6px 14px rgba(190, 18, 60, 0.16);
    }

    .manual-assembly-month-day {
        width: auto;
        padding: 5px 2px;
        line-height: 1.1;
        transition: background 0.12s ease, color 0.12s ease;
    }

    .manual-assembly-month-day.is-selected {
        background: #dcfce7 !important;
        color: #047857;
    }

    .manual-assembly-month-date-check {
        display: grid;
        justify-items: center;
        gap: 2px;
        cursor: pointer;
        user-select: none;
    }

    .manual-assembly-month-date-check input {
        width: 13px;
        height: 13px;
        margin: 0 0 1px;
        accent-color: #16a34a;
        cursor: pointer;
    }

    .manual-assembly-month-day span {
        display: block;
        font-size: 0.86rem;
    }

    .manual-assembly-month-day small {
        display: block;
        color: #64748b;
        font-size: 0.64rem;
        margin-top: 3px;
    }

    .manual-assembly-month-cell {
        position: relative;
        width: 30px;
        height: 30px;
        margin: 4px 2px;
        border-radius: 9px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #94a3b8;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        line-height: 1;
        transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    }

    .manual-assembly-month-cell:not(:disabled):hover {
        transform: translateY(-1px) scale(1.06);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
        filter: brightness(0.98);
    }

    .manual-assembly-month-cell.present { background: #dcfce7; border-color: #86efac; color: #047857; }
    .manual-assembly-month-cell.late { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
    .manual-assembly-month-cell.leave { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
    .manual-assembly-month-cell.absent { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
    .manual-assembly-month-cell.duty { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; cursor: not-allowed; }

    .manual-assembly-leave-reason-panel {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin: -6px 0 10px;
        padding: 10px 12px;
        border-radius: 16px;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        color: #1d4ed8;
        font-size: 12px;
        font-weight: 800;
    }

    .manual-assembly-leave-reason-panel strong {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

    .manual-assembly-leave-reason-panel div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-width: 0;
    }

    .manual-assembly-leave-reason-panel span {
        max-width: 280px;
        padding: 3px 8px;
        border-radius: 999px;
        background: #ffffff;
        border: 1px solid #dbeafe;
        color: #1e40af;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .manual-assembly-month-cell.has-reason {
        box-shadow: inset 0 0 0 2px rgba(14, 165, 233, 0.22);
    }

    .manual-assembly-month-reason-dot {
        position: absolute;
        right: -3px;
        top: -3px;
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: #2563eb;
        border: 2px solid #ffffff;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    }

    .manual-assembly-month-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #cbd5e1;
        display: block;
    }

    .manual-assembly-month-absent-total {
        position: sticky;
        right: 0;
        z-index: 3;
        width: 50px;
        padding: 6px 5px;
        background: #fff7f7 !important;
        color: #b91c1c;
        font-weight: 900;
        box-shadow: -5px 0 10px rgba(15, 23, 42, 0.05);
    }

    thead .manual-assembly-month-absent-total {
        z-index: 5;
        background: #fee2e2 !important;
        color: #991b1b;
    }

    .manual-assembly-month-absent-total span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 30px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid #fecaca;
        color: #b91c1c;
        font-weight: 900;
    }
}

.manual-assembly-leave-reason {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    width: fit-content;
    margin-top: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-choice-popup {
    width: min(540px, calc(100vw - 24px)) !important;
    padding: 1.35rem !important;
    border-radius: 1.25rem !important;
}

.attendance-choice-popup .swal2-title {
    padding: 0.15rem 0.5rem 0 !important;
    color: #0f172a;
    font-size: 1.45rem !important;
    line-height: 1.25;
    font-weight: 900;
}

.attendance-choice-body {
    margin: 0.55rem 0 0 !important;
    padding: 0 !important;
}

.attendance-choice-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.45;
    font-weight: 700;
    text-align: center;
}

.attendance-choice-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem !important;
    width: 100% !important;
    margin: 1rem 0 0 !important;
}

.attendance-choice-button {
    display: block !important;
    width: 100% !important;
    min-height: 94px;
    margin: 0 !important;
    padding: 0.8rem 0.9rem !important;
    border: 0 !important;
    border-radius: 0.9rem !important;
    color: #ffffff !important;
    text-align: left !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14) !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease !important;
}

.attendance-choice-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 13px 26px rgba(15, 23, 42, 0.18) !important;
}

.attendance-choice-button:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.3) !important;
    outline-offset: 2px;
}

.attendance-choice-requests {
    background: #7c3aed !important;
}

.attendance-choice-requests:hover {
    background: #6d28d9 !important;
}

.attendance-choice-auto {
    color: #713f12 !important;
    box-shadow: 0 10px 22px rgba(202, 138, 4, 0.24) !important;
}

.attendance-choice-auto .attendance-choice-icon {
    border-color: rgba(113, 63, 18, 0.18);
    background: rgba(255, 255, 255, 0.5);
    color: #92400e;
}

.attendance-choice-auto .attendance-choice-copy strong {
    color: #422006;
}

.attendance-choice-auto .attendance-choice-copy small {
    color: rgba(66, 32, 6, 0.78);
}

.attendance-choice-auto .attendance-choice-arrow {
    color: rgba(113, 63, 18, 0.78);
}

.attendance-choice-content {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 1rem;
    gap: 0.8rem;
    width: 100%;
    align-items: center;
}

.attendance-choice-icon {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.attendance-choice-copy {
    display: block;
    min-width: 0;
}

.attendance-choice-copy strong,
.attendance-choice-copy small {
    display: block;
    white-space: normal;
}

.attendance-choice-copy strong {
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.2;
    font-weight: 900;
}

.attendance-choice-copy small {
    margin-top: 0.28rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 700;
}

.attendance-choice-arrow {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
}

.attendance-choice-cancel {
    width: 100% !important;
    min-height: 48px;
    margin: 0 !important;
    padding: 0.65rem 1rem !important;
    border-radius: 0.75rem !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    box-shadow: none !important;
}

.attendance-choice-cancel:hover {
    background: #e2e8f0 !important;
}

@media (max-width: 479px) {
    .attendance-choice-popup {
        padding: 1rem !important;
    }

    .attendance-choice-popup .swal2-title {
        font-size: 1.25rem !important;
    }

    .attendance-choice-button {
        min-height: 96px;
        padding: 0.72rem !important;
    }

    .attendance-choice-content {
        grid-template-columns: 2.8rem minmax(0, 1fr) 0.8rem;
        gap: 0.65rem;
    }

    .attendance-choice-icon {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.18rem;
    }

    .attendance-choice-copy strong {
        font-size: 0.96rem;
    }

    .attendance-choice-copy small {
        font-size: 0.72rem;
    }
}

.dashboard-overview-subject-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(132px, auto);
    align-content: start;
    gap: 8px;
    max-height: 420px;
    padding-right: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.dashboard-overview-subject-list::-webkit-scrollbar { width: 6px; }
.dashboard-overview-subject-list::-webkit-scrollbar-track { background: #f1f5f9; }
.dashboard-overview-subject-list::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

.dashboard-overview-subject-row {
    container: dashboard-subject / inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    min-width: 0;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.dashboard-overview-subject-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    padding: 12px;
    text-align: left;
    color: #172033;
    background: #ffffff;
    transition: background-color 0.16s ease;
}
.dashboard-overview-subject-main:hover { background: #f8fafc; }
.dashboard-overview-subject-main:focus-visible,
.dashboard-overview-subject-chart:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -3px;
}

.dashboard-overview-subject-level {
    display: flex;
    flex: 0 0 76px;
    align-self: stretch;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
    border-right: 1px solid #cce7df;
    padding-right: 10px;
    min-width: 0;
    color: #047857;
    overflow-wrap: anywhere;
}
.dashboard-overview-subject-level-caption {
    color: #526575;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 500;
}
.dashboard-overview-subject-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    max-width: 100%;
    font-size: 22px;
    line-height: 1;
}
.dashboard-overview-subject-level strong {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 800;
}
.dashboard-overview-subject-level strong.is-unspecified,
.dashboard-overview-subject-level strong.is-group { font-size: 16px; }
.dashboard-overview-subject-body { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.dashboard-overview-subject-name {
    display: block;
    color: #172033;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.dashboard-overview-subject-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    min-width: 0;
    margin-top: 2px;
}
.dashboard-overview-subject-code {
    color: #526575;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.dashboard-overview-gradebook-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1d4ed8;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
}
.dashboard-overview-subject-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    color: #526575;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
}
.dashboard-overview-subject-meta span { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.dashboard-overview-subject-meta i { color: #64748b; flex-shrink: 0; font-size: 11px; }
.dashboard-subject-performance-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 8px;
    margin-top: 6px;
    color: #526575;
    font-size: 12px;
    line-height: 1.5;
}
.dashboard-subject-performance-heading > span { color: #64748b; font-size: 11px; }
.dashboard-subject-performance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.dashboard-subject-performance > span { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: center; gap: 0 3px; min-width: 0; padding: 3px 2px; border-radius: 4px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.dashboard-subject-performance > span > span:first-child { grid-column: 1 / -1; text-align: center; }
.dashboard-subject-performance strong { font-size: 15px; font-weight: 700; }
.dashboard-subject-performance .is-strong { background: #dcfce7; color: #166534; border-bottom: 2px solid #16a34a; }
.dashboard-subject-performance .is-middle { background: #fef9c3; color: #854d0e; border-bottom: 2px solid #eab308; }
.dashboard-subject-performance .is-weak { background: #fee2e2; color: #991b1b; border-bottom: 2px solid #ef4444; }
.dashboard-overview-subject-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #dbe3ed;
    color: #1d4ed8;
    background: #f8fafc;
    font-size: 16px;
    transition: background-color 0.16s ease;
}
.dashboard-overview-subject-chart:hover { background: #eff6ff; }

@container dashboard-subject (max-width: 310px) {
    .dashboard-overview-subject-main { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; }
    .dashboard-overview-subject-level { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 8px; border-right: 0; padding-right: 0; }
}

@media (max-width: 480px) {
    .dashboard-overview-subject-main { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; }
    .dashboard-overview-subject-level {
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 4px 8px;
        border-right: 0;
        padding-right: 0;
    }
}

.dashboard-overview-all-gradebook {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 900;
}

.dashboard-overview-all-gradebook:hover {
    color: #1d4ed8;
}

#view-gradebook > div {
    padding: 16px;
    border-radius: 8px;
    box-shadow: none;
}

#gradebook-content-area {
    padding-top: 4px;
    padding-bottom: 0;
}

.gradebook-table-toolbar h3 { margin: 0; }
.gradebook-table-filters { max-width: 540px; }
.gradebook-column-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    text-align: left;
}
.gradebook-topic-legend { min-width: 0; flex: 1; }
.gradebook-topic-legend summary {
    width: fit-content;
    cursor: pointer;
    padding: 6px 0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}
.gradebook-topic-legend summary span { margin-left: 6px; color: #64748b; }
.gradebook-topic-legend dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 8px 20px;
    margin: 8px 0;
    padding: 10px 0;
    border-block: 1px solid #e2e8f0;
    font-size: 13px;
}
.gradebook-topic-legend dl > div { display: flex; gap: 8px; min-width: 0; }
.gradebook-topic-legend dt { flex: 0 0 48px; font-weight: 700; color: #0369a1; }
.gradebook-topic-legend dd { margin: 0; overflow-wrap: anywhere; color: #334155; }
.gradebook-topic-legend dd small { white-space: nowrap; color: #64748b; }
.gradebook-column-pager { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gradebook-column-pager > span { color: #475569; font-size: 12px; font-variant-numeric: tabular-nums; }
.gradebook-column-pager button {
    width: 30px;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #0369a1;
}
.gradebook-column-pager button:disabled { color: #94a3b8; background: #f8fafc; cursor: default; }
#gradebook-column-pager[hidden],
#gradebook-table [data-score-column][hidden] { display: none !important; }
#gradebook-table-wrap { overflow: visible; }
#gradebook-table { table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; }
#gradebook-table .gradebook-col-order { width: 28px; }
#gradebook-table .gradebook-col-id { width: 60px; }
#gradebook-table .gradebook-col-name { width: var(--gradebook-name-width, 190px); }
#gradebook-table .gradebook-col-total { width: 64px; }
#gradebook-table .gradebook-col-grade { width: 48px; }
#gradebook-table th {
    height: 56px;
    padding: 4px 3px;
    font-size: 12px;
    line-height: 1.35;
    vertical-align: middle;
    text-transform: none;
}
#gradebook-table td {
    height: 40px;
    min-width: 0;
    padding: 2px 4px;
    font-size: 13px;
    line-height: 1.4;
}
#gradebook-table .gradebook-student-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gradebook-student-profile-button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 2px 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #0369a1;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.gradebook-student-profile-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gradebook-student-profile-button i { flex: 0 0 auto; font-size: 12px; color: #64748b; }
.gradebook-student-profile-button:hover { color: #075985; background: #f0f9ff; }
.gradebook-student-profile-button:hover span { text-decoration: underline; }
.gradebook-student-profile-button:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }
.gradebook-mobile-card .gradebook-student-profile-button { min-height: 44px; }
.gradebook-mobile-card .gradebook-student-profile-button span { white-space: normal; overflow-wrap: anywhere; }
@media screen {
.gradebook-student-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.gradebook-student-name-row > .gradebook-student-profile-button { flex: 1; width: auto; }
.gradebook-attendance-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 4px; color: #0369a1; font-size: 13px; background: transparent; }
.gradebook-attendance-toggle:hover, .gradebook-attendance-toggle[aria-expanded="true"] { background: #e0f2fe; color: #075985; }
.gradebook-attendance-panel { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows 220ms ease, opacity 220ms ease, visibility 220ms; }
.gradebook-attendance-panel.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
.gradebook-attendance-panel > div { min-height: 0; overflow: hidden; }
.gradebook-attendance-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin-top: 6px; }
.gradebook-attendance-counts > span { padding: 4px 2px; text-align: center; font-size: 10px; border-radius: 4px; }
.gradebook-attendance-counts strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.gradebook-attendance-counts .is-present { background: #dcfce7; color: #166534; }
.gradebook-attendance-counts .is-late { background: #fef3c7; color: #92400e; }
.gradebook-attendance-counts .is-absent { background: #ffe4e6; color: #9f1239; }
.gradebook-attendance-counts .is-leave { background: #e0f2fe; color: #075985; }
.gradebook-attendance-panel p { margin: 5px 0; color: #64748b; font-size: 10px; line-height: 1.5; white-space: normal; }
.gradebook-attendance-risk-label { display: block; color: #9f1239; font-size: 10px; line-height: 1.5; white-space: normal; }
#gradebook-table .gradebook-attendance-risk .gradebook-student-profile-button,
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) .gradebook-attendance-risk .gradebook-student-profile-button,
.gradebook-mobile-card .gradebook-attendance-risk .gradebook-student-profile-button { background: #ffe4e6; color: #9f1239; border-left: 3px solid #e11d48; padding-inline: 5px; }
.gradebook-mobile-card > .gradebook-attendance { padding: 0 10px; }
.gradebook-mobile-card .gradebook-attendance-toggle { width: 44px; height: 44px; font-size: 14px; }
.gradebook-mobile-card .gradebook-attendance-counts > span { font-size: 12px; }
.gradebook-mobile-card .gradebook-attendance-counts strong { font-size: 16px; }
.gradebook-attendance-toggle:focus-visible { outline: 2px solid #0284c7; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
    .gradebook-attendance-panel, .gradebook-attendance-toggle > i:last-child { transition: none; }
}
}
@media print { .gradebook-attendance, .gradebook-attendance-risk-label { display: none !important; } }
.gradebook-photo-toggle[aria-pressed="true"] { background: #e0f2fe; border-color: #0284c7; color: #075985; }
.gradebook-student-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gradebook-student-copy { min-width: 0; flex: 1; }
.gradebook-student-photo {
    display: none;
    flex: 0 0 48px;
    width: 48px;
    height: 64px;
    padding: 0;
    overflow: hidden;
    border: 3px solid #ffffff;
    border-radius: 6px;
    background: #e2e8f0;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.14);
    cursor: pointer;
}
.gradebook-student-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.gradebook-student-photo-fallback { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #64748b; }
.gradebook-student-photo [hidden] { display: none !important; }
.gradebook-student-photo:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }
.gradebook-student-photo-hover {
    position: fixed;
    z-index: 105;
    width: 176px;
    height: 234px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    box-sizing: border-box;
    border: 3px solid #fff;
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
    pointer-events: none;
}
@media (max-width: 767px), (hover: none), (pointer: coarse) { .gradebook-student-photo-hover { display: none; } }
.gradebook-show-student-photos .gradebook-student-photo { display: block; }
#gradebook-table .gradebook-student-name { padding-block: 2px; }
#gradebook-table .gradebook-student-summary { display: none; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 0; color: #64748b; font-size: 11px; line-height: 1.6; white-space: normal; }
#gradebook-table-wrap.gradebook-show-student-photos .gradebook-student-summary { display: flex; }
.gradebook-student-summary > span { white-space: nowrap; }
#gradebook-table .gradebook-student-summary .gradebook-total-value { font-size: 13px; color: #c2410c; }
#gradebook-table .gradebook-student-summary .gradebook-grade-value { font-size: 13px; color: #be185d; }
.gradebook-student-summary small { margin-left: 2px; font-size: 10px; }
#gradebook-table-wrap.gradebook-show-student-photos .gradebook-student-name { padding-block: 6px; }
#gradebook-table .gradebook-column-header { align-items: center; gap: 2px; }
#gradebook-table .gradebook-column-header > button:first-child { gap: 2px; }
#gradebook-table .gradebook-column-edit-button,
#gradebook-table .gradebook-column-fill-button {
    width: 18px;
    height: 24px;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 3px;
}
.gradebook-short-heading { display: block; white-space: nowrap; }
.gradebook-column-max { display: block; margin-top: 2px; color: #64748b; font-size: 11px; font-weight: 400; }
#gradebook-table .gradebook-score-display { min-height: 34px; padding: 0 14px; }
#gradebook-table .gradebook-score-value { font-size: 14px; white-space: nowrap; }
#gradebook-table .gradebook-cell-edit-button,
#gradebook-table .gradebook-history-button { width: 16px; height: 22px; top: 8px; border-radius: 3px; }
#gradebook-table .gradebook-cell-edit-button { right: 1px; }
#gradebook-table .gradebook-history-button { left: 1px; }
#gradebook-table .gradebook-score-editor { position: relative; min-height: 34px; padding: 0; }
#gradebook-table .gradebook-score-editor input { width: 100%; height: 26px; padding: 0 1px; font-size: 13px; border-width: 1px; border-radius: 3px; }
#gradebook-table .gradebook-save-status { position: absolute; bottom: -3px; left: 0; right: 0; margin: 0; min-height: 0; height: 10px; line-height: 10px; font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#gradebook-table .gradebook-score-cell:has(.gradebook-score-editor:not(.hidden)) > button { display: none; }
#gradebook-table .gradebook-total-value,
#gradebook-table .gradebook-grade-value { font-size: 15px; font-weight: 800; }
#gradebook-table tr,
#gradebook-table td,
#gradebook-table button { animation: none; transition: none; }
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) > td {
    background-color: #cffafe;
    box-shadow: inset 0 1px 0 #0891b2, inset 0 -1px 0 #0891b2;
}
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) > td:nth-child(-n+3) {
    background-color: #a5f3fc;
}
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) > td:first-child {
    box-shadow: inset 4px 0 0 #0e7490, inset 0 1px 0 #0891b2, inset 0 -1px 0 #0891b2;
}
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) > td[data-score-edited="1"] {
    background-color: #fde047;
}
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) > td.gradebook-column-editing {
    box-shadow: inset 0 3px 0 #60a5fa, inset 0 -1px 0 #0891b2;
}
#gradebook-table tbody tr[data-gradebook-student-id]:is(:hover, :focus-within) .gradebook-student-profile-button {
    background: transparent;
    color: #075985;
}
@media (max-width: 767px) {
    #gradebook-column-pager { display: none; }
    .gradebook-table-toolbar h3 { font-size: 15px; }
    #view-gradebook > div { padding: 12px; }
}

@media screen and (max-width: 767px) {
    #gradebook-mobile-cards { font-variant-numeric: tabular-nums; }
    .gradebook-mobile-card .gradebook-mobile-header { padding: 10px; }
    .gradebook-mobile-card .gradebook-mobile-identity { gap: 8px; }
    .gradebook-mobile-card .gradebook-mobile-portrait { width: 48px; height: 60px; }
    .gradebook-mobile-card .gradebook-mobile-student-copy h4 { margin: 0; font-size: 14px; line-height: 1.5; }
    .gradebook-mobile-card .gradebook-mobile-student-meta { font-size: 10px; line-height: 1.5; color: #64748b; }
    .gradebook-mobile-card .gradebook-student-profile-button { min-height: 44px; padding: 0; gap: 4px; }
    .gradebook-mobile-card .gradebook-student-profile-button i { font-size: 11px; }
    .gradebook-mobile-card .gradebook-mobile-toggle { width: 44px; height: 44px; border: 0; background: #f1f5f9; }
    .gradebook-mobile-card .gradebook-mobile-summary { margin-top: 8px; padding-top: 8px; grid-template-columns: minmax(0, 1fr) auto; }
    .gradebook-mobile-card .gradebook-mobile-summary > div { flex-wrap: wrap; gap: 2px 5px; padding-inline: 8px; }
    .gradebook-mobile-card .gradebook-mobile-summary .gradebook-total-value,
    .gradebook-mobile-card .gradebook-mobile-summary .gradebook-grade-value { font-size: 17px; line-height: 1.4; }
    .gradebook-mobile-card .gradebook-mobile-details { padding: 0 10px; background: #fff; }
    .gradebook-mobile-score-item { display: flex; align-items: center; gap: 8px; min-height: 56px; padding-block: 6px; }
    .gradebook-mobile-score-list > [data-gradebook-column-key] + [data-gradebook-column-key] { border-top: 1px solid #e2e8f0; }
    .gradebook-mobile-score-title { flex: 1; min-width: 0; color: #334155; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
    .gradebook-mobile-score-kind { margin-right: 5px; color: #64748b; font-size: 11px; font-weight: 400; white-space: nowrap; }
    .gradebook-mobile-score-item.is-exam .gradebook-mobile-score-kind { color: #7e22ce; }
    .gradebook-mobile-card .gradebook-mobile-score-control {
        flex: 0 0 auto;
        width: 44px;
        min-width: 0;
        height: 44px;
        padding: 0;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }
    .gradebook-mobile-card .gradebook-mobile-score-control.is-editable { width: 88px; }
    .gradebook-mobile-card .gradebook-mobile-score-control[data-score-edited="1"] { width: 88px; }
    .gradebook-mobile-card .gradebook-mobile-score-control.is-editable[data-score-edited="1"] { width: 132px; }
    .gradebook-mobile-score-control .gradebook-score-display { flex-direction: column; gap: 0; width: 44px; min-height: 42px; height: 42px; padding: 0; line-height: 1.1; }
    .gradebook-mobile-score-control[data-score-edited="1"] .gradebook-score-display { margin-left: 44px; }
    .gradebook-mobile-score-control .gradebook-score-value { font-size: 15px; white-space: nowrap; }
    .gradebook-mobile-score-control[data-score-value=""] .gradebook-score-value { color: #64748b; }
    .gradebook-mobile-score-max { color: #64748b; font-size: 10px; font-weight: 400; white-space: nowrap; }
    .gradebook-mobile-score-control .gradebook-cell-edit-button,
    .gradebook-mobile-score-control .gradebook-history-button { top: -1px; width: 44px; height: 44px; border-radius: 5px; }
    .gradebook-mobile-score-control .gradebook-cell-edit-button { right: -1px; }
    .gradebook-mobile-score-control .gradebook-history-button { left: -1px; }
    .gradebook-mobile-score-control .gradebook-cell-edit-button i,
    .gradebook-mobile-score-control .gradebook-history-button i { font-size: 12px; }
    .gradebook-mobile-score-control .gradebook-score-editor { min-height: 42px; padding: 0; position: relative; }
    .gradebook-mobile-score-control .gradebook-score-editor input { width: 100%; height: 42px; padding: 0 4px 10px; font-size: 16px; }
    .gradebook-mobile-score-control .gradebook-save-status { position: absolute; bottom: 1px; left: 1px; right: 1px; margin: 0; min-height: 0; font-size: 9px; line-height: 11px; pointer-events: none; }
    .gradebook-mobile-score-control:has(.gradebook-score-editor:not(.hidden)) > button { display: none; }
    .gradebook-mobile-card button:focus-visible { outline: 2px solid #0284c7; outline-offset: 1px; }
    body.klassin-ui[data-klassin-view="gradebook"]:has(.gradebook-mobile-toggle[aria-expanded="true"], .gradebook-mobile-card .gradebook-attendance-toggle[aria-expanded="true"]) #klassin-buddy-dock { display: none !important; }
}

.gradebook-column-edit-button {
    margin-top: -0.2rem;
}

.gradebook-column-edit-button[aria-pressed="true"] {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.gradebook-score-cell.gradebook-column-editing {
    box-shadow: inset 0 3px 0 #60a5fa;
}

.gradebook-score-cell.gradebook-column-editing .gradebook-score-editor input {
    border-color: #3b82f6;
    background: #eff6ff;
}

.gradebook-import-popup {
    width: min(96vw, 68rem) !important;
    max-height: 94vh;
    border-radius: 1.25rem !important;
}

.gradebook-import-preview {
    color: #334155;
    text-align: left;
}

.gradebook-import-file {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #bbf7d0;
    border-radius: 0.65rem;
    background: #f0fdf4;
}

.gradebook-import-file i {
    color: #16a34a;
    font-size: 1.65rem;
    text-align: center;
}

.gradebook-import-file span {
    min-width: 0;
    overflow: hidden;
    color: #166534;
    font-size: 0.88rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gradebook-import-file small {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
    font-size: 0.68rem;
    font-weight: 900;
}

.gradebook-import-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.8rem 0;
}

.gradebook-import-summary > div {
    display: flex;
    min-height: 4.25rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    border: 1px solid #dbeafe;
    border-radius: 0.65rem;
    background: #f8fbff;
}

.gradebook-import-summary strong {
    color: #1d4ed8;
    font-size: 1.25rem;
    line-height: 1.1;
}

.gradebook-import-summary span {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}

.gradebook-import-warning,
.gradebook-import-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.5;
}

.gradebook-import-warning {
    margin-bottom: 0.7rem;
    border: 1px solid #fde68a;
    color: #92400e;
    background: #fffbeb;
}

.gradebook-import-note {
    margin-top: 0.7rem;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    background: #eff6ff;
}

.gradebook-import-warning i,
.gradebook-import-note i {
    margin-top: 0.15rem;
}

.gradebook-import-change-list {
    max-height: 43vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #ffffff;
    scrollbar-gutter: stable;
}

.gradebook-import-change-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.2fr) minmax(12rem, 1.35fr) minmax(9rem, 0.7fr);
    align-items: center;
    gap: 0.8rem;
    min-height: 4.4rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.gradebook-import-change-row:last-child {
    border-bottom: 0;
}

.gradebook-import-change-student,
.gradebook-import-change-item {
    min-width: 0;
}

.gradebook-import-change-student strong,
.gradebook-import-change-item strong {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gradebook-import-change-student span,
.gradebook-import-change-item span {
    display: block;
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
}

.gradebook-import-change-score {
    display: grid;
    grid-template-columns: minmax(2.5rem, 1fr) auto minmax(2.5rem, 1fr);
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}

.gradebook-import-change-score span,
.gradebook-import-change-score strong {
    padding: 0.45rem 0.35rem;
    border-radius: 0.5rem;
    font-size: 0.83rem;
}

.gradebook-import-change-score span {
    color: #64748b;
    background: #f1f5f9;
}

.gradebook-import-change-score strong {
    color: #1d4ed8;
    background: #dbeafe;
}

.gradebook-import-change-score i {
    color: #94a3b8;
    font-size: 0.7rem;
}

.gradebook-import-more {
    padding: 0.75rem;
    color: #475569;
    background: #f8fafc;
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
}

.gradebook-import-error-list {
    max-height: 54vh;
    margin: 0;
    overflow-y: auto;
    border: 1px solid #fecaca;
    border-radius: 0.65rem;
    background: #fff7f7;
    list-style: none;
}

.gradebook-import-error-list li {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #fee2e2;
    color: #991b1b;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.45;
}

.gradebook-import-error-list li:last-child {
    border-bottom: 0;
}

.gradebook-import-actions {
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem !important;
}

.gradebook-import-confirm,
.gradebook-import-cancel {
    min-height: 2.75rem;
    margin: 0 !important;
    border-radius: 0.65rem !important;
    font-size: 0.84rem !important;
    font-weight: 800 !important;
}

@media (max-width: 639px) {
    .gradebook-import-popup {
        width: calc(100vw - 1rem) !important;
        padding: 1rem !important;
    }

    .gradebook-import-popup .swal2-title {
        padding: 0.25rem 0 0.75rem;
        font-size: 1.12rem;
        line-height: 1.35;
    }

    .gradebook-import-popup .swal2-html-container {
        margin: 0;
    }

    .gradebook-import-file {
        grid-template-columns: 2.1rem minmax(0, 1fr) auto;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .gradebook-import-file i {
        font-size: 1.35rem;
    }

    .gradebook-import-summary {
        gap: 0.4rem;
    }

    .gradebook-import-summary > div {
        min-height: 3.7rem;
        padding: 0.4rem 0.2rem;
    }

    .gradebook-import-summary strong {
        font-size: 1rem;
    }

    .gradebook-import-summary span {
        font-size: 0.63rem;
        text-align: center;
    }

    .gradebook-import-change-list {
        max-height: 46vh;
    }

    .gradebook-import-change-row {
        grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 0.72fr);
        gap: 0.55rem;
        min-height: 5rem;
        padding: 0.65rem;
    }

    .gradebook-import-change-item {
        grid-column: 1;
        grid-row: 2;
    }

    .gradebook-import-change-score {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .gradebook-import-change-student strong,
    .gradebook-import-change-item strong {
        font-size: 0.75rem;
    }

    .gradebook-import-change-student span,
    .gradebook-import-change-item span {
        font-size: 0.65rem;
    }

    .gradebook-import-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    }

    .gradebook-import-confirm,
    .gradebook-import-cancel {
        width: 100%;
        padding: 0.65rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
}

@media (min-width: 1024px) {
    .dashboard-overview-content {
        grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.55fr);
        gap: 1.25rem;
        align-items: stretch;
    }

    .dashboard-overview-summary-pane {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 1.25rem 0 0;
        border-right: 1px solid #e2e8f0;
        border-bottom: 0;
    }

    .dashboard-overview-subjects {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .dashboard-overview-subject-list {
        flex: 1 1 auto;
    }
}

.quick-report-button {
    background: #f8fbff;
    border-color: #dbeafe;
}

.quick-report-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #eff6ff;
    opacity: 0.74;
}

.quick-report-icon {
    position: relative;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: #2563eb;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(191, 219, 254, 0.9);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.quick-report-paper {
    position: absolute;
    z-index: 1;
    color: rgba(37, 99, 235, 0.24);
    font-size: 1rem;
    pointer-events: none;
    animation: quickReportPaperFly 2.9s ease-in-out infinite;
}

.quick-report-paper-one {
    top: 0.7rem;
    right: 1.55rem;
}

.quick-report-paper-two {
    top: 1.6rem;
    left: 1.35rem;
    animation-delay: 1.1s;
    color: rgba(14, 165, 233, 0.22);
}

.score-topic-manager-popup {
    max-width: calc(100vw - 1.5rem) !important;
    padding: 1.25rem !important;
    border-radius: 1rem !important;
}

.score-topic-manager-html {
    margin: 0.5rem 0 0 !important;
    text-align: left !important;
}

.score-topic-manager-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.65rem;
    background: #eff6ff;
    color: #1e3a8a;
}

.score-topic-manager-summary > span {
    display: flex;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    background: #2563eb;
    color: #ffffff;
}

.score-topic-manager-summary div {
    min-width: 0;
}

.score-topic-manager-summary b,
.score-topic-manager-summary small {
    display: block;
}

.score-topic-manager-summary small {
    margin-top: 0.12rem;
    color: #475569;
    font-size: 0.76rem;
    line-height: 1.35;
}

.score-topic-manager-search {
    position: relative;
    display: block;
    margin-bottom: 0.75rem;
}

.score-topic-manager-search i {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.score-topic-manager-search input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem 0.65rem 2.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    outline: none;
}

.score-topic-manager-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.score-topic-manager-list {
    max-height: min(52vh, 31rem);
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #ffffff;
}

.score-topic-manager-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 160ms ease;
}

.score-topic-manager-row:last-child {
    border-bottom: 0;
}

.score-topic-manager-row:hover {
    background: #f8fafc;
}

.score-topic-manager-main {
    min-width: 0;
}

.score-topic-manager-header {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
}

.score-topic-manager-icon {
    display: flex;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #fde68a;
    border-radius: 0.55rem;
    background: #fffbeb;
    color: #eab308;
}

.score-topic-manager-name {
    min-width: 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.score-topic-manager-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem 0.8rem;
    margin-top: 0.32rem;
    margin-left: 3.05rem;
}

.score-topic-manager-meta span {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.3rem;
    color: #64748b;
    font-size: 0.73rem;
    line-height: 1.35;
}

.score-topic-manager-meta i {
    margin-top: 0.12rem;
    color: #3b82f6;
}

.score-topic-manager-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.score-topic-manager-edit,
.score-topic-manager-delete {
    display: inline-flex;
    min-width: 4.25rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #fecaca;
    border-radius: 0.6rem;
    background: #fff1f2;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 800;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.score-topic-manager-edit {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.score-topic-manager-edit:hover {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.score-topic-manager-delete:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #ffffff;
}

.score-topic-group-edit-context {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.8rem;
    padding: 0.75rem;
    border-left: 3px solid #3b82f6;
    background: #eff6ff;
    color: #475569;
    text-align: left;
}

.score-topic-group-edit-context b {
    color: #1e3a8a;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.score-topic-group-edit-context span {
    font-size: 0.78rem;
}

.score-topic-group-edit-form {
    display: grid;
    gap: 0.45rem;
    text-align: left;
}

.score-topic-group-edit-form label {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 800;
}

.score-topic-group-edit-form input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.55rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    outline: none;
}

.score-topic-group-edit-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.score-topic-group-edit-form small {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.4;
}

.score-topic-group-edit-form small i {
    margin-top: 0.12rem;
    color: #3b82f6;
}

.score-topic-group-edit-form .score-topic-group-highest {
    color: #b45309;
}

.score-topic-group-edit-form .score-topic-group-highest i {
    color: #f59e0b;
}

.score-topic-manager-empty {
    padding: 2rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.7rem;
    color: #64748b;
    text-align: center;
}

.score-topic-manager-empty i {
    margin-right: 0.4rem;
}

.score-topic-manager-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid #ef4444;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.74rem;
    line-height: 1.45;
}

.score-topic-delete-summary {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #f8fafc;
    color: #475569;
    text-align: left;
}

.score-topic-delete-summary b {
    color: #0f172a;
    font-size: 1rem;
}

.score-topic-delete-summary span {
    font-size: 0.82rem;
}

.score-topic-delete-summary .score-topic-delete-rooms {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.2rem;
    color: #334155;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.score-topic-delete-rooms i {
    margin-top: 0.15rem;
    color: #3b82f6;
}

.score-topic-delete-summary strong {
    margin-top: 0.35rem;
    color: #dc2626;
    font-size: 0.85rem;
}

.score-topic-delete-summary strong i {
    margin-right: 0.4rem;
}

.score-topic-delete-warning {
    margin: 0.7rem 0 0;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
}

@media (max-width: 640px) {
    .score-topic-manager-popup {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        padding: 0.8rem !important;
        border-radius: 0.9rem !important;
    }

    .score-topic-manager-popup .swal2-title {
        margin: 0 !important;
        padding: 0.2rem 2.75rem 0.55rem !important;
        color: #0f172a;
        font-size: 1.45rem !important;
        line-height: 1.25 !important;
    }

    .score-topic-manager-popup .swal2-close {
        top: 0.35rem !important;
        right: 0.35rem !important;
        width: 2.4rem !important;
        height: 2.4rem !important;
        font-size: 2rem !important;
    }

    .score-topic-manager-html {
        margin-top: 0.15rem !important;
    }

    .score-topic-manager-summary {
        gap: 0.6rem;
        margin-bottom: 0.6rem;
        padding: 0.65rem;
    }

    .score-topic-manager-summary > span {
        width: 2.15rem;
        height: 2.15rem;
        flex-basis: 2.15rem;
    }

    .score-topic-manager-summary b {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .score-topic-manager-summary small {
        font-size: 0.7rem;
    }

    .score-topic-manager-search {
        margin-bottom: 0.6rem;
    }

    .score-topic-manager-search input {
        min-height: 2.6rem;
        font-size: 0.82rem;
    }

    .score-topic-manager-list {
        max-height: min(43vh, 22rem);
    }

    .score-topic-manager-row {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0.85rem 0.75rem;
    }

    .score-topic-manager-header {
        min-height: 2.5rem;
        align-items: flex-start;
        gap: 0.6rem;
        padding-right: 5.9rem;
    }

    .score-topic-manager-icon {
        width: 2.2rem;
        height: 2.2rem;
        flex-basis: 2.2rem;
    }

    .score-topic-manager-name {
        padding-top: 0.05rem;
        font-size: 0.93rem;
        line-height: 1.4;
    }

    .score-topic-manager-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 0.8rem;
        margin: 0.65rem 0 0;
        padding-top: 0.65rem;
        border-top: 1px solid #eef2f7;
    }

    .score-topic-manager-meta span {
        min-width: 0;
        font-size: 0.76rem;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .score-topic-manager-meta .score-topic-meta-subject {
        grid-column: 1 / -1;
        color: #475569;
    }

    .score-topic-manager-actions {
        position: absolute;
        top: 0.75rem;
        right: 0.7rem;
        gap: 0.35rem;
    }

    .score-topic-manager-edit,
    .score-topic-manager-delete {
        min-width: 2.5rem;
        width: 2.5rem;
        min-height: 2.5rem;
        padding: 0;
    }

    .score-topic-manager-edit span,
    .score-topic-manager-delete span {
        display: none;
    }

    .score-topic-group-edit-popup {
        width: calc(100vw - 1rem) !important;
        padding: 1rem !important;
    }

    .score-topic-group-edit-popup .swal2-title {
        padding: 0.2rem 0.5rem 0.7rem !important;
        font-size: 1.25rem !important;
        line-height: 1.25 !important;
    }

    .score-topic-manager-warning {
        margin-top: 0.6rem;
        padding: 0.55rem 0.65rem;
        font-size: 0.69rem;
    }
}

#fab-menu {
    margin-bottom: -8px;
}

.klassin-buddy {
    position: relative;
    z-index: 2;
    width: 82px;
    height: 82px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    filter: drop-shadow(0 16px 24px rgba(14, 116, 144, 0.22));
    transition: transform .22s ease, opacity .22s ease, filter .22s ease;
}

.klassin-buddy:hover {
    transform: translateY(-4px) scale(1.04);
    filter: drop-shadow(0 18px 28px rgba(14, 165, 233, 0.34)) brightness(1.04);
}

.klassin-buddy svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.klassin-buddy .buddy-slime-master {
    transform-origin: 200px 330px;
    animation: klassinBuddySlimeWobble 2.8s ease-in-out infinite;
    transition: transform .42s cubic-bezier(.34, 1.56, .64, 1);
}

.klassin-buddy .buddy-eyes {
    transform-origin: 200px 250px;
    animation: klassinBuddyBlink 4.6s ease-in-out infinite;
}

.klassin-buddy .buddy-eye-dizzy,
.klassin-buddy .buddy-eye-sleepy,
.klassin-buddy .buddy-mood-art,
.klassin-buddy .buddy-mouth-happy {
    display: none;
}

.klassin-buddy.buddy-mood-nerd .buddy-nerd-art,
.klassin-buddy.buddy-mood-lunch .buddy-lunch-art,
.klassin-buddy.buddy-mood-sleepy .buddy-sleepy-art,
.klassin-buddy.buddy-mood-sleeping .buddy-sleepy-art,
.klassin-buddy.buddy-mood-sleeping .buddy-sleeping-art,
.klassin-buddy.buddy-mood-excited .buddy-excited-art {
    display: block;
}

.klassin-buddy.buddy-mood-sleepy .buddy-eye-normal,
.klassin-buddy.buddy-mood-sleeping .buddy-eye-normal {
    display: none;
}

.klassin-buddy.buddy-mood-sleepy .buddy-eye-sleepy,
.klassin-buddy.buddy-mood-sleeping .buddy-eye-sleepy {
    display: block;
}

.klassin-buddy.buddy-mood-nerd .buddy-nerd-art {
    transform-origin: 200px 250px;
    animation: klassinBuddyNerdGlasses 2.4s ease-in-out infinite;
}

.klassin-buddy.buddy-mood-lunch .buddy-lunch-art {
    transform-origin: 248px 318px;
    animation: klassinBuddyLunchNibble 1.7s ease-in-out infinite;
}

.klassin-buddy.buddy-mood-sleepy .buddy-sleepy-art,
.klassin-buddy.buddy-mood-sleeping .buddy-sleepy-art {
    animation: klassinBuddyZzzFloat 2.2s ease-in-out infinite;
}

.klassin-buddy.buddy-mood-sleeping .buddy-sleeping-art {
    transform-origin: 200px 334px;
    animation: klassinBuddyBlanketBreath 2.6s ease-in-out infinite;
}

.klassin-buddy.buddy-mood-excited .buddy-slime-master {
    animation: klassinBuddyExcitedJump .72s cubic-bezier(.34, 1.56, .64, 1) infinite;
}

.klassin-buddy.buddy-mood-excited .buddy-excited-art {
    transform-origin: 200px 230px;
    animation: klassinBuddySparkPop .62s ease-in-out infinite;
}

.klassin-buddy.buddy-poke .buddy-slime-master {
    animation: klassinBuddySlimePoke .62s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

.klassin-buddy.buddy-poke .buddy-slime-shadow {
    animation: klassinBuddyShadowPoke .62s ease forwards;
}

.klassin-buddy.buddy-poke .buddy-eye-normal,
.klassin-buddy.buddy-poke .buddy-mouth-idle {
    display: none;
}

.klassin-buddy.buddy-poke .buddy-eye-dizzy,
.klassin-buddy.buddy-poke .buddy-mouth-happy {
    display: block;
}

.klassin-buddy.buddy-exam-alert {
    animation: klassinBuddyExamBounce .9s cubic-bezier(.34, 1.56, .64, 1) 0s 4;
    filter: drop-shadow(0 18px 30px rgba(14, 165, 233, .38)) brightness(1.05);
}

.klassin-buddy-speech {
    position: fixed;
    right: 122px;
    bottom: 24px;
    z-index: 91;
    width: min(320px, calc(100vw - 152px));
    padding: 12px 38px 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, .42);
    background: linear-gradient(135deg, rgba(240, 249, 255, .98), rgba(236, 254, 255, .98));
    box-shadow: 0 18px 38px rgba(14, 116, 144, .2);
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
    pointer-events: auto;
    animation: klassinBuddySpeechPop .28s ease-out;
}

.klassin-buddy-speech::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 22px;
    width: 14px;
    height: 14px;
    background: rgba(236, 254, 255, .98);
    border-right: 1px solid rgba(56, 189, 248, .42);
    border-bottom: 1px solid rgba(56, 189, 248, .42);
    transform: rotate(-45deg);
}

.klassin-buddy-speech-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
    color: #0284c7;
    font-size: 12px;
    font-weight: 900;
}

.klassin-buddy-speech.is-greeting .klassin-buddy-speech-title {
    color: #0e7490;
}

.klassin-buddy-speech.is-countdown .klassin-buddy-speech-title {
    color: #f97316;
}

.klassin-buddy-speech.is-submitted .klassin-buddy-speech-title {
    color: #16a34a;
}

.klassin-buddy-speech.is-realtime .klassin-buddy-speech-title {
    color: #7c3aed;
}

.klassin-buddy-speech-text {
    display: block;
}

.klassin-buddy-result-title,
.klassin-buddy-result-meta,
.klassin-buddy-result-score,
.klassin-buddy-result-cheer {
    display: block;
}

.klassin-buddy-result-title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 950;
}

.klassin-buddy-result-meta {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

.klassin-buddy-result-meta-inline {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.klassin-buddy-result-score {
    margin-top: 7px;
    color: #16a34a;
    font-size: 18px;
    font-weight: 950;
}

.klassin-buddy-result-cheer {
    margin-top: 4px;
    color: #0369a1;
    font-size: 12px;
    font-weight: 900;
}

.klassin-buddy-countdown-label {
    display: inline-flex;
    align-items: center;
    margin-top: 7px;
    margin-right: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.klassin-buddy-countdown-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 7px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    font-weight: 950;
    letter-spacing: .03em;
}

.klassin-buddy-speech-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(14, 165, 233, .24);
}

.klassin-buddy-speech-action.hidden {
    display: none;
}

.klassin-buddy-speech-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, .85);
    color: #475569;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.klassin-buddy-speech-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

@keyframes klassinBuddySlimeWobble {
    0%, 100% { transform: scale(1, 1) translate(0, 0); }
    33% { transform: scale(1.05, .95) translate(0, 5px); }
    66% { transform: scale(.95, 1.05) translate(0, -5px); }
}

@keyframes klassinBuddySlimePoke {
    0%, 100% { transform: scale(1, 1) translate(0, 0); }
    20% { transform: scale(1.15, .85) translate(10px, 10px); }
    40% { transform: scale(.85, 1.15) translate(-10px, -5px); }
    60% { transform: scale(1.05, .95) translate(5px, 5px); }
    80% { transform: scale(.98, 1.02) translate(-2px, -2px); }
}

@keyframes klassinBuddyShadowPoke {
    0%, 100% { transform: scale(1) translateX(0); }
    20% { transform: scale(1.1) translateX(5px); }
    40% { transform: scale(.9) translateX(-5px); }
    60% { transform: scale(1.05) translateX(2px); }
}

@keyframes klassinBuddyBlink {
    0%, 94%, 100% { transform: scaleY(1); opacity: 1; }
    96%, 98% { transform: scaleY(.12); opacity: .2; }
}

@keyframes klassinBuddyExamBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-10px) scale(1.08); }
    68% { transform: translateY(3px) scale(.98); }
}

@keyframes klassinBuddyNerdGlasses {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    45% { transform: translateY(-2px) rotate(-2deg); }
    70% { transform: translateY(1px) rotate(1deg); }
}

@keyframes klassinBuddyLunchNibble {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: .96; }
    45% { transform: translate(-3px, -4px) rotate(-3deg); opacity: 1; }
    70% { transform: translate(2px, 1px) rotate(2deg); }
}

@keyframes klassinBuddyZzzFloat {
    0% { transform: translate(0, 4px); opacity: .25; }
    45% { transform: translate(5px, -6px); opacity: .9; }
    100% { transform: translate(10px, -16px); opacity: .1; }
}

@keyframes klassinBuddyBlanketBreath {
    0%, 100% { transform: scale(1, 1) translateY(0); }
    50% { transform: scale(1.02, .98) translateY(2px); }
}

@keyframes klassinBuddyExcitedJump {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-13px) scale(1.08, .94); }
    70% { transform: translateY(4px) scale(.98, 1.04); }
}

@keyframes klassinBuddySparkPop {
    0%, 100% { transform: scale(.9) rotate(-4deg); opacity: .55; }
    50% { transform: scale(1.08) rotate(4deg); opacity: 1; }
}

@keyframes klassinBuddySpeechPop {
    from { opacity: 0; transform: translate(8px, 10px) scale(.96); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}

@media (max-width: 767px) {
    .klassin-buddy {
        width: 76px;
        height: 76px;
    }

    .klassin-buddy-speech {
        right: 16px;
        bottom: 106px;
        width: min(300px, calc(100vw - 32px));
    }

    .klassin-buddy-speech::after {
        right: 38px;
        bottom: -7px;
        transform: rotate(45deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .klassin-buddy .buddy-slime-master,
    .klassin-buddy .buddy-eyes,
    .klassin-buddy .buddy-slime-shadow,
    .klassin-buddy.buddy-exam-alert,
    .klassin-buddy .buddy-mood-art,
    .klassin-buddy-speech {
        animation: none !important;
    }
}

.klassin-buddy-toast {
    width: auto !important;
    min-width: 0 !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
}

.klassin-buddy-toast .swal2-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.klassin-buddy-toast .swal2-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin: 0 6px 0 0 !important;
}

.klassin-buddy-toast .swal2-icon-content {
    font-size: 13px !important;
}

.klassin-buddy-intro-popup {
    width: min(90vw, 420px) !important;
    border-radius: 26px !important;
    padding: 0 !important;
    overflow: hidden;
}

.klassin-buddy-intro-popup .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.klassin-buddy-intro-popup .swal2-actions {
    margin: 10px 0 18px !important;
    padding: 0 !important;
}

.klassin-buddy-intro {
    position: relative;
    text-align: left;
    padding: 14px 14px 8px;
    background: linear-gradient(180deg, #ecfeff 0%, #f8fafc 100%);
}

.klassin-buddy-intro-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(125, 211, 252, .55);
    box-shadow: 0 18px 36px rgba(14, 116, 144, .12);
}

.klassin-buddy-intro-avatar {
    width: 96px;
    height: 96px;
    flex: 0 0 auto;
    filter: drop-shadow(0 14px 20px rgba(14, 116, 144, .2));
}

.klassin-buddy-intro-avatar svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.klassin-buddy-intro-avatar .buddy-eye-dizzy,
.klassin-buddy-intro-avatar .buddy-mouth-happy {
    display: none !important;
}

.klassin-buddy-intro-avatar .buddy-eye-normal,
.klassin-buddy-intro-avatar .buddy-mouth-idle {
    display: block !important;
}

.klassin-buddy-intro-title {
    font-size: 20px;
    line-height: 1.15;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.klassin-buddy-intro-greeting {
    margin-top: 4px;
    color: #0e7490;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
}

.klassin-buddy-intro-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
}

.klassin-buddy-intro-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    color: #334155;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.3;
}

.klassin-buddy-intro-item i {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #0284c7;
    background: #e0f2fe;
    flex: 0 0 auto;
}

@media (max-width: 430px) {
    .klassin-buddy-intro-popup {
        width: min(88vw, 380px) !important;
    }

    .klassin-buddy-intro {
        padding: 12px 12px 7px;
    }

    .klassin-buddy-intro-hero {
        gap: 9px;
        padding: 10px;
    }

    .klassin-buddy-intro-avatar {
        width: 82px;
        height: 82px;
    }

    .klassin-buddy-intro-title {
        font-size: 17px;
    }

    .klassin-buddy-intro-list {
        grid-template-columns: 1fr;
    }
}

.exam-level-watermark {
    position: absolute;
    top: 50%;
    right: 4.5rem;
    z-index: 0;
    transform: translateY(-50%) rotate(-6deg);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    color: rgba(37, 99, 235, 0.16);
}

.exam-subject-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    font: inherit;
    text-align: left;
    appearance: none;
    padding: 0.8rem 0.95rem;
    margin-top: 0.9rem;
    border: 1px solid rgba(125, 211, 252, 0.75);
    border-radius: 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 62%, #ecfeff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.exam-subject-accordion {
    position: relative;
}

.exam-subject-accordion.has-selected .exam-subject-group-header,
.exam-subject-accordion.is-open .exam-subject-group-header {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.exam-subject-group-header:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, 0.7);
}

.exam-subject-group-chevron {
    flex: 0 0 auto;
    color: #0ea5e9;
    transition: transform 220ms ease;
}

.exam-subject-accordion.is-open .exam-subject-group-chevron {
    transform: rotate(180deg);
}

.exam-subject-level-badge {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.8rem;
    min-height: 3.1rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.9rem;
    color: #1d4ed8;
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(37, 99, 235, 0.1);
}

.exam-subject-level-badge span {
    color: #64748b;
    font-size: 0.58rem;
    line-height: 1;
    font-weight: 900;
}

.exam-subject-level-badge strong {
    margin-top: 0.18rem;
    color: #1e3a8a;
    font-size: 1.08rem;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

.exam-subject-exams {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-4px);
    transition: grid-template-rows 260ms ease, opacity 180ms ease, transform 220ms ease;
}

.exam-subject-exams > div {
    overflow: hidden;
}

.exam-subject-accordion.is-open .exam-subject-exams {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
    animation: examSubjectSlideDown 240ms ease;
}

@keyframes examSubjectSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exam-subject-group-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.18rem;
    color: #0284c7;
    font-size: 0.7rem;
    line-height: 1.1;
    font-weight: 900;
}

.exam-subject-group-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.2;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-subject-group-count {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    color: #475569;
    font-size: 0.72rem;
    line-height: 1.1;
    font-weight: 900;
}

.exam-subject-group-done {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #047857;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
}

.exam-set-card-completed {
    background:
        radial-gradient(circle at 96% 10%, rgba(16, 185, 129, 0.14), transparent 34%),
        linear-gradient(135deg, #f0fdf4 0%, #ffffff 58%, #ecfdf5 100%);
}

.exam-completed-corner {
    position: absolute;
    top: 0.85rem;
    right: 3.7rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    color: #059669;
    background: rgba(209, 250, 229, 0.88);
    border: 1px solid rgba(110, 231, 183, 0.9);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.14);
}

@media (max-width: 640px) {
    .exam-level-watermark {
        right: 3.75rem;
        font-size: 3.15rem;
        color: rgba(37, 99, 235, 0.14);
    }

    .exam-subject-group-header {
        gap: 0.55rem;
        padding: 0.72rem 0.8rem;
    }

    .exam-subject-level-badge {
        min-width: 4.15rem;
        min-height: 2.75rem;
        padding: 0.38rem 0.55rem;
        border-radius: 0.8rem;
    }

    .exam-subject-level-badge span {
        font-size: 0.52rem;
    }

    .exam-subject-level-badge strong {
        font-size: 0.94rem;
    }

    .exam-subject-group-title {
        font-size: 0.86rem;
    }

    .exam-completed-corner {
        right: 3.2rem;
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.82rem;
    }
}

@keyframes reportPrinterWork {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.78; }
    45% { transform: translateY(2px) scale(1.02); opacity: 1; }
    70% { transform: translateY(-1px) scale(0.99); opacity: 0.86; }
}

@keyframes reportPaperFly {
    0% { transform: translate(0, 12px) rotate(-8deg); opacity: 0; }
    18% { opacity: 0.85; }
    58% { transform: translate(-18px, -7px) rotate(7deg); opacity: 0.72; }
    100% { transform: translate(-34px, -18px) rotate(13deg); opacity: 0; }
}

@keyframes reportBarPulse {
    0%, 100% { filter: saturate(1); box-shadow: 0 0 0 rgba(14, 165, 233, 0); }
    50% { filter: saturate(1.18); box-shadow: 0 0 12px rgba(14, 165, 233, 0.16); }
}

@keyframes reportDonutFloat {
    0%, 100% { transform: translateY(0) scale(1); filter: saturate(1); }
    48% { transform: translateY(-2px) scale(1.015); filter: saturate(1.12); }
}

@keyframes reportBarSheen {
    0% { transform: translateX(-130%); opacity: 0; }
    28% { opacity: 1; }
    62% { opacity: 1; }
    100% { transform: translateX(130%); opacity: 0; }
}

@keyframes quickReportPaperFly {
    0% { transform: translate(0, 12px) rotate(-10deg); opacity: 0; }
    22% { opacity: 0.95; }
    70% { opacity: 0.65; }
    100% { transform: translate(-16px, -16px) rotate(12deg); opacity: 0; }
}

@media (max-width: 640px) {
    .report-assembly-donut-block {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 0.55rem;
    }

    .report-assembly-donut {
        width: 80px;
        height: 80px;
        padding: 8px;
    }

    .report-assembly-donut-core strong {
        font-size: 1rem;
    }

    .report-assembly-donut-legend {
        gap: 0.32rem;
    }

    .report-assembly-donut-chip {
        min-height: 27px;
        padding: 0.3rem 0.34rem;
        font-size: 0.66rem;
    }

    .report-watermark-printer {
        right: 0.5rem;
        top: 0.7rem;
        font-size: 4rem;
        opacity: 0.65;
    }

    .report-watermark-paper {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1366px) and (pointer: coarse) {
    .report-subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .report-assembly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #000;
}

.scan-live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
}

.scan-side-panel {
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
    border: 1px solid #dbeafe;
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.18), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    overflow: hidden;
}

.scan-side-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(203, 213, 225, 0.8);
}

.scan-side-mode {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 800;
}

.scan-side-photo {
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 1.5rem;
    object-fit: cover;
    background: #e5edf7;
    border: 4px solid #fff;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.16);
}

.scan-side-name {
    font-size: 1.2rem;
    line-height: 1.25;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.scan-side-meta {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
}

.scan-side-status {
    width: 100%;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 0.55rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 900;
}

.scan-side-status.success {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.scan-side-status.warn {
    background: #fef3c7;
    color: #a16207;
    border-color: #fde68a;
}

.scan-side-status.danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.scan-side-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.scan-side-count {
    border-radius: 1rem;
    padding: 0.9rem 0.75rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.scan-side-count span {
    display: block;
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
}

.scan-side-count small {
    display: block;
    margin-top: 0.35rem;
    color: #64748b;
    font-weight: 800;
}

.scan-side-count.checked span { color: #059669; }
.scan-side-count.pending span { color: #ea580c; }

.scan-side-progress {
    height: 0.7rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.scan-side-progress > div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #22c55e);
    transition: width 0.25s ease;
}

.scan-side-room {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: 0.9rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
}

.scan-side-checked-list-wrap {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
}

.scan-side-list-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 900;
}

.scan-side-checked-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 13rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.scan-side-checked-item {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem;
    border-radius: 0.8rem;
    background: #fff;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.scan-side-checked-item img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    object-fit: cover;
    background: #e2e8f0;
}

.scan-side-checked-name {
    display: block;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 900;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scan-side-checked-meta {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    line-height: 1.15;
    font-weight: 700;
    color: #64748b;
}

.scan-side-checked-status {
    border-radius: 999px;
    padding: 0.25rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 900;
    color: #047857;
    background: #d1fae5;
    white-space: nowrap;
}

.scan-side-checked-status.duty {
    color: #7e22ce;
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
}

.scan-side-empty {
    margin: 0;
    padding: 0.9rem 0.5rem;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

@media (min-width: 1024px) {
    #scan-wrapper,
    #assembly-wrapper {
        max-width: 74rem;
    }

    .scan-live-layout {
        grid-template-columns: minmax(0, 1fr) 18rem;
        align-items: stretch;
    }

    #scan-live-layout .video-container,
    #assembly-live-layout .video-container,
    #activity-live-layout .video-container {
        max-width: none;
        height: 100%;
        min-height: 28rem;
    }
}

#scan-wrapper.scan-fullscreen-active,
#assembly-wrapper.scan-fullscreen-active,
#activity-wrapper.scan-fullscreen-active {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
}

.scan-fullscreen-active .scan-live-layout {
    height: 100%;
    min-height: 0;
}

.scan-fullscreen-active #scan-video-wrapper,
.scan-fullscreen-active #assembly-video-wrapper,
.scan-fullscreen-active #activity-video-wrapper {
    max-width: none !important;
    min-height: 0 !important;
}

@media (min-width: 1024px) {
    .scan-fullscreen-active .scan-live-layout {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 18rem);
    }

    .scan-fullscreen-active .scan-side-panel {
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0 !important;
        border-top: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .scan-fullscreen-active #scan-active-topbar,
    .scan-fullscreen-active #assembly-active-topbar,
    .scan-fullscreen-active #activity-active-topbar {
        left: 0 !important;
        right: calc(18rem + 1rem) !important;
        width: min(42rem, calc(100vw - 18rem - 3rem)) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .scan-fullscreen-active #scan-active-bottom-log > div,
    .scan-fullscreen-active #assembly-active-bottom-log > div,
    .scan-fullscreen-active #activity-active-bottom-log > div {
        width: min(42rem, 100%) !important;
        max-width: none !important;
    }
}

@media (max-width: 1023px) {
    .scan-fullscreen-active .scan-live-layout {
        display: block;
    }

    .scan-fullscreen-active .scan-side-panel {
        display: none !important;
    }

    .scan-fullscreen-active #scan-video-wrapper,
    .scan-fullscreen-active #assembly-video-wrapper,
    .scan-fullscreen-active #activity-video-wrapper {
        height: 100dvh !important;
        width: 100vw !important;
    }
}

#ai-loading {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9998 !important;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#ai-loading > .animate-spin {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.9rem;
}

#loading-text {
    max-width: min(28rem, calc(100vw - 2rem));
    text-align: center;
    font-size: clamp(1rem, 4.8vw, 1.35rem);
    line-height: 1.35;
    font-weight: 800;
    color: #0f4c3a;
}

@media (max-width: 640px) {
    #ai-loading {
        align-items: center !important;
        justify-content: center !important;
    }

    #ai-loading > .animate-spin {
        width: 3rem;
        height: 3rem;
        border-width: 3px;
    }

    #loading-text {
        font-size: 1rem;
        padding: 0 1.25rem;
    }
}

video {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* สลับซ้ายขวาให้เหมือนกระจกตอนใช้กล้องหน้า */
}
video.environment {
    transform: scaleX(1); /* กล้องหลังไม่ต้องสลับ */
}
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Custom scrollbar for better mobile look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

/* ==========================================
   ส่วนสำหรับการพิมพ์ (PRINT LAYOUT)
   ========================================== */
@media print {
    /* 0. ซ่อนแถบ Scrollbar ทิ้งเวลาสั่งพิมพ์ */
    ::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
    }
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    /* 1. กำหนดขนาดกระดาษและระยะขอบกระดาษให้สมดุล */
    @page {
        size: A4 portrait;
        margin: 10mm; 
    }

    /* 2. ปลดล็อกความสูง เคลียร์ระยะขอบ และ overflow */
    html, body, main {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        background-color: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. ซ่อนเมนู แถบด้านข้าง และ UI ที่ไม่ต้องการพิมพ์ */
    header, aside, #sidebar, #sidebar-overlay, .no-print, .fixed, .view-section:not(#view-student_card), #fab-menu, #main-fab-btn {
        display: none !important;
    }

    /* 4. ปลด Padding ของกล่องที่ครอบเนื้อหาอยู่ */
    main > div {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        border: none !important;
    }

    /* 5. บังคับให้แสดงผลเฉพาะหน้าบัตรนักเรียน */
    #view-student_card {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* 6. ลบ Padding/Shadow ของกล่องขาวในหน้าบัตร */
    #view-student_card > div {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    /* 7. จัด Layout เป็น Grid 3 คอลัมน์ (เพื่อให้กว้าง 54mm แล้วไม่ล้นหน้า A4) */
    #student-card-grid {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(3, max-content) !important;
        justify-content: center !important;
        gap: 15px !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* 8. กรอบเส้นประและป้องกันไม่ให้บัตรถูกตัดครึ่งระหว่างรอยต่อหน้ากระดาษ */
    .print-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 1.5px dashed #9ca3af !important; 
        box-shadow: none !important;
        background-color: white !important;
        margin: 0 !important;
        /* เอา width: 100% !important ออก เพื่อให้รักษาขนาด 54mm ได้ */
        box-sizing: border-box !important;
    }

    .admin-card-front, .admin-card-qr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* บังคับให้เบราว์เซอร์พิมพ์สีพื้นหลัง */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Animation สำหรับหน้า Login */
.fade-in { animation: fadeIn 0.5s ease-in-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ซ่อนเมนู/ส่วนประกอบตาม Role */
body.role-student .admin-only { display: none !important; }
body:not(.role-student) .student-only { display: none !important; }
body.role-student .student-bulk-attendance-action { display: none !important; }
body.role-teacher .admin-strict { display: none !important; } /* ซ่อนส่วนที่เป็นของ Admin เท่านั้น */

.klassin-buddy-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #ccfbf1;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 14px rgba(15, 118, 110, 0.06);
}

.klassin-buddy-setting-row span {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.klassin-buddy-setting-row i {
    width: 1.1rem;
    margin-top: 0.16rem;
    text-align: center;
    flex-shrink: 0;
}

.klassin-buddy-setting-row b,
.klassin-buddy-setting-row small {
    display: block;
}

.klassin-buddy-setting-row b {
    color: #0f172a;
    font-size: 0.9rem;
    line-height: 1.2;
}

.klassin-buddy-setting-row small {
    color: #64748b;
    margin-top: 0.16rem;
    font-size: 0.76rem;
    line-height: 1.25;
    font-weight: 700;
}

/* Animation สำหรับ Pop-up แจ้งเตือนเวลาสแกน (เพิ่มใหม่) */
@keyframes bounceShort {
    0% { transform: translateY(20px); opacity: 0; }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); opacity: 1; }
}
.animate-bounce-short {
    animation: bounceShort 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ==========================================
   HOME VISIT PHOTO SOURCE POPUP
   ========================================== */
.home-visit-zone-marker-wrap {
    background: transparent;
    border: 0;
}

.home-visit-zone-marker {
    position: relative;
    width: 42px;
    height: 48px;
    filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.24));
}

.home-visit-zone-marker-pin {
    position: absolute;
    left: 5px;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--zone-color, #2563eb);
    border: 3px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--zone-color, #2563eb) 18%, #ffffff), 0 2px 8px rgba(15, 23, 42, 0.18);
}

.home-visit-zone-marker-pin i {
    font-size: 14px;
    transform: rotate(45deg);
}

.home-visit-zone-marker-badge {
    position: absolute;
    right: 0;
    top: 22px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--zone-color, #2563eb);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--zone-border, #93c5fd);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.visit-photo-choice-popup {
    border-radius: 28px !important;
    overflow: hidden !important;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
}
.visit-photo-choice-html {
    margin: 0 !important;
    padding: 0 !important;
}
.visit-photo-choice-close {
    color: #64748b !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 999px !important;
    margin: 14px 14px 0 0 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}
.visit-photo-choice-close:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
.visit-photo-choice {
    text-align: left;
    color: #0f172a;
}
.visit-photo-choice-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 28px 20px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(240, 253, 250, 0.94)),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 38%);
    border-bottom: 1px solid #e2e8f0;
}
.visit-photo-choice-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 25px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.25);
    flex: 0 0 auto;
}
.visit-photo-choice-kicker {
    margin: 0 0 2px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}
.visit-photo-choice h3 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
}
.visit-photo-choice-student {
    margin: 7px 0 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}
.visit-photo-choice-student span {
    color: #64748b;
    font-weight: 600;
}
.visit-photo-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 22px 12px;
}
.visit-photo-choice-card {
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    padding: 18px 14px 16px;
    min-height: 168px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.visit-photo-choice-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.12);
}
.visit-photo-choice-card:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.28);
    outline-offset: 2px;
}
.visit-photo-choice-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}
.visit-photo-choice-camera .visit-photo-choice-card-icon {
    background: #dbeafe;
    color: #2563eb;
}
.visit-photo-choice-upload .visit-photo-choice-card-icon {
    background: #ccfbf1;
    color: #0f766e;
}
.visit-photo-choice-card-title {
    display: block;
    width: 100%;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 800;
    margin-bottom: 7px;
}
.visit-photo-choice-card-desc {
    display: block;
    width: 100%;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
}
.visit-photo-category {
    display: grid;
    gap: 8px;
    margin: 0 22px 16px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}
.visit-photo-category span {
    display: flex;
    align-items: center;
    gap: 7px;
}
.visit-photo-category select {
    width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.visit-photo-category select:focus {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}
.visit-photo-choice-cancel {
    width: calc(100% - 44px);
    margin: 0 22px 22px;
    border: 0;
    border-radius: 14px;
    background: #f8fafc;
    color: #475569;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.visit-photo-choice-cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 520px) {
    .visit-photo-choice-hero {
        padding: 24px 22px 18px;
        gap: 12px;
    }
    .visit-photo-choice-icon {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        font-size: 22px;
    }
    .visit-photo-choice h3 {
        font-size: 20px;
    }
    .visit-photo-choice-grid {
        grid-template-columns: 1fr;
        padding: 16px 18px 10px;
    }
    .visit-photo-choice-card {
        min-height: auto;
        align-items: flex-start;
        text-align: left;
        padding: 15px;
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr);
        column-gap: 12px;
    }
    .visit-photo-choice-card-icon {
        width: 46px;
        height: 46px;
        margin: 0;
        grid-row: span 2;
    }
    .visit-photo-choice-card-title {
        margin-bottom: 4px;
    }
    .visit-photo-category {
        margin: 0 18px 14px;
    }
    .visit-photo-choice-cancel {
        width: calc(100% - 36px);
        margin: 0 18px 18px;
    }
}

.home-visit-gallery-popup {
    border-radius: 24px !important;
}
.home-visit-gallery-html {
    margin: 0 !important;
}

.home-visit-print-scope-popup {
    width: min(94vw, 560px) !important;
    padding: 18px !important;
}
.home-visit-print-scope-html {
    margin: 0 !important;
    padding: 0 !important;
}
.home-visit-print-scope-close {
    top: 10px !important;
    right: 12px !important;
}

@media (max-width: 640px) {
    .home-visit-print-scope-popup {
        width: calc(100vw - 18px) !important;
        padding: 14px !important;
        border-radius: 24px !important;
    }
    .home-visit-print-scope-html {
        margin: 0 !important;
    }
    .home-visit-print-scope-close {
        top: 8px !important;
        right: 10px !important;
    }
    .hv-print-scope-heading {
        margin-bottom: 14px !important;
        padding-right: 30px;
    }
    .hv-print-scope-summary {
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
        gap: 10px !important;
    }
    .hv-print-scope-summary-icon,
    .hv-print-scope-card-icon {
        width: 38px !important;
        height: 38px !important;
        border-radius: 14px !important;
    }
    .hv-print-scope-card {
        padding: 14px !important;
        border-radius: 18px !important;
    }
    .hv-print-scope-card-icon {
        margin-bottom: 10px !important;
    }
    .hv-print-scope-cancel {
        margin-top: 12px !important;
        padding-top: 11px !important;
        padding-bottom: 11px !important;
    }
}

.home-visit-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding: 8px 4px 2px;
}
.home-visit-gallery-card {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.home-visit-gallery-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}
.home-visit-gallery-preview {
    appearance: none;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}
.home-visit-gallery-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f1f5f9;
}
.home-visit-gallery-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(254, 202, 202, 0.95);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(127, 29, 29, 0.18);
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.home-visit-gallery-delete:hover {
    transform: scale(1.06);
    color: #ffffff;
    background: #dc2626;
}
.home-visit-gallery-meta {
    display: grid;
    gap: 3px;
    padding: 10px 12px 12px;
}
.home-visit-gallery-meta b {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
}
.home-visit-gallery-meta small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.home-visit-table-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.home-visit-search-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}
.home-visit-search-wrap.hidden {
    display: none !important;
}
.home-visit-search-box {
    min-width: 0;
    min-height: 48px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    color: #0f766e;
}
.home-visit-search-box input {
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}
.home-visit-search-box input::placeholder {
    color: #94a3b8;
    font-weight: 600;
}
.home-visit-search-box input::-webkit-search-cancel-button,
.home-visit-search-box input::-webkit-search-decoration,
.home-visit-search-box input::-webkit-search-results-button,
.home-visit-search-box input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
.home-visit-search-box button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
}
.home-visit-search-box button:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.home-visit-search-box button.hidden { display: none; }
.home-visit-search-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1120px) {
    .home-visit-table-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 767px) {
    .home-visit-table-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }
    .home-visit-search-wrap {
        position: static;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .home-visit-search-box {
        min-height: 48px;
        box-shadow: none;
        border-color: #cbdedb;
        border-radius: 6px;
        background: #fff;
    }
    .home-visit-search-meta {
        text-align: left;
        font-size: 11px;
    }
    .home-visit-search-box input {
        font-size: 16px;
    }
}

@media screen {
    #view-home_visit .home-visit-page { min-height: 0; padding: 18px; border-radius: 0; box-shadow: none; background: #fff; }
    #view-home_visit .home-visit-page-heading { margin-bottom: 16px; padding-bottom: 12px; }
    #view-home_visit .home-visit-page-heading h2 { font-size: 20px; line-height: 1.5; }
    #view-home_visit .home-visit-filters { display: grid; grid-template-columns: repeat(2,minmax(0,220px)); gap: 12px; margin-bottom: 12px; }
    #view-home_visit .home-visit-filter { display: grid; gap: 5px; min-width: 0; color: #48615b; font-size: 12px; font-weight: 600; }
    #view-home_visit .home-visit-filter select { width: 100%; min-width: 0; min-height: 44px; border-color: #cbdedb; border-radius: 6px; background: #fff; font-size: 14px; }
    #view-home_visit :is(#visit-level-select, #visit-room-select) { min-height: 44px; }
    #view-home_visit #home-visit-action-buttons { max-width: 452px; margin-bottom: 16px; gap: 10px; }
    #view-home_visit #home-visit-action-buttons button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 700; }
    #view-home_visit .home-visit-export-button { background: #087f5b; }
    #view-home_visit .home-visit-export-button:hover { background: #06694b; }
    #view-home_visit .home-visit-print-button { background: #0865a9; }
    #view-home_visit .home-visit-print-button:hover { background: #07558f; }
    #view-home_visit #home-visit-action-buttons button:focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; }
    #view-home_visit .home-visit-map-frame { height: clamp(360px,52dvh,620px); min-height: 360px; border: 1px solid #d4e1de; border-radius: 8px; }
    #view-home_visit .home-visit-map-note { margin-top: 8px; text-align: left; line-height: 1.5; }
    #view-home_visit #home-visit-groups-container { margin-top: 18px; padding-top: 16px; }
    #view-home_visit .home-visit-table-header h3 { font-size: 16px; line-height: 1.5; }
    #view-home_visit .home-visit-group-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
    #view-home_visit .home-visit-group-heading > span { color: #617571; font-size: 11px; white-space: nowrap; }
    #view-home_visit .home-visit-search-box { border-radius: 6px; box-shadow: none; }
    #view-home_visit .home-visit-search-box:focus-within { border-color: #0c8d75; outline: 2px solid #b6e6d8; outline-offset: 1px; }
    @media (max-width: 767px) {
        body.klassin-ui[data-klassin-view="home_visit"] #app-scroll-main { background: #fff; }
        body.klassin-ui[data-klassin-view="home_visit"] #klassin-buddy-dock { display: none !important; }
        #view-home_visit .home-visit-page { padding: 0; background: transparent; }
        #view-home_visit #home-visit-groups-container table { background: transparent; }
        #view-home_visit .home-visit-page-heading { margin-bottom: 12px; padding-bottom: 10px; }
        #view-home_visit .home-visit-page-heading h2 { font-size: 18px; }
        #view-home_visit .home-visit-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
        #view-home_visit .home-visit-filter select { font-size: 16px; padding: 8px; }
        #view-home_visit #home-visit-action-buttons { max-width: none; margin-bottom: 12px; }
        #view-home_visit #home-visit-action-buttons button { font-size: 13px; padding: 9px 8px; }
        #view-home_visit .home-visit-map-frame { height: clamp(240px,34dvh,320px); min-height: 240px; }
        #view-home_visit .home-visit-table-header { gap: 10px; }
        #view-home_visit .home-visit-table-header h3 { font-size: 15px; }
    }
}

/* ==========================================
   MODERN TOP-CENTER LOGIN LOADER (RESPONSIVE BACKGROUND)
   ========================================== */
.cyber-loader-container {
    position: fixed;
    inset: 0;
    z-index: 999999;
    /* ค่าเริ่มต้นสำหรับหน้าจอมือถือ/แนวตั้ง: ใช้ภาพ klassin.png */
    background: url('klassin.png') no-repeat center center / cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    padding-top: 40px; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/* เมื่อเปิดบนคอมพิวเตอร์ / หน้าจอแนวนอนขนาดกว้าง (Desktop 1024px ขึ้นไป) */
@media (min-width: 1024px) {
    .cyber-loader-container {
        /* เปลี่ยนเป็นภาพแนวตั้ง/แนวนอนอัตราส่วน 16:9 คมชัดสวยงามตามต้องการ */
        background: url('klassinH.png') no-repeat center center / cover;
    }
}

.cyber-loader-container.active {
    opacity: 1;
    visibility: visible;
}

/* กล่อง Loading ด้านบนตรงกลาง สไตล์มินิมอลโปร่งแสงเพื่อให้เห็นพื้นหลังชัด */
.cyber-loading-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 18px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    gap: 20px;
    max-width: 90%;
    width: 480px;
}

/* โลโก้อยู่ฝั่งซ้าย */
.cyber-logo-left {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    flex-shrink: 0;
}

/* ส่วนข้อมูลฝั่งขวา (ข้อความ + แถบโหลดด้านล่าง) */
.cyber-content-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ข้อความ ยินดีต้อนรับเข้าสู่ Klassin.cc */
.cyber-text {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin: 0;
}

/* รางแถบเลื่อน Loading ด้านใต้ข้อความ */
.cyber-progress-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(226, 232, 240, 0.8); 
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* ตัวแถบวิ่งจากซ้ายไปขวา ใช้เวลาปรับเป็น 5 วินาที */
.cyber-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 4px;
}

/* สั่งให้แอนิเมชันทำงานเมื่อคลาส active แสดงผล (3s) */
.cyber-loader-container.active .cyber-progress-bar {
    animation: slideProgress 3s linear forwards;
}

/* --- Keyframes สำหรับแถบวิ่งจากซ้ายไปขวา --- */
@keyframes slideProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}
/* Randomizer winner effects */
.randomizer-ready-avatar {
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
    background: #e5e7eb;
    border: 8px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 3.75rem;
    margin: 0 auto 1rem;
    box-shadow: inset 0 10px 30px rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) {
    .randomizer-ready-avatar {
        width: 14rem;
        height: 14rem;
        font-size: 4.5rem;
        margin-bottom: 1.5rem;
    }
}

#random-display.randomizer-shuffling {
    background: radial-gradient(circle at 50% 30%, #fff7ed 0%, #fdf2f8 46%, #ffffff 100%);
    overflow: hidden;
}

#random-display.randomizer-shuffling::before,
#random-display.randomizer-winner-active::before {
    content: '';
    position: absolute;
    inset: -45%;
    background: conic-gradient(from 0deg, transparent, rgba(236, 72, 153, 0.18), transparent, rgba(245, 158, 11, 0.16), transparent);
    animation: randomizerSpin 1.5s linear infinite;
    pointer-events: none;
}

.randomizer-shuffle-frame,
.randomizer-winner-card {
    position: relative;
    z-index: 1;
}

.randomizer-shuffle-frame {
    animation: randomizerFlipIn 0.18s ease-out both;
}

.randomizer-shuffle-photo {
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
    border: 8px solid rgba(236, 72, 153, 0.25);
    box-shadow: 0 18px 45px rgba(236, 72, 153, 0.18);
    margin: 0 auto 1rem;
}

@media (min-width: 768px) {
    .randomizer-shuffle-photo {
        width: 14rem;
        height: 14rem;
        margin-bottom: 1.5rem;
    }
}

#random-display.randomizer-winner-active {
    background: radial-gradient(circle at 50% 20%, #fef3c7 0%, #fce7f3 42%, #ffffff 100%);
    overflow: hidden;
}

.randomizer-winner-card {
    width: min(100%, 32rem);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.8rem);
    animation: randomizerWinnerPop 0.72s cubic-bezier(0.2, 1.35, 0.32, 1) both;
}

.randomizer-winner-card-large {
    width: 100%;
    padding: 0.15rem 0.15rem 0;
}

.randomizer-winner-photo,
.randomizer-winner-photo-large {
    border-radius: 9999px;
    border: 10px solid #ffffff;
    outline: 6px solid #ec4899;
    box-shadow: 0 24px 70px rgba(236, 72, 153, 0.32), 0 0 0 14px rgba(245, 158, 11, 0.14);
    background: #fff;
}

.randomizer-winner-photo {
    width: clamp(8rem, 46vw, 16rem);
    height: clamp(8rem, 46vw, 16rem);
}

.randomizer-winner-photo-large {
    width: clamp(9rem, 48vw, 18rem);
    height: clamp(9rem, 48vw, 18rem);
}

.randomizer-winner-badge {
    position: absolute;
    top: -0.45rem;
    right: calc(50% - 8.7rem);
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    box-shadow: 0 12px 26px rgba(236, 72, 153, 0.25);
    animation: randomizerBadgePulse 1.1s ease-in-out infinite;
}

.randomizer-winner-copy {
    text-align: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.randomizer-winner-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.85rem;
    margin-bottom: 0.45rem;
    border-radius: 9999px;
    color: #be185d;
    background: #fce7f3;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.randomizer-winner-popup {
    border-radius: 1.5rem !important;
    max-width: calc(100vw - 1rem) !important;
    overflow: visible;
}

.randomizer-winner-html {
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.randomizer-winner-name {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    letter-spacing: 0;
}

.randomizer-winner-name-normal {
    font-size: clamp(1.55rem, 6.2vw, 2.25rem);
}

.randomizer-winner-name-large {
    font-size: clamp(1.6rem, 6.6vw, 3rem);
}

.randomizer-winner-meta {
    font-size: clamp(0.85rem, 3.4vw, 1.125rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .randomizer-winner-card {
        gap: 0.45rem;
    }

    .randomizer-winner-photo,
    .randomizer-winner-photo-large {
        border-width: 6px;
        outline-width: 4px;
        box-shadow: 0 14px 36px rgba(236, 72, 153, 0.26), 0 0 0 8px rgba(245, 158, 11, 0.12);
    }

    .randomizer-winner-badge {
        top: -0.25rem;
        right: calc(50% - 5.4rem);
        width: 2.45rem;
        height: 2.45rem;
        font-size: 0.9rem;
    }

    .randomizer-winner-label {
        font-size: 0.72rem;
        margin-bottom: 0.25rem;
    }
}

.randomizer-confetti-layer {
    position: fixed;
    left: 50%;
    top: 54%;
    width: 1px;
    height: 1px;
    pointer-events: none;
    z-index: 1000000;
}

.randomizer-confetti-layer span {
    position: absolute;
    width: 10px;
    height: 16px;
    border-radius: 3px;
    background: var(--c);
    animation: randomizerConfetti 1.35s ease-out forwards;
}

@keyframes randomizerSpin {
    to { transform: rotate(360deg); }
}

@keyframes randomizerFlipIn {
    from { opacity: 0.2; transform: scale(0.88) rotate(-2deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes randomizerWinnerPop {
    0% { opacity: 0; transform: translateY(16px) scale(0.62); filter: blur(6px); }
    55% { opacity: 1; transform: translateY(-8px) scale(1.07); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes randomizerBadgePulse {
    0%, 100% { transform: scale(1) rotate(-8deg); }
    50% { transform: scale(1.14) rotate(8deg); }
}

@keyframes randomizerConfetti {
    0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
    100% { opacity: 0; transform: translate3d(var(--x), var(--y), 0) rotate(var(--r)); }
}
/* App drawer menu inspired by the provided mobile reference */
#sidebar.app-sidebar {
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: 22px 0 48px rgba(15, 23, 42, 0.18);
}

.sidebar-brand-panel {
    position: relative;
    padding: 26px 22px 16px;
    background: #ffffff;
}

.sidebar-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #64748b;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-close-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.sidebar-compact-toggle-row {
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px 8px;
    background: #ffffff;
}

.sidebar-mode-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #64748b;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-mode-toggle:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.sidebar-logo-lockup {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-top: 2px;
    text-align: left;
}

.sidebar-logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.sidebar-logo-lockup h1 {
    margin: 0;
    color: #1f2937;
    font-size: 31px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.sidebar-logo-lockup p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-title-brand {
    color: inherit;
    min-width: 0;
}

#page-title {
    color: #0ea5e9;
}

.dashboard-title-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
}

.dashboard-title-name {
    color: #0ea5e9;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.dashboard-title-subtitle {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: uppercase;
    opacity: 1;
}

@media (max-width: 639px) {
    .dashboard-title-brand {
        gap: 6px !important;
    }

    .dashboard-title-subtitle {
        margin-top: 2px;
        font-size: 0.5rem;
    }
}

.advisory-dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.advisory-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.advisory-dashboard-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0;
}

.advisory-dashboard-subtitle {
    margin-top: 6px;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.advisory-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.advisory-room-select {
    min-width: 180px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 10px 14px;
    color: #0f172a;
    background: #ffffff;
    font-weight: 900;
    outline: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.advisory-room-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.advisory-line-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 11px 14px;
    background: #06c755;
    color: #ffffff;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(6, 199, 85, 0.24);
    cursor: pointer;
}

.advisory-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.advisory-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.advisory-kpi-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex: 0 0 auto;
    font-size: 1rem;
}

.advisory-kpi-card p {
    margin: 0 0 2px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
}

.advisory-kpi-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 900;
}

.advisory-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.35fr);
    gap: 14px;
    align-items: start;
}

.advisory-panel {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.advisory-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #eef2f7;
}

.advisory-panel-head h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.advisory-panel-head p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 800;
}

.advisory-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.advisory-mini-chart {
    min-width: 0;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    background: #f8fafc;
    padding: 10px;
}

.advisory-mini-chart-title {
    margin-bottom: 6px;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.advisory-chart-wrap {
    position: relative;
    height: 170px;
}

.advisory-status-legend,
.advisory-risk-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.advisory-legend-chip,
.advisory-risk-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

.advisory-legend-chip b {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.advisory-risk-pill.danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.advisory-risk-pill.neutral {
    background: #f8fafc;
    color: #475569;
}

.advisory-risk-table-wrap {
    max-height: min(48vh, 520px);
    overflow: auto;
}

.advisory-risk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.advisory-risk-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.advisory-risk-table th {
    padding: 10px 12px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.advisory-risk-row td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.advisory-risk-row.risk-danger {
    background: #fffafa;
}

.advisory-risk-row.risk-profile {
    background: #ffffff;
}

.advisory-student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.advisory-risk-photo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
    background: #e2e8f0;
    cursor: pointer;
    flex: 0 0 auto;
}

.advisory-risk-name {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advisory-risk-meta {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}

.advisory-count-cell {
    text-align: center;
    white-space: nowrap;
}

.advisory-count-cell strong {
    font-size: 1.05rem;
    font-weight: 900;
}

.advisory-count-cell span {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
}

.advisory-count-cell small {
    display: block;
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 900;
}

.advisory-reason-cell {
    min-width: 150px;
}

.advisory-reason {
    display: inline-flex;
    margin: 2px;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 900;
    white-space: nowrap;
}

.advisory-reason.danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.advisory-reason.warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.advisory-action-cell {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.advisory-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    padding: 7px 9px;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.advisory-icon-btn.line {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #059669;
}

.advisory-empty-cell {
    padding: 32px 12px !important;
    text-align: center;
    color: #94a3b8;
    font-weight: 900;
}

.advisory-empty-cell.success {
    color: #059669;
    background: #f0fdf4;
}

.advisory-empty-cell.success i {
    display: block;
    margin-bottom: 8px;
    font-size: 1.7rem;
}

.parent-report-popup {
    padding: 16px !important;
}

.parent-report-html {
    margin: 0 !important;
    padding: 0 !important;
}

.parent-report-close {
    top: 8px !important;
    right: 10px !important;
}

.parent-report-quick {
    text-align: left;
}

.parent-report-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 32px;
    margin-bottom: 12px;
}

.parent-report-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #ecfdf5;
    color: #06c755;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.parent-report-head h3 {
    margin: 0;
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 900;
}

.parent-report-head p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 800;
}

.parent-report-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.parent-report-option {
    appearance: none;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 12px 8px;
    color: #334155;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.parent-report-option i,
.parent-report-option span,
.parent-report-option small {
    display: block;
    text-align: center;
}

.parent-report-option i {
    font-size: 1.15rem;
    margin-bottom: 7px;
}

.parent-report-option span {
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.1;
}

.parent-report-option small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 800;
}

.parent-report-option.today {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.parent-report-option.week {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #ea580c;
}

.parent-report-option.all {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #059669;
}

.parent-report-cancel {
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 14px;
    padding: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 900;
    cursor: pointer;
}

.parent-line-modal {
    max-width: 430px;
}

.parent-line-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #ecfdf5;
}

.parent-line-modal-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #ecfdf5;
    color: #06c755;
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.parent-line-modal-head h3 {
    margin: 0;
    color: #334155;
    font-size: 1.08rem;
    line-height: 1.15;
    font-weight: 900;
}

.parent-line-modal-head p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parent-line-modal-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.parent-line-modal-body {
    padding: 14px 16px 16px;
}

.parent-line-modal-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.parent-line-modal-option {
    appearance: none;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 12px 8px;
    color: #334155;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.parent-line-modal-option i,
.parent-line-modal-option span,
.parent-line-modal-option small {
    display: block;
    text-align: center;
}

.parent-line-modal-option i {
    font-size: 1.12rem;
    margin-bottom: 7px;
}

.parent-line-modal-option span {
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.12;
}

.parent-line-modal-option small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.15;
}

.parent-line-modal-option.today {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #059669;
}

.parent-line-modal-option.assembly {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.parent-line-modal-option.subject {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #ea580c;
}

.parent-line-modal-cancel {
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 14px;
    padding: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 900;
    cursor: pointer;
}

.parent-line-modal-note {
    margin: 9px 0 0;
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 420px) {
    .parent-line-modal-head {
        padding: 14px 14px 10px;
        gap: 10px;
    }
    .parent-line-modal-icon {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
    .parent-line-modal-body {
        padding: 12px 12px 14px;
    }
    .parent-line-modal-options {
        gap: 7px;
    }
    .parent-line-modal-option {
        padding: 10px 5px;
        border-radius: 14px;
    }
    .parent-line-modal-option span {
        font-size: 0.72rem;
    }
    .parent-line-modal-option small {
        font-size: 0.54rem;
    }
}

@media (max-width: 900px) {
    .advisory-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .advisory-dashboard-shell {
        gap: 10px;
    }
    .advisory-dashboard-hero {
        padding: 13px;
        border-radius: 18px;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }
    .advisory-dashboard-title {
        font-size: 1.35rem;
    }
    .advisory-dashboard-subtitle {
        font-size: 0.76rem;
        line-height: 1.35;
    }
    .advisory-dashboard-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }
    .advisory-room-select {
        min-width: 0;
        width: 100%;
        padding: 9px 10px;
        border-radius: 12px;
        font-size: 0.82rem;
    }
    .advisory-line-button {
        width: 44px;
        height: 42px;
        padding: 0;
        border-radius: 12px;
    }
    .advisory-line-button span {
        display: none;
    }
    .advisory-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .advisory-kpi-card {
        padding: 10px;
        gap: 8px;
        border-radius: 15px;
    }
    .advisory-kpi-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        font-size: 0.88rem;
    }
    .advisory-kpi-card p {
        font-size: 0.64rem;
    }
    .advisory-kpi-card strong {
        font-size: 1.18rem;
    }
    .advisory-panel {
        border-radius: 18px;
    }
    .advisory-panel-head {
        padding: 12px 12px 8px;
        gap: 8px;
        flex-direction: column;
    }
    .advisory-panel-head h3 {
        font-size: 0.9rem;
    }
    .advisory-panel-head p {
        font-size: 0.68rem;
    }
    .advisory-status-legend,
    .advisory-risk-summary {
        justify-content: flex-start;
    }
    .advisory-chart-grid {
        padding: 9px;
        gap: 8px;
    }
    .advisory-mini-chart {
        padding: 8px;
        border-radius: 15px;
    }
    .advisory-mini-chart-title {
        font-size: 0.68rem;
        margin-bottom: 4px;
    }
    .advisory-chart-wrap {
        height: 126px;
    }
    .advisory-risk-table-wrap {
        max-height: 44vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .advisory-risk-table,
    .advisory-risk-table tbody {
        display: block;
        width: 100%;
    }
    .advisory-risk-table thead {
        display: none;
    }
    .advisory-risk-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "student student student action"
            "asm asm sub sub"
            "reason reason reason reason";
        gap: 8px 6px;
        margin: 8px;
        padding: 10px 9px;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    }
    .advisory-risk-row.risk-danger {
        border-color: #fecdd3;
    }
    .advisory-risk-row.risk-profile {
        border-color: #e2e8f0;
    }
    .advisory-risk-row td {
        padding: 0;
        border: 0;
    }
    .advisory-student-cell {
        grid-area: student;
        gap: 8px;
        min-width: 0;
        overflow: hidden;
    }
    .advisory-risk-photo {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
    .advisory-risk-name {
        max-width: none;
        font-size: 0.82rem;
    }
    .advisory-risk-meta {
        font-size: 0.62rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .advisory-risk-row .advisory-count-cell:nth-of-type(2) {
        grid-area: asm;
        width: 100%;
    }
    .advisory-risk-row .advisory-count-cell:nth-of-type(3) {
        grid-area: sub;
        width: 100%;
    }
    .advisory-count-cell {
        min-width: 0;
        width: 100%;
        padding: 5px 7px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px;
        background: rgba(248, 250, 252, 0.82);
    }
    .advisory-risk-row .advisory-count-cell:nth-of-type(2)::before,
    .advisory-risk-row .advisory-count-cell:nth-of-type(3)::before {
        display: block;
        margin-bottom: 2px;
        color: #94a3b8;
        font-size: 0.56rem;
        font-weight: 900;
    }
    .advisory-risk-row .advisory-count-cell:nth-of-type(2)::before {
        content: "เสาธง";
    }
    .advisory-risk-row .advisory-count-cell:nth-of-type(3)::before {
        content: "รายวิชา";
    }
    .advisory-count-cell strong {
        font-size: 0.98rem;
    }
    .advisory-count-cell span,
    .advisory-count-cell small {
        font-size: 0.58rem;
    }
    .advisory-reason-cell {
        grid-area: reason;
        min-width: 0;
        align-self: center;
        text-align: left;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    .advisory-reason {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 4px 6px;
        font-size: 0.58rem;
    }
    .advisory-action-cell {
        grid-area: action;
        align-self: start;
        justify-content: flex-end;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, 32px);
        gap: 6px;
    }
    .advisory-icon-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 10px;
        font-size: 0.78rem;
        box-sizing: border-box;
    }
    .advisory-icon-btn span {
        display: none;
    }
    .advisory-empty-cell {
        display: block;
        padding: 28px 10px !important;
    }
}

.topbar-clock-card {
    position: relative;
    min-width: 188px;
    min-height: 54px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 34px 8px 16px;
    margin-left: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.topbar-clock-mobile-icon {
    display: none;
    color: #0ea5e9;
    font-size: 1.1rem;
}

.topbar-clock-card:hover {
    border-color: #93c5fd;
    background: #ffffff;
    transform: translateY(-1px);
}

.topbar-clock-time {
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.topbar-clock-date {
    color: #475569;
    font-size: 0.72rem;
    line-height: 1.15;
    font-weight: 650;
    white-space: nowrap;
}

.topbar-clock-expand {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #0ea5e9;
    font-size: 0.9rem;
}

@media (max-width: 639px) {
    .topbar-clock-card {
        min-width: 44px;
        width: 44px;
        min-height: 44px;
        height: 44px;
        border-radius: 999px;
        padding: 0;
        flex: 0 0 44px;
    }

    .topbar-clock-mobile-icon {
        display: inline-flex;
    }

    .topbar-clock-time,
    .topbar-clock-date,
    .topbar-clock-expand {
        display: none;
    }
}

.clock-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2fe 0%, #f8fafc 48%, #dbeafe 100%);
    color: #0f172a;
}

.clock-fullscreen-modal.clock-timer-warning {
    animation: clockQuake 0.18s linear infinite;
}

.clock-fullscreen-modal.clock-timer-finished {
    animation: clockQuake 0.12s linear infinite;
}

.clock-fullscreen-modal.hidden {
    display: none;
}

.clock-weather-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 100%);
    transition: background 1.5s ease;
}

.clock-weather-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.clock-fullscreen-content {
    position: relative;
    z-index: 2;
    width: min(860px, calc(100vw - 40px));
    min-height: 360px;
    max-height: calc(100dvh - 40px);
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.54);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 28px;
}

.clock-fullscreen-time {
    color: #0f172a;
    font-size: clamp(4rem, 14vw, 9.5rem);
    line-height: 0.92;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.clock-fullscreen-date {
    margin-top: 18px;
    color: #334155;
    font-size: clamp(1rem, 3vw, 1.65rem);
    line-height: 1.2;
    font-weight: 650;
}

.clock-weather-panel {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 10px 16px;
    color: #334155;
    font-weight: 800;
}

.clock-weather-panel i {
    color: #0ea5e9;
    font-size: 1.1rem;
}

#clock-weather-location {
    color: #64748b;
    font-size: 0.82rem;
    max-width: min(52vw, 360px);
    overflow-wrap: anywhere;
}

.clock-fullscreen-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.85);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.clock-fullscreen-close:hover {
    background: #ffffff;
    transform: rotate(90deg);
}

.clock-control-toggle {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    z-index: 10030;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(15, 23, 42, 0.72);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(226, 232, 240, 0.78);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
    opacity: 0.78;
    transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.clock-control-toggle i {
    font-size: 1rem;
}

.clock-control-toggle:hover,
.clock-control-toggle.is-open {
    background: rgba(255, 255, 255, 0.88);
    opacity: 1;
    transform: rotate(18deg) scale(1.02);
}

.clock-control-panel {
    position: fixed;
    top: max(78px, calc(env(safe-area-inset-top) + 78px));
    left: max(18px, env(safe-area-inset-left));
    z-index: 10029;
    width: min(360px, calc(100vw - 36px));
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(15, 23, 42, 0.58);
    color: #f8fafc;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 16px;
    max-height: calc(100dvh - max(96px, calc(env(safe-area-inset-top) + 96px)) - 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.clock-control-panel.hidden {
    display: none;
}

.clock-control-section + .clock-control-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.clock-control-title {
    font-size: 0.85rem;
    line-height: 1.2;
    font-weight: 800;
    color: rgba(248, 250, 252, 0.82);
    margin-bottom: 10px;
}

.clock-weather-choices {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.clock-weather-choice {
    min-height: 62px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.15;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.clock-weather-choice i {
    font-size: 1.1rem;
    color: #67e8f9;
}

.clock-weather-choice:hover,
.clock-weather-choice.is-active {
    transform: translateY(-1px);
    background: rgba(14, 165, 233, 0.32);
    border-color: rgba(125, 211, 252, 0.72);
}

.clock-timer-form {
    display: grid;
    grid-template-columns: auto minmax(58px, 1fr) auto minmax(58px, 1fr);
    align-items: center;
    gap: 8px;
}

.clock-timer-form label {
    color: rgba(248, 250, 252, 0.8);
    font-size: 0.82rem;
    font-weight: 750;
}

.clock-timer-form input {
    min-width: 0;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 0 10px;
    font-weight: 800;
    outline: none;
}

.clock-timer-start,
.clock-timer-stop {
    height: 40px;
    border-radius: 12px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.clock-timer-start {
    grid-column: 1 / 3;
}

.clock-timer-stop {
    grid-column: 3 / 5;
}

.clock-timer-start {
    color: #022c22;
    background: #5eead4;
}

.clock-timer-stop {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.clock-timer-panel-status {
    margin-top: 10px;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.8rem;
    font-weight: 650;
}

.clock-preset-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.clock-preset-item {
    position: relative;
    min-width: 0;
}

.clock-preset-button,
.clock-tool-grid button {
    min-width: 0;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.clock-preset-button {
    position: relative;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
}

.clock-preset-button i,
.clock-tool-grid button i {
    color: #67e8f9;
}

.clock-preset-button b {
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.clock-preset-button:hover,
.clock-tool-grid button:hover {
    transform: translateY(-1px);
    background: rgba(14, 165, 233, 0.28);
    border-color: rgba(125, 211, 252, 0.58);
}

.clock-preset-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 113, 113, 0.9);
    color: #ffffff;
    border: 1px solid rgba(254, 202, 202, 0.5);
    font-size: 0.72rem;
}

.clock-announcement-form {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.clock-announcement-form {
    grid-template-columns: 1fr auto auto;
}

.clock-announcement-form input,
.clock-sound-select {
    min-width: 0;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 750;
    outline: none;
}

.clock-sound-select {
    width: 100%;
    color: #f8fafc;
}

.clock-sound-select option {
    color: #0f172a;
}

.clock-announcement-form button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(94, 234, 212, 0.9);
    color: #022c22;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clock-announcement-form button:last-child {
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.clock-tool-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.clock-random-room-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
}

.clock-random-room-row label {
    color: rgba(248, 250, 252, 0.82);
    font-size: 0.78rem;
    font-weight: 800;
}

.clock-random-room-row select {
    min-width: 0;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 0 10px;
    font-size: 0.82rem;
    font-weight: 800;
    outline: none;
}

.clock-random-room-row option {
    color: #0f172a;
}

.clock-timer-display {
    margin-top: 16px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.24);
    color: #0f172a;
    padding: 8px 16px;
    font-size: clamp(1rem, 2.4vw, 1.7rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.clock-fullscreen-modal.clock-timer-active .clock-fullscreen-time,
.clock-fullscreen-modal.clock-timer-active .clock-fullscreen-date {
    display: none;
}

.clock-fullscreen-modal.clock-timer-active .clock-timer-display {
    margin-top: 0;
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    padding: 18px 34px;
    font-size: clamp(4rem, 13vw, 9rem);
    line-height: 1;
    font-weight: 650;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.clock-timer-display.hidden,
.clock-timeup-display.hidden {
    display: none;
}

.clock-timeup-display {
    margin-top: 16px;
    color: #fee2e2;
    background: rgba(220, 38, 38, 0.74);
    border: 1px solid rgba(254, 202, 202, 0.4);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1;
    font-weight: 850;
    box-shadow: 0 0 40px rgba(248, 113, 113, 0.42);
    animation: clockTimeupPulse 0.65s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.clock-timeup-display:hover {
    background: rgba(185, 28, 28, 0.84);
    box-shadow: 0 0 46px rgba(248, 113, 113, 0.58);
}

.clock-announcement-display {
    margin-bottom: 18px;
    max-width: min(760px, 88vw);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(125, 211, 252, 0.42);
    color: #0f172a;
    padding: 10px 22px;
    font-size: clamp(1rem, 2.4vw, 1.55rem);
    line-height: 1.25;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.clock-classroom-layer {
    width: min(760px, 92vw);
    margin-top: 22px;
}

.clock-announcement-display.hidden,
.clock-classroom-layer.hidden {
    display: none;
}

.clock-random-card,
.clock-breathing-card,
.clock-team-card {
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.32);
    color: #f8fafc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    padding: 22px;
}

.clock-random-card {
    position: relative;
    overflow: hidden;
}

.clock-random-card::before {
    content: "";
    position: absolute;
    inset: -45%;
    background:
        radial-gradient(circle at 20% 20%, rgba(103, 232, 249, 0.24), transparent 28%),
        radial-gradient(circle at 78% 30%, rgba(250, 204, 21, 0.18), transparent 24%),
        conic-gradient(from 90deg, transparent, rgba(14, 165, 233, 0.22), transparent, rgba(94, 234, 212, 0.18), transparent);
    opacity: 0.65;
    animation: clockRandomSweep 4s linear infinite;
}

.clock-random-card > * {
    position: relative;
    z-index: 1;
}

.clock-random-kicker {
    color: #67e8f9;
    font-size: 0.9rem;
    font-weight: 850;
    letter-spacing: 0;
}

.clock-random-stage {
    margin: 14px auto 12px;
    width: clamp(150px, 22vw, 210px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.clock-random-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.clock-random-photo {
    width: 78%;
    height: 78%;
    border-radius: 34px;
    object-fit: cover;
    background: #e2e8f0;
    border: 5px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.35);
    transform: rotate(-1deg);
}

.clock-random-orbit {
    position: absolute;
    inset: 0;
    border-radius: 34px;
    border: 2px dashed rgba(103, 232, 249, 0.75);
    animation: clockRandomOrbit 2.8s linear infinite;
}

.clock-random-orbit.orbit-b {
    inset: 13px;
    border-color: rgba(250, 204, 21, 0.65);
    animation-direction: reverse;
    animation-duration: 2s;
}

.clock-random-name {
    margin-top: 4px;
    font-size: clamp(2rem, 6.4vw, 5.2rem);
    line-height: 1;
    font-weight: 850;
    text-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}

.clock-random-room {
    margin-top: 10px;
    color: #cbd5e1;
    font-size: clamp(1rem, 2.4vw, 1.45rem);
    font-weight: 800;
}

.clock-random-drumroll {
    margin: 16px auto 0;
    width: min(360px, 72vw);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.clock-random-drumroll span {
    height: 8px;
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.72);
    animation: clockDrumroll 0.72s ease-in-out infinite;
}

.clock-random-drumroll span:nth-child(2) { animation-delay: 0.08s; }
.clock-random-drumroll span:nth-child(3) { animation-delay: 0.16s; }
.clock-random-drumroll span:nth-child(4) { animation-delay: 0.24s; }
.clock-random-drumroll span:nth-child(5) { animation-delay: 0.32s; }

.clock-random-again {
    margin: 18px auto 0;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #022c22;
    background: linear-gradient(135deg, #5eead4, #67e8f9);
    border: 1px solid rgba(255, 255, 255, 0.44);
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.24);
    font-size: 0.9rem;
    font-weight: 900;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.clock-random-again:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(14, 165, 233, 0.32);
}

.clock-random-card.is-spinning .clock-random-again {
    opacity: 0.72;
}

.clock-random-card.is-spinning .clock-random-name,
.clock-random-card.is-spinning .clock-random-photo {
    animation: clockNameFlip 0.22s ease-in-out infinite;
}

.clock-random-card.is-near-miss {
    animation: clockNearMiss 0.58s ease-in-out;
}

.clock-random-card.is-rewind .clock-random-photo-wrap,
.clock-random-card.is-rewind .clock-random-name {
    animation: clockRandomRewind 0.6s cubic-bezier(.2, 1.4, .22, 1);
}

.clock-random-card.is-revealed .clock-random-photo {
    animation: clockWinnerPop 0.76s cubic-bezier(.2, 1.5, .32, 1);
}

.clock-random-card.is-revealed .clock-random-drumroll {
    opacity: 0;
}

.clock-random-spotlight {
    position: fixed;
    inset: 0;
    z-index: 10025;
    display: grid;
    place-items: center;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(14, 165, 233, 0.2), transparent 36%),
        rgba(15, 23, 42, 0.22);
    animation: clockSpotlightBackdrop 2.25s ease forwards;
}

.clock-random-spotlight-rays {
    position: absolute;
    width: min(92vw, 920px);
    aspect-ratio: 1;
    border-radius: 999px;
    background:
        conic-gradient(from 0deg, transparent 0 9deg, rgba(103, 232, 249, 0.34) 10deg 14deg, transparent 15deg 28deg, rgba(250, 204, 21, 0.26) 29deg 33deg, transparent 34deg 52deg);
    filter: blur(1px);
    animation: clockSpotlightRays 2.2s linear infinite;
}

.clock-random-spotlight-card {
    position: relative;
    width: min(92vw, 760px);
    display: grid;
    justify-items: center;
    gap: 18px;
    animation: clockSpotlightPop 2.25s cubic-bezier(.18, 1.18, .25, 1) forwards;
}

.clock-random-spotlight-card img {
    width: clamp(300px, 48vw, 620px);
    height: clamp(300px, 62vh, 620px);
    object-fit: cover;
    border-radius: clamp(28px, 4vw, 52px);
    border: clamp(8px, 1.2vw, 14px) solid rgba(255, 255, 255, 0.95);
    background: #e2e8f0;
    box-shadow:
        0 36px 100px rgba(15, 23, 42, 0.46),
        0 0 0 12px rgba(14, 165, 233, 0.22),
        0 0 70px rgba(103, 232, 249, 0.48);
}

.clock-random-spotlight-card div {
    min-width: min(88vw, 460px);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.clock-random-spotlight-card small {
    color: #67e8f9;
    font-size: 0.9rem;
    font-weight: 900;
}

.clock-random-spotlight-card strong {
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    line-height: 1;
    font-weight: 950;
}

.clock-random-spotlight-card span {
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 850;
}

.clock-random-spark {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #facc15;
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.9);
    animation: clockSpotlightSpark 1.25s ease-out infinite;
}

.clock-random-spark.spark-1 { top: 8%; left: 14%; animation-delay: 0s; }
.clock-random-spark.spark-2 { top: 18%; right: 10%; animation-delay: 0.16s; background: #67e8f9; }
.clock-random-spark.spark-3 { bottom: 22%; left: 12%; animation-delay: 0.32s; background: #5eead4; }
.clock-random-spark.spark-4 { bottom: 18%; right: 16%; animation-delay: 0.48s; }

.clock-random-spotlight.is-leaving {
    animation: clockSpotlightLeave 0.6s ease forwards;
}

.clock-breathing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.clock-breathing-circle {
    width: clamp(150px, 26vw, 240px);
    aspect-ratio: 1;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(125, 211, 252, 0.4), rgba(14, 165, 233, 0.08) 68%);
    border: 1px solid rgba(125, 211, 252, 0.42);
    animation: clockBreathing 8s ease-in-out infinite;
}

.clock-breathing-circle span {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 850;
}

.clock-breathing-card p {
    color: #e2e8f0;
    font-weight: 800;
}

.clock-breathing-card b {
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.clock-team-card {
    text-align: left;
}

.clock-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 900;
}

.clock-team-header button {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 850;
}

.clock-team-grid-display {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.clock-team-box {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 14px 10px;
    text-align: center;
}

.clock-team-box strong {
    display: block;
    color: #bae6fd;
    font-size: 0.9rem;
}

.clock-team-box b {
    display: block;
    margin: 7px 0 10px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.clock-team-box div {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.clock-team-box button {
    width: 38px;
    height: 34px;
    border-radius: 12px;
    background: rgba(94, 234, 212, 0.9);
    color: #022c22;
    font-size: 1.2rem;
    font-weight: 900;
}

.clock-fullscreen-modal.weather-night .clock-timer-display,
.clock-fullscreen-modal.weather-storm .clock-timer-display,
.clock-fullscreen-modal.weather-rainy .clock-timer-display {
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.44);
    border-color: rgba(255, 255, 255, 0.16);
}

.weather-cloudy {
    background: linear-gradient(to bottom, #9fb7d4 0%, #dbe4ee 100%);
}

.weather-rainy {
    background: linear-gradient(to bottom, #4b6cb7 0%, #182848 100%);
}

.weather-storm {
    background: linear-gradient(to bottom, #141e30 0%, #243b55 100%);
}

.weather-snowy {
    background: linear-gradient(to bottom, #c3cfe2 0%, #f5f7fa 100%);
}

.weather-night {
    background: linear-gradient(to bottom, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.weather-autumn {
    background: linear-gradient(to bottom, #8e4a23 0%, #d38312 48%, #f5af19 100%);
}

.clock-fullscreen-modal.weather-night .clock-fullscreen-content,
.clock-fullscreen-modal.weather-storm .clock-fullscreen-content,
.clock-fullscreen-modal.weather-rainy .clock-fullscreen-content {
    background: rgba(15, 23, 42, 0.34);
    border-color: rgba(255, 255, 255, 0.2);
}

.clock-fullscreen-modal.weather-night .clock-fullscreen-time,
.clock-fullscreen-modal.weather-night .clock-fullscreen-date,
.clock-fullscreen-modal.weather-storm .clock-fullscreen-time,
.clock-fullscreen-modal.weather-storm .clock-fullscreen-date,
.clock-fullscreen-modal.weather-rainy .clock-fullscreen-time,
.clock-fullscreen-modal.weather-rainy .clock-fullscreen-date {
    color: #f8fafc;
}

.clock-fullscreen-modal.weather-night .clock-weather-panel,
.clock-fullscreen-modal.weather-storm .clock-weather-panel,
.clock-fullscreen-modal.weather-rainy .clock-weather-panel {
    background: rgba(15, 23, 42, 0.52);
    border-color: rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
}

.clock-fullscreen-modal.weather-night #clock-weather-location,
.clock-fullscreen-modal.weather-storm #clock-weather-location,
.clock-fullscreen-modal.weather-rainy #clock-weather-location {
    color: #cbd5e1;
}

.clock-fullscreen-modal.clock-random-active,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) {
    align-items: center;
}

.clock-fullscreen-modal.clock-random-active .clock-fullscreen-content,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) .clock-fullscreen-content {
    width: min(820px, calc(100vw - 32px));
    min-height: auto;
    max-height: calc(100dvh - 28px);
    padding-top: clamp(20px, 3vh, 36px);
    padding-bottom: clamp(18px, 3vh, 32px);
    overflow: visible;
}

.clock-fullscreen-modal.clock-random-active .clock-fullscreen-time,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) .clock-fullscreen-time {
    font-size: clamp(2.7rem, 8vw, 6rem);
}

.clock-fullscreen-modal.clock-random-active .clock-fullscreen-date,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) .clock-fullscreen-date {
    margin-top: 8px;
    font-size: clamp(0.85rem, 2vw, 1.2rem);
}

.clock-fullscreen-modal.clock-random-active .clock-weather-panel,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) .clock-weather-panel {
    margin-top: 10px;
    padding: 7px 12px;
    font-size: 0.78rem;
}

.clock-fullscreen-modal.clock-random-active .clock-classroom-layer,
.clock-fullscreen-modal:has(.clock-random-mode:not(.hidden)) .clock-classroom-layer {
    margin-top: 12px;
}

@keyframes clockQuake {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    20% { transform: translate3d(-4px, 3px, 0) rotate(-0.25deg); }
    40% { transform: translate3d(4px, -3px, 0) rotate(0.25deg); }
    60% { transform: translate3d(-3px, -2px, 0) rotate(0.18deg); }
    80% { transform: translate3d(3px, 2px, 0) rotate(-0.18deg); }
}

@keyframes clockTimeupPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.22); }
}

@keyframes clockNameFlip {
    0%, 100% { transform: translateY(0); filter: blur(0); }
    50% { transform: translateY(-5px); filter: blur(1px); }
}

@keyframes clockRandomSweep {
    to { transform: rotate(360deg); }
}

@keyframes clockRandomOrbit {
    to { transform: rotate(360deg); }
}

@keyframes clockDrumroll {
    0%, 100% { transform: scaleY(0.45); opacity: 0.38; }
    50% { transform: scaleY(1.4); opacity: 1; }
}

@keyframes clockNearMiss {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-16px) rotate(-1deg); }
    62% { transform: translateX(18px) rotate(1deg); }
}

@keyframes clockRandomRewind {
    0% { transform: translateX(70px) scale(0.92) rotate(5deg); filter: blur(3px); opacity: 0.62; }
    62% { transform: translateX(-18px) scale(1.08) rotate(-2deg); filter: blur(0); opacity: 1; }
    100% { transform: translateX(0) scale(1) rotate(0); }
}

@keyframes clockWinnerPop {
    0% { transform: scale(0.86) rotate(-3deg); }
    55% { transform: scale(1.08) rotate(1deg); }
    100% { transform: scale(1) rotate(-1deg); }
}

@keyframes clockSpotlightBackdrop {
    0% { opacity: 0; }
    12%, 72% { opacity: 1; }
    100% { opacity: 0.92; }
}

@keyframes clockSpotlightRays {
    to { transform: rotate(360deg); }
}

@keyframes clockSpotlightPop {
    0% { transform: scale(0.2) rotate(-8deg); opacity: 0; }
    16% { transform: scale(1.08) rotate(2deg); opacity: 1; }
    28% { transform: scale(0.98) rotate(-1deg); }
    70% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0.72) translateY(20px); opacity: 0; }
}

@keyframes clockSpotlightSpark {
    0% { transform: translate3d(0, 0, 0) scale(0.4) rotate(0deg); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate3d(0, -60px, 0) scale(1.2) rotate(180deg); opacity: 0; }
}

@keyframes clockSpotlightLeave {
    to { opacity: 0; transform: scale(0.96); }
}

@keyframes clockBreathing {
    0%, 100% { transform: scale(0.82); opacity: 0.78; }
    50% { transform: scale(1); opacity: 1; }
}

@media (min-width: 641px) and (max-height: 820px) {
    .clock-fullscreen-modal.clock-random-active .clock-fullscreen-content {
        width: min(760px, calc(100vw - 28px));
        max-height: calc(100dvh - 24px);
        padding: 16px 20px;
        border-radius: 26px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-fullscreen-time {
        font-size: clamp(2.3rem, 8vh, 4.5rem);
        line-height: 0.95;
    }

    .clock-fullscreen-modal.clock-random-active .clock-fullscreen-date {
        margin-top: 5px;
        font-size: 0.9rem;
    }

    .clock-fullscreen-modal.clock-random-active .clock-weather-panel {
        margin-top: 7px;
        padding: 5px 10px;
        gap: 6px;
        font-size: 0.72rem;
    }

    .clock-fullscreen-modal.clock-random-active #clock-weather-location {
        max-width: 220px;
        font-size: 0.7rem;
    }

    .clock-fullscreen-modal.clock-random-active .clock-classroom-layer {
        width: min(680px, 88vw);
        margin-top: 8px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-card {
        padding: 14px 18px;
        border-radius: 22px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-kicker {
        font-size: 0.78rem;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-stage {
        width: clamp(118px, 24vh, 160px);
        margin: 8px auto 7px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-photo {
        border-width: 4px;
        border-radius: 26px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-name {
        font-size: clamp(1.7rem, 7vh, 3.4rem);
        line-height: 0.98;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-room {
        margin-top: 5px;
        font-size: 0.92rem;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-drumroll {
        margin-top: 9px;
        width: min(300px, 62vw);
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-drumroll span {
        height: 6px;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-again {
        margin-top: 10px;
        min-height: 38px;
        padding: 0 16px;
        font-size: 0.82rem;
    }
}

@media (min-width: 641px) and (max-height: 680px) {
    .clock-fullscreen-modal.clock-random-active .clock-fullscreen-date {
        display: none;
    }

    .clock-fullscreen-modal.clock-random-active .clock-weather-panel {
        max-width: min(520px, 82vw);
    }

    .clock-fullscreen-modal.clock-random-active #clock-weather-location {
        display: none;
    }

    .clock-fullscreen-modal.clock-random-active .clock-random-stage {
        width: clamp(108px, 22vh, 140px);
    }
}

@media (max-width: 640px) {
    .clock-control-panel {
        top: max(76px, calc(env(safe-area-inset-top) + 76px));
        left: max(12px, env(safe-area-inset-left));
        width: calc(100vw - 24px);
        max-height: calc(100dvh - max(92px, calc(env(safe-area-inset-top) + 92px)) - max(12px, env(safe-area-inset-bottom)));
        padding: 12px;
        border-radius: 18px;
    }

    .clock-control-section + .clock-control-section {
        margin-top: 10px;
        padding-top: 10px;
    }

    .clock-control-title {
        margin-bottom: 8px;
    }

    .clock-weather-choices {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .clock-weather-choice {
        min-height: 50px;
        border-radius: 12px;
        font-size: 0.64rem;
        gap: 3px;
    }

    .clock-weather-choice i {
        font-size: 1rem;
    }

    .clock-timer-form {
        grid-template-columns: auto 1fr auto 1fr;
    }

    .clock-timer-start,
    .clock-timer-stop {
        width: 100%;
    }

    .clock-preset-list,
    .clock-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .clock-preset-button,
    .clock-tool-grid button {
        min-height: 42px;
        border-radius: 12px;
        font-size: 0.72rem;
    }

    .clock-random-room-row,
    .clock-announcement-form {
        gap: 6px;
    }

    .clock-random-room-row select,
    .clock-announcement-form input,
    .clock-sound-select {
        height: 38px;
    }

    .clock-fullscreen-content {
        min-height: 300px;
        padding: 34px 18px;
    }

    .clock-team-grid-display {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clock-random-card,
    .clock-breathing-card,
    .clock-team-card {
        padding: 16px;
        border-radius: 22px;
    }

    .clock-random-again {
        min-height: 42px;
        padding: 0 16px;
        font-size: 0.84rem;
    }
}

.dashboard-quick-actions {
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
}

.dashboard-quick-actions-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.dashboard-quick-actions-heading h3 {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 900;
}

.dashboard-quick-actions-heading i {
    margin-right: 0.35rem;
    color: #f59e0b;
}

.dashboard-quick-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 0.5rem;
}

.dashboard-quick-action {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    gap: 0.5rem;
    padding: 0.48rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    text-align: left;
    font-size: 0.68rem;
    line-height: 1.18;
    font-weight: 900;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.dashboard-quick-action:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.dashboard-quick-action > span:last-child {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.dashboard-quick-action-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    font-size: 0.9rem;
}

.quick-action-assembly { color: #dc2626; background: #fee2e2; }
.quick-action-scan { color: #0891b2; background: #cffafe; }
.quick-action-advisory { color: #db2777; background: #fce7f3; }
.quick-action-home { color: #059669; background: #d1fae5; }
.quick-action-score { color: #b45309; background: #fef3c7; }
.quick-action-random { color: #7c3aed; background: #ede9fe; }
.quick-action-monitor { color: #15803d; background: #dcfce7; }
.quick-action-search { color: #b91c1c; background: #fee2e2; }
.quick-action-tablet { color: #0284c7; background: #e0f2fe; }
.quick-action-schedule { color: #0369a1; background: #e0f2fe; }
.quick-action-executive { color: #0f766e; background: #ccfbf1; }
.quick-action-report { color: #475569; background: #e2e8f0; }

.quick-timetable-button {
    isolation: isolate;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    border-color: #bae6fd !important;
    background:
        linear-gradient(rgba(14, 165, 233, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.055) 1px, transparent 1px),
        linear-gradient(145deg, #f0f9ff 0%, #ffffff 52%, #ecfdf5 100%) !important;
    background-size: 14px 14px, 14px 14px, auto !important;
    box-shadow: inset 0 1px 0 #ffffff, 0 8px 18px rgba(14, 116, 144, 0.12);
}

.quick-timetable-button:hover {
    border-color: #38bdf8 !important;
    box-shadow: inset 0 1px 0 #ffffff, 0 12px 24px rgba(14, 116, 144, 0.2);
    transform: translateY(-2px);
}

.quick-timetable-button:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

.quick-timetable-icon {
    position: relative;
    z-index: 2;
    display: flex;
    width: 3.4rem;
    height: 3.4rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 0.75rem;
    background: linear-gradient(145deg, #0ea5e9, #0284c7);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 7px 16px rgba(2, 132, 199, 0.28);
    font-size: 1.65rem;
}

.quick-timetable-icon > span {
    position: absolute;
    right: -0.45rem;
    bottom: -0.35rem;
    display: flex;
    width: 1.55rem;
    height: 1.55rem;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(180, 83, 9, 0.25);
    font-size: 0.68rem;
    animation: quickTimetableClockPulse 2.4s ease-in-out infinite;
}

@keyframes quickTimetableClockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

body.teacher-timetable-open {
    overflow: hidden;
}

.teacher-timetable-modal {
    position: fixed;
    inset: 0;
    z-index: 178;
    display: grid;
    place-items: center;
    padding: 18px;
}

.teacher-timetable-modal.hidden {
    display: none !important;
}

.teacher-timetable-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.62);
    opacity: 0;
    transition: opacity 180ms ease;
}

.teacher-timetable-dialog {
    position: relative;
    display: flex;
    width: min(900px, 100%);
    height: min(88dvh, 790px);
    max-height: 790px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.3);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease;
}

.teacher-timetable-modal.is-open .teacher-timetable-backdrop,
.teacher-timetable-modal.is-open .teacher-timetable-dialog {
    opacity: 1;
}

.teacher-timetable-modal.is-open .teacher-timetable-dialog {
    transform: translateY(0) scale(1);
}

.teacher-timetable-header {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 104px;
    padding: 18px 22px;
    border-top: 4px solid #22c55e;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.teacher-timetable-header::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 0;
    width: 38%;
    height: 4px;
    background: #0ea5e9;
}

.teacher-timetable-header::after {
    content: "";
    position: absolute;
    top: -4px;
    right: 0;
    width: 25%;
    height: 4px;
    background: #8b5cf6;
}

.teacher-timetable-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.teacher-timetable-heading-icon {
    display: flex;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 1.55rem;
}

.teacher-timetable-heading p {
    margin: 0 0 2px;
    color: #0284c7;
    font-size: 0.68rem;
    font-weight: 900;
}

.teacher-timetable-heading h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.42rem;
    font-weight: 900;
    line-height: 1.18;
}

.teacher-timetable-heading > div > span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.teacher-timetable-close {
    display: flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: #e11d48;
    font-size: 1.15rem;
    transition: background-color 160ms ease, color 160ms ease;
}

.teacher-timetable-close:hover {
    background: #e11d48;
    color: #ffffff;
}

.teacher-timetable-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 22px 22px;
    background: #f8fafc;
}

.teacher-timetable-next {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 15px 16px;
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
}

.teacher-timetable-next.is-current {
    border-color: #a7f3d0;
    border-left-color: #10b981;
    background: #ecfdf5;
}

.teacher-timetable-next-icon {
    display: flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 1.25rem;
}

.teacher-timetable-next.is-current .teacher-timetable-next-icon {
    background: #10b981;
}

.teacher-timetable-next-copy {
    min-width: 0;
}

.teacher-timetable-next-copy p {
    margin: 0 0 2px;
    color: #b45309;
    font-size: 0.72rem;
    font-weight: 900;
}

.teacher-timetable-next.is-current .teacher-timetable-next-copy p {
    color: #047857;
}

.teacher-timetable-next-copy h4 {
    margin: 0;
    overflow: hidden;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-timetable-next-copy span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.teacher-timetable-next > strong {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    background: #ffffff;
    color: #b45309;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.teacher-timetable-next.is-current > strong {
    border-color: #6ee7b7;
    color: #047857;
}

.teacher-timetable-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(66px, 1fr));
    gap: 7px;
    margin: 16px 0;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
}

.teacher-timetable-day {
    position: relative;
    display: grid;
    min-height: 64px;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.teacher-timetable-day span {
    font-size: 0.76rem;
    font-weight: 900;
}

.teacher-timetable-day b {
    color: #94a3b8;
    font-size: 0.66rem;
}

.teacher-timetable-day small {
    position: absolute;
    top: 3px;
    right: 3px;
    color: #d97706;
    font-size: 0.5rem;
    font-weight: 900;
}

.teacher-timetable-day.is-today {
    border-color: #fbbf24;
}

.teacher-timetable-day.is-selected {
    border-color: #0284c7;
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.2);
}

.teacher-timetable-day.is-selected b,
.teacher-timetable-day.is-selected small {
    color: #ffffff;
}

.teacher-timetable-list-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
}

.teacher-timetable-list-heading h4,
.teacher-timetable-list-heading p {
    margin: 0;
}

.teacher-timetable-list-heading h4 {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.teacher-timetable-list-heading p,
.teacher-timetable-list-heading > span {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.teacher-timetable-list {
    display: grid;
    gap: 8px;
}

.teacher-timetable-entry {
    position: relative;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 94px;
    padding: 13px 14px;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-left: 5px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.teacher-timetable-entry.is-current {
    border-color: #86efac;
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.teacher-timetable-entry.is-next {
    border-color: #fde68a;
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.teacher-timetable-entry.is-done {
    opacity: 0.72;
}

.teacher-timetable-time {
    display: flex;
    min-height: 58px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e2e8f0;
}

.teacher-timetable-time strong {
    color: #0f766e;
    font-size: 1.18rem;
    font-weight: 900;
}

.teacher-timetable-time span {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 700;
}

.teacher-timetable-room {
    display: inline-flex;
    max-width: calc(100% - 8px);
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 5px 9px;
    background: #e0f2fe;
    color: #075985;
    font-size: 1.22rem;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.teacher-timetable-room i {
    flex: 0 0 auto;
    font-size: 0.92rem;
}

.teacher-timetable-entry-main {
    min-width: 0;
}

.teacher-timetable-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.teacher-timetable-status,
.teacher-timetable-reminder {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 900;
}

.teacher-timetable-status {
    background: #e2e8f0;
    color: #475569;
}

.is-current .teacher-timetable-status {
    background: #dcfce7;
    color: #15803d;
}

.is-next .teacher-timetable-status {
    background: #fef3c7;
    color: #b45309;
}

.teacher-timetable-reminder {
    background: #ede9fe;
    color: #7c3aed;
}

.teacher-timetable-reminder.is-off {
    background: #f1f5f9;
    color: #94a3b8;
}

.teacher-timetable-entry-main p {
    margin: 0 0 2px;
    color: #0284c7;
    font-size: 0.72rem;
    font-weight: 900;
}

.teacher-timetable-entry-main h5 {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.35;
}

.teacher-timetable-order {
    display: flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 900;
}

.teacher-timetable-empty {
    min-height: 210px;
    padding: 34px 20px;
    text-align: center;
}

.teacher-timetable-empty.hidden {
    display: none !important;
}

.teacher-timetable-empty > span {
    display: flex;
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.4rem;
}

.teacher-timetable-empty strong {
    display: block;
    color: #334155;
    font-size: 1rem;
    font-weight: 900;
}

.teacher-timetable-empty p {
    margin: 5px 0 0;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
}

.teacher-timetable-footer {
    display: flex;
    min-height: 66px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 22px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.teacher-timetable-footer > span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}

.teacher-timetable-footer > span i {
    margin-right: 5px;
    color: #10b981;
}

.teacher-timetable-footer button {
    min-width: 92px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
}

@media (max-width: 640px) {
    .teacher-timetable-modal {
        padding: 8px;
    }

    .teacher-timetable-dialog {
        width: 100%;
        height: calc(100dvh - 16px);
        max-height: none;
    }

    .teacher-timetable-header {
        min-height: 88px;
        padding: 12px;
    }

    .teacher-timetable-heading {
        gap: 10px;
    }

    .teacher-timetable-heading-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        font-size: 1.2rem;
    }

    .teacher-timetable-heading h3 {
        font-size: 1.12rem;
    }

    .teacher-timetable-heading > div > span {
        max-width: 235px;
        overflow: hidden;
        font-size: 0.68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .teacher-timetable-close {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .teacher-timetable-body {
        padding: 12px;
    }

    .teacher-timetable-next {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
        min-height: 108px;
        padding: 12px;
    }

    .teacher-timetable-next-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .teacher-timetable-next-copy h4 {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.84rem;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .teacher-timetable-next-copy span {
        font-size: 0.66rem;
    }

    .teacher-timetable-next > strong {
        grid-column: 2;
        justify-self: start;
        min-height: 28px;
        padding: 4px 9px;
        font-size: 0.64rem;
    }

    .teacher-timetable-days {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        margin: 12px 0;
        overflow-x: visible;
    }

    .teacher-timetable-day {
        min-width: 0;
        min-height: 58px;
    }

    .teacher-timetable-day small {
        display: none;
    }

    .teacher-timetable-list-heading > span {
        display: none;
    }

    .teacher-timetable-entry {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        min-height: 104px;
        padding: 11px 10px;
    }

    .teacher-timetable-time {
        min-height: 64px;
    }

    .teacher-timetable-time strong {
        font-size: 1rem;
    }

    .teacher-timetable-room {
        gap: 3px;
        margin-top: 5px;
        min-height: 31px;
        padding: 5px 6px;
        font-size: 1.08rem;
    }

    .teacher-timetable-room i {
        font-size: 0.82rem;
    }

    .teacher-timetable-entry-main h5 {
        font-size: 0.8rem;
    }

    .teacher-timetable-order {
        display: none;
    }

    .teacher-timetable-footer {
        min-height: 60px;
        padding: 10px 12px;
    }

    .teacher-timetable-footer > span {
        max-width: 210px;
        font-size: 0.62rem;
    }

    .teacher-timetable-footer button {
        min-width: 76px;
        min-height: 38px;
    }
}

@media (max-width: 767px) {
    .dashboard-quick-actions {
        padding: 0.7rem;
    }

    .dashboard-quick-actions-grid {
        display: flex !important;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .dashboard-quick-action {
        flex: 0 0 132px;
        min-height: 56px;
        scroll-snap-align: start;
    }
}

.dashboard-quick-menu {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)) !important;
}

@media (max-width: 639px) {
    #dashboard-folders.dashboard-folders-levels {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #dashboard-folders.dashboard-folders-levels .dashboard-folder-level-card {
        min-width: 0;
        min-height: 104px;
        padding: 10px 4px;
        border-radius: 12px;
    }

    #dashboard-folders.dashboard-folders-levels .dashboard-folder-level-icon {
        margin-bottom: 6px;
        font-size: 1.7rem;
    }

    #dashboard-folders.dashboard-folders-levels .dashboard-folder-level-name {
        font-size: 0.72rem;
        line-height: 1.3;
    }

    #dashboard-folders.dashboard-folders-levels .dashboard-folder-level-count {
        max-width: 100%;
        padding: 3px 6px;
        overflow: hidden;
        font-size: 0.62rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #dashboard-folders.dashboard-folders-rooms {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-card {
        min-width: 0;
        min-height: 112px;
        padding: 9px 4px;
        border-radius: 12px;
    }

    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-icon {
        margin-bottom: 6px;
        font-size: 1.7rem;
    }

    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-name {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-stats {
        width: 100%;
        justify-content: center;
        gap: 3px;
        margin-top: 6px;
    }

    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-count,
    #dashboard-folders.dashboard-folders-rooms .dashboard-folder-room-face-count {
        min-width: 0;
        padding: 3px 4px;
        overflow: hidden;
        font-size: 0.56rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.dashboard-quick-menu > button {
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 14px 10px !important;
    border-radius: 14px;
    overflow: hidden;
}

.dashboard-quick-menu h4 {
    line-height: 1.28;
    overflow-wrap: normal;
    word-break: normal;
}

.quick-student-urgent-button {
    isolation: isolate;
    border-color: rgba(254, 202, 202, 0.95) !important;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.28), transparent 34%),
        linear-gradient(135deg, #fb7185 0%, #e11d48 42%, #991b1b 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -16px 28px rgba(127, 29, 29, 0.18),
        0 14px 30px rgba(225, 29, 72, 0.3);
    animation: quickStudentUrgentCardPulse 2.4s ease-in-out infinite;
}

.quick-student-urgent-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.075) 1px, transparent 1px);
    background-size: 0.95rem 0.95rem;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.28));
    pointer-events: none;
}

.quick-student-urgent-button:hover {
    border-color: #fef3c7 !important;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.34), transparent 34%),
        linear-gradient(135deg, #fb7185 0%, #dc2626 42%, #7f1d1d 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -16px 28px rgba(127, 29, 29, 0.22),
        0 18px 38px rgba(220, 38, 38, 0.4);
    transform: translateY(-2px);
}

.quick-student-urgent-button:focus-visible {
    outline: 3px solid #fde047;
    outline-offset: 3px;
}

.quick-student-urgent-icon {
    position: relative;
    z-index: 3;
    display: flex;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 0.9rem;
    background: rgba(127, 29, 29, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 20px rgba(127, 29, 29, 0.26);
    backdrop-filter: blur(3px);
    animation: quickStudentUrgentIconBeat 2.4s ease-in-out infinite;
}

.quick-student-urgent-ring {
    position: absolute;
    inset: -0.3rem;
    border: 2px solid rgba(254, 240, 138, 0.8);
    border-radius: 1.05rem;
    opacity: 0;
    pointer-events: none;
    animation: quickStudentUrgentRing 2.4s ease-out infinite;
}

.quick-student-urgent-person {
    color: #ffffff;
    font-size: 1.65rem;
    filter: drop-shadow(0 3px 3px rgba(127, 29, 29, 0.42));
}

.quick-student-urgent-search {
    position: absolute;
    right: -0.34rem;
    bottom: -0.28rem;
    display: flex;
    width: 1.52rem;
    height: 1.52rem;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #fde047;
    color: #991b1b;
    font-size: 0.7rem;
    box-shadow: 0 4px 10px rgba(127, 29, 29, 0.35);
    animation: quickStudentUrgentSearch 2.4s ease-in-out infinite;
}

@keyframes quickStudentUrgentCardPulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -16px 28px rgba(127, 29, 29, 0.18), 0 12px 26px rgba(225, 29, 72, 0.26); }
    44% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), inset 0 -16px 28px rgba(127, 29, 29, 0.2), 0 16px 34px rgba(220, 38, 38, 0.42); }
}

@keyframes quickStudentUrgentIconBeat {
    0%, 100% { transform: scale(1); }
    38% { transform: scale(1.06); }
    52% { transform: scale(1.01); }
}

@keyframes quickStudentUrgentRing {
    0%, 22% { transform: scale(0.82); opacity: 0; }
    32% { opacity: 0.78; }
    70%, 100% { transform: scale(1.28); opacity: 0; }
}

@keyframes quickStudentUrgentSearch {
    0%, 100% { transform: translate(-0.08rem, 0.08rem) rotate(-5deg); }
    46% { transform: translate(0.1rem, -0.1rem) rotate(7deg) scale(1.08); }
}

.quick-thai-flag {
    position: relative;
    display: flex;
    width: 4rem;
    height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    perspective: 220px;
    filter: drop-shadow(0 6px 5px rgba(15, 23, 42, 0.2));
}

.quick-thai-flag-cloth {
    position: relative;
    display: block;
    width: 3.85rem;
    height: 2.45rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.18rem 0.34rem 0.34rem 0.18rem;
    background: linear-gradient(
        to bottom,
        #ef3340 0% 16.666%,
        #ffffff 16.666% 33.333%,
        #2d2a8c 33.333% 66.666%,
        #ffffff 66.666% 83.333%,
        #ef3340 83.333% 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -1px 0 rgba(15, 23, 42, 0.12);
}

.quick-thai-flag-cloth::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 42%, rgba(15, 23, 42, 0.08));
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.quick-thai-flag-cloth::after {
    content: "";
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: -48%;
    width: 34%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.28) 28%, rgba(255, 255, 255, 0.92) 52%, rgba(255, 255, 255, 0.3) 72%, transparent 100%);
    transform: translateX(-20%) skewX(-18deg);
    opacity: 0;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    pointer-events: none;
    animation: quickThaiFlagShine 2.8s ease-in-out infinite;
}

@keyframes quickThaiFlagShine {
    0%, 14% { transform: translateX(-20%) skewX(-18deg); opacity: 0; }
    24% { opacity: 0.95; }
    62% { transform: translateX(455%) skewX(-18deg); opacity: 0.85; }
    72%, 100% { transform: translateX(475%) skewX(-18deg); opacity: 0; }
}

.quick-home-nav-button {
    border-color: rgba(110, 231, 183, 0.9) !important;
    background:
        radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.34), transparent 35%),
        linear-gradient(135deg, #34d399 0%, #16a34a 45%, #047857 100%) !important;
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -12px 24px rgba(4, 120, 87, 0.16),
        0 14px 30px rgba(5, 150, 105, 0.23);
}

.quick-home-nav-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: repeating-linear-gradient(135deg, transparent 0 1.35rem, rgba(255, 255, 255, 0.07) 1.35rem 1.48rem, transparent 1.48rem 2.8rem);
    pointer-events: none;
}

.quick-home-nav-button:hover {
    border-color: rgba(167, 243, 208, 0.96) !important;
    background:
        radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.4), transparent 35%),
        linear-gradient(135deg, #34d399 0%, #16a34a 38%, #065f46 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -12px 24px rgba(4, 120, 87, 0.2),
        0 18px 38px rgba(5, 150, 105, 0.32);
    transform: translateY(-2px);
}

.quick-home-nav-trail {
    position: absolute;
    z-index: 1;
    color: rgba(255, 255, 255, 0.26);
    font-size: 0.95rem;
    pointer-events: none;
    animation: quickHomeNavTrail 3.6s ease-in-out infinite;
}

.quick-home-nav-trail-one {
    top: 0.55rem;
    right: 0.62rem;
    transform: rotate(-28deg);
}

.quick-home-nav-trail-two {
    bottom: 0.52rem;
    left: 0.58rem;
    font-size: 0.72rem;
    animation-delay: 1.35s;
}

.quick-home-nav-icon {
    position: relative;
    z-index: 2;
    display: flex;
    width: 3.1rem;
    height: 3.1rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 20px rgba(6, 78, 59, 0.22);
    backdrop-filter: blur(3px);
}

.quick-home-nav-button h4 {
    text-shadow: 0 2px 4px rgba(6, 78, 59, 0.28);
}

.quick-home-nav-direction {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(0.3rem) scale(0.72);
    animation: quickHomeNavDirection 6.4s ease-in-out infinite;
}

.quick-home-nav-straight {
    animation-delay: 0s;
}

.quick-home-nav-left {
    animation-delay: 1.6s;
}

.quick-home-nav-right {
    animation-delay: 3.2s;
}

.quick-home-nav-uturn {
    animation-delay: 4.8s;
}

@keyframes quickHomeNavDirection {
    0% {
        opacity: 0;
        transform: translateY(0.3rem) scale(0.72);
    }
    5%, 21% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 2px 1px rgba(21, 128, 61, 0.18));
    }
    25%, 100% {
        opacity: 0;
        transform: translateY(-0.22rem) scale(0.72);
    }
}

@keyframes quickHomeNavTrail {
    0%, 100% { transform: translate(-0.2rem, 0.25rem) rotate(-28deg) scale(0.75); opacity: 0.08; }
    48% { transform: translate(0.3rem, -0.28rem) rotate(-20deg) scale(1.06); opacity: 0.3; }
}

.quick-score-star {
    --quick-score-star-size: 2.2rem;
    position: relative;
    display: flex;
    width: 3.25rem;
    height: 3rem;
    margin-right: auto;
    margin-left: auto;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.quick-score-star-icon {
    position: relative;
    z-index: 2;
    color: #facc15;
    transform-origin: center;
    filter: drop-shadow(0 3px 2px rgba(180, 83, 9, 0.28));
    animation: quickScoreStarGlow 2.6s ease-in-out infinite;
}

.quick-score-star-sweep {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: var(--quick-score-star-size);
    height: var(--quick-score-star-size);
    overflow: hidden;
    clip-path: polygon(50% 2%, 61% 36%, 97% 36%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 3% 36%, 39% 36%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.quick-score-star-sweep::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -55%;
    width: 28%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
    transform: skewX(-18deg);
    animation: quickScoreStarSweep 2.6s ease-in-out infinite;
}

.quick-score-star-spark {
    position: absolute;
    z-index: 4;
    display: block;
    width: 0.48rem;
    height: 0.48rem;
    background: #fffbea;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 3px rgba(250, 204, 21, 0.95));
    opacity: 0;
    pointer-events: none;
}

.quick-score-star-spark-one {
    top: 0.18rem;
    right: 0.18rem;
    animation: quickScoreStarSparkle 2.6s ease-in-out infinite 0.35s;
}

.quick-score-star-spark-two {
    bottom: 0.24rem;
    left: 0.12rem;
    width: 0.36rem;
    height: 0.36rem;
    animation: quickScoreStarSparkle 2.6s ease-in-out infinite 1.05s;
}

@keyframes quickScoreStarGlow {
    0%, 100% {
        color: #facc15;
        transform: rotate(-3deg) scale(0.94);
        filter: drop-shadow(0 3px 2px rgba(180, 83, 9, 0.25)) brightness(1);
    }
    45% {
        color: #fde047;
        transform: rotate(3deg) scale(1.1);
        filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.85)) drop-shadow(0 4px 3px rgba(180, 83, 9, 0.24)) brightness(1.12);
    }
    62% {
        color: #fbbf24;
        transform: rotate(0deg) scale(1.02);
        filter: drop-shadow(0 0 3px rgba(253, 224, 71, 0.65)) brightness(1.06);
    }
}

@keyframes quickScoreStarSweep {
    0%, 20% { transform: translateX(0) skewX(-18deg); opacity: 0; }
    30% { opacity: 0.95; }
    58% { transform: translateX(520%) skewX(-18deg); opacity: 0.9; }
    68%, 100% { transform: translateX(540%) skewX(-18deg); opacity: 0; }
}

@keyframes quickScoreStarSparkle {
    0%, 30%, 72%, 100% { transform: scale(0.35) rotate(0deg); opacity: 0; }
    45% { transform: scale(1.25) rotate(45deg); opacity: 1; }
    58% { transform: scale(0.85) rotate(90deg); opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
    .quick-thai-flag-cloth::after,
    .quick-home-nav-trail,
    .quick-home-nav-direction,
    .quick-score-star-icon,
    .quick-score-star-sweep::before,
    .quick-score-star-spark,
    .quick-student-urgent-button,
    .quick-student-urgent-icon,
    .quick-student-urgent-ring,
    .quick-student-urgent-search {
        animation: none;
    }

    .quick-thai-flag-cloth::after,
    .quick-home-nav-trail,
    .quick-score-star-spark,
    .quick-student-urgent-ring {
        opacity: 0;
    }

    .quick-home-nav-direction {
        opacity: 0;
    }

    .quick-home-nav-straight {
        opacity: 1;
        transform: none;
    }
}

@keyframes quickExecutiveFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.04); }
}

@keyframes quickExecutiveSheen {
    0% { transform: translateX(-130%) rotate(18deg); opacity: 0; }
    28% { opacity: 0.5; }
    62%, 100% { transform: translateX(130%) rotate(18deg); opacity: 0; }
}

@keyframes quickExecutiveRing {
    0% { transform: scale(0.72); opacity: 0.52; }
    70%, 100% { transform: scale(1.5); opacity: 0; }
}

@keyframes quickNdlpFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes quickNdlpScreenGlow {
    0%, 100% { opacity: 0.28; transform: scaleX(0.74); }
    50% { opacity: 0.82; transform: scaleX(1); }
}

@keyframes quickNdlpSignal {
    0% { transform: translateY(6px) scale(0.72); opacity: 0; }
    38% { opacity: 0.82; }
    100% { transform: translateY(-13px) scale(1.2); opacity: 0; }
}

@keyframes quickNdlpBubble {
    0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.18; }
    50% { transform: translateY(-10px) scale(1.12); opacity: 0.38; }
}

.quick-executive-button {
    background: linear-gradient(135deg, #ecfeff 0%, #ffffff 48%, #e0f2fe 100%);
    border-color: #bae6fd;
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.12);
}

.quick-executive-button:hover {
    border-color: #38bdf8;
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.2);
}

.quick-executive-sheen {
    position: absolute;
    inset: -30% auto -30% 0;
    width: 42%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.82), transparent);
    animation: quickExecutiveSheen 3s ease-in-out infinite;
}

.quick-executive-icon {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0891b2, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32), 0 10px 20px rgba(37, 99, 235, 0.22);
    animation: quickExecutiveFloat 2.2s ease-in-out infinite;
}

.quick-executive-icon i {
    position: relative;
    z-index: 2;
    font-size: 1.55rem;
}

.quick-executive-ring {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 14px;
    animation: quickExecutiveRing 2s ease-out infinite;
}

.quick-ndlp-button {
    background: radial-gradient(circle at 24% 18%, rgba(255,255,255,0.32), transparent 34%),
                linear-gradient(135deg, #06b6d4 0%, #0ea5e9 42%, #2563eb 100%);
    border-color: rgba(125, 211, 252, 0.9);
    color: white;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.2);
}

.quick-ndlp-button:hover {
    box-shadow: 0 18px 38px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

.quick-ndlp-icon {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.34);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 12px 22px rgba(15, 23, 42, 0.18);
    animation: quickNdlpFloat 2.4s ease-in-out infinite;
}

.quick-ndlp-icon i {
    position: relative;
    z-index: 3;
    font-size: 1.72rem;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.28));
}

.quick-ndlp-screen {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 9px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.95), rgba(255,255,255,0.2));
    animation: quickNdlpScreenGlow 1.65s ease-in-out infinite;
}

.quick-ndlp-signal {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.72);
    animation: quickNdlpSignal 1.8s ease-out infinite;
}

.quick-ndlp-bubble {
    position: absolute;
    border-radius: 999px;
    background: rgba(255,255,255,0.24);
    pointer-events: none;
}

.quick-ndlp-bubble-one {
    width: 42px;
    height: 42px;
    right: -10px;
    top: 10px;
    animation: quickNdlpBubble 3.1s ease-in-out infinite;
}

.quick-ndlp-bubble-two {
    width: 24px;
    height: 24px;
    left: 10px;
    bottom: 12px;
    animation: quickNdlpBubble 2.5s ease-in-out infinite 0.4s;
}

@media (min-width: 768px) {
    .dashboard-quick-menu .quick-student-title {
        font-size: 0.72rem !important;
        line-height: 1.05;
        font-weight: 800;
        white-space: nowrap;
    }

    .dashboard-quick-menu .quick-executive-button h4 {
        font-size: 0.72rem !important;
        line-height: 1.05;
        white-space: nowrap;
    }

    .dashboard-quick-menu .quick-ndlp-button h4 {
        font-size: 0.72rem !important;
        line-height: 1.05;
        white-space: nowrap;
    }
}

@media (min-width: 768px) and (max-width: 1180px) {
    .dashboard-quick-menu {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
    }

    .dashboard-quick-menu > button {
        min-height: 118px;
        padding: 16px 12px !important;
    }
}

@media (max-width: 767px) {
    .dashboard-quick-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
    }

    .dashboard-quick-menu > button {
        width: 100%;
        min-width: 0;
        min-height: 0;
        aspect-ratio: 1 / 1;
        padding: 0.35rem 0.25rem !important;
        border-radius: 0.65rem;
    }

    .dashboard-quick-menu h4,
    .dashboard-quick-menu .quick-student-title,
    .dashboard-quick-menu .quick-executive-button h4,
    .dashboard-quick-menu .quick-ndlp-button h4 {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 2.5em;
        font-size: 0.64rem !important;
        line-height: 1.25;
        letter-spacing: 0;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .dashboard-quick-menu > button > .mb-2 {
        margin-bottom: 0.25rem !important;
    }

    .dashboard-quick-menu > button > span.mt-1 {
        display: none;
    }

    .dashboard-quick-menu .text-3xl {
        font-size: 1.45rem !important;
    }

    .dashboard-quick-menu .text-4xl {
        font-size: 1.65rem !important;
    }

    .dashboard-quick-menu .quick-menu-icon-large {
        font-size: 1.65rem !important;
    }

    .dashboard-quick-menu .quick-ndlp-icon,
    .dashboard-quick-menu .quick-executive-icon,
    .dashboard-quick-menu .quick-report-icon,
    .dashboard-quick-menu .quick-timetable-icon,
    .dashboard-quick-menu .quick-student-urgent-icon {
        width: 2.4rem;
        height: 2.4rem;
        border-radius: 0.7rem;
    }

    .dashboard-quick-menu .quick-ndlp-icon i,
    .dashboard-quick-menu .quick-executive-icon i,
    .dashboard-quick-menu .quick-timetable-icon > i {
        font-size: 1.25rem;
    }

    .dashboard-quick-menu .quick-timetable-icon > span {
        right: -0.3rem;
        bottom: -0.25rem;
        width: 1.2rem;
        height: 1.2rem;
        border-width: 1.5px;
        font-size: 0.52rem;
    }

    .dashboard-quick-menu .quick-student-urgent-person {
        font-size: 1.22rem;
    }

    .dashboard-quick-menu .quick-student-urgent-search {
        right: -0.2rem;
        bottom: -0.18rem;
        width: 1.2rem;
        height: 1.2rem;
        border-width: 1.5px;
        font-size: 0.56rem;
    }

    .dashboard-quick-menu > button > div:not(.absolute):not(.quick-executive-sheen) {
        display: flex !important;
        flex: 0 0 2.55rem;
        align-items: center !important;
        justify-content: center !important;
        height: 2.55rem !important;
        min-height: 2.55rem;
        max-height: 2.55rem;
    }

    .dashboard-quick-menu > button:nth-child(2) > div {
        scale: 0.8;
    }

    .dashboard-quick-menu .quick-home-nav-icon {
        width: 2.4rem;
        height: 2.4rem !important;
        min-height: 2.4rem;
        max-height: 2.4rem;
        border-radius: 0.62rem;
    }

    .dashboard-quick-menu .quick-home-nav-direction {
        font-size: 1.3rem;
    }

    .dashboard-quick-menu .quick-thai-flag {
        width: 2.8rem;
        height: 1.95rem !important;
        min-height: 1.95rem;
        max-height: 1.95rem;
    }

    .dashboard-quick-menu .quick-thai-flag-cloth {
        width: 2.65rem;
        height: 1.7rem;
    }

    #dashboard-quick-panel-main > button {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
    }

    #dashboard-quick-panel-main > button > div:not(.absolute):not(.quick-executive-sheen) {
        width: 2.65rem !important;
        height: 2.65rem !important;
        min-height: 2.65rem;
        max-height: 2.65rem;
        margin: 0 !important;
    }

    #dashboard-quick-panel-main > button > h4 {
        min-height: 2.5em;
        max-height: 2.5em;
        margin: 0 !important;
        overflow: hidden;
        font-size: 0.66rem !important;
        font-weight: 800 !important;
        line-height: 1.25;
    }

    #dashboard-quick-panel-main .quick-subject-media-animation {
        width: 2.65rem !important;
        height: 2.65rem !important;
        flex-basis: 2.65rem;
    }

    #dashboard-quick-panel-main .quick-subject-media-icon {
        width: 2.45rem;
        height: 2.45rem;
        border-radius: 0.65rem;
    }

    #dashboard-quick-panel-main .quick-subject-media-mode {
        font-size: 1.2rem;
    }
}

.quick-student-summary-swal {
    padding: 1rem !important;
}

.quick-student-summary-html {
    margin-left: 0.75rem !important;
    margin-right: 0.75rem !important;
    overflow: visible !important;
}

.quick-student-summary-popup {
    max-height: calc(88dvh - 84px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    padding-bottom: 6px;
}

.quick-student-summary-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 8px;
    padding-bottom: 2px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 70%, rgba(255, 255, 255, 0));
}

@media (max-width: 640px) {
    .quick-student-summary-swal {
        width: calc(100vw - 14px) !important;
        max-width: 430px !important;
        padding: 10px 7px 9px !important;
        border-radius: 28px !important;
    }

    .quick-student-summary-swal .swal2-title {
        padding: 10px 36px 8px !important;
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
    }

    .quick-student-summary-swal .swal2-close {
        width: 36px !important;
        height: 36px !important;
        font-size: 2rem !important;
        top: 10px !important;
        right: 10px !important;
    }

    .quick-student-summary-html {
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    .quick-student-summary-popup {
        width: 100%;
        box-sizing: border-box;
        max-height: calc(88dvh - 60px);
        padding: 0 1px max(8px, env(safe-area-inset-bottom));
    }

    .quick-student-photo-card,
    .quick-student-latest-card,
    .quick-student-assembly-card,
    .quick-student-subject-list,
    .quick-student-summary-actions {
        width: 100%;
        box-sizing: border-box;
    }

    .quick-student-photo-card {
        align-items: flex-start;
        gap: 10px;
        padding: 10px !important;
        margin-bottom: 8px !important;
        border-radius: 18px !important;
    }

    .quick-student-photo-card img {
        width: 74px !important;
        height: 74px !important;
        border-radius: 18px !important;
        border-width: 3px !important;
    }

    .quick-student-photo-card p:first-child {
        font-size: 0.98rem !important;
        line-height: 1.18 !important;
    }

    .quick-student-photo-card p {
        line-height: 1.28 !important;
    }

    .quick-student-photo-hint {
        display: block;
        line-height: 1.25;
    }

    .quick-student-latest-card {
        padding: 12px !important;
        margin-bottom: 8px !important;
        border-radius: 20px !important;
    }

    .quick-student-latest-row {
        gap: 8px !important;
    }

    .quick-student-latest-title {
        font-size: 1.12rem !important;
        line-height: 1.22 !important;
    }

    .quick-student-latest-status span {
        padding: 4px 9px !important;
        font-size: 0.75rem !important;
    }

    .quick-student-assembly-card {
        padding: 9px 10px !important;
        margin-bottom: 8px !important;
        border-radius: 16px !important;
    }

    .quick-student-subject-list {
        max-height: 23dvh !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin-bottom: 8px !important;
        border-radius: 16px !important;
    }

    .quick-student-summary-actions {
        gap: 7px !important;
        padding-top: 7px;
    }

    .quick-student-action-btn {
        min-height: 44px;
        padding: 10px 12px !important;
        border-radius: 16px !important;
        font-size: 0.92rem !important;
    }
}

@media screen {
    .swal2-popup.quick-student-dialog { display: flex !important; flex-direction: column; width: min(660px, calc(100vw - 24px)) !important; max-width: none !important; max-height: calc(100dvh - 24px); padding: 0 !important; border-radius: 8px !important; overflow: hidden; background: #fff; }
    .quick-student-dialog .swal2-title { flex: 0 0 auto; margin: 0; padding: 16px 52px 14px 16px !important; text-align: left; font-size: 18px !important; line-height: 1.5 !important; border-bottom: 1px solid #e2e8f0; }
    .quick-student-dialog .swal2-close { position: absolute; top: 9px !important; right: 8px !important; width: 44px !important; height: 44px !important; font-size: 30px !important; color: #64748b; border-radius: 6px; }
    .quick-dialog-heading { display: flex; align-items: center; gap: 8px; }
    .quick-dialog-heading button { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; font-size: 15px; color: #0369a1; border-radius: 6px; background: #f0f9ff; }
    .quick-student-dialog .swal2-html-container.quick-student-dialog-html { flex: 1 1 auto; min-height: 0; margin: 0 !important; padding: 14px 16px !important; width: 100% !important; max-width: none !important; overflow-y: auto !important; overflow-x: hidden !important; font-size: 14px !important; color: #334155; overscroll-behavior: contain; text-align: left; }
    .quick-student-dialog-html :is(p, strong, small, button, summary) { overflow-wrap: anywhere; letter-spacing: 0; }
    .quick-student-dialog .quick-student-summary-popup { max-height: none; overflow: visible; padding: 0; }
    .quick-lookup-search { position: sticky; top: 0; z-index: 2; padding: 4px 2px 8px; background: #fff; }
    .quick-lookup-search input { min-height: 48px; border-radius: 6px; font-size: 16px; }
    .quick-lookup-search input:focus { outline: 2px solid #0284c7; outline-offset: 1px; }
    .quick-lookup-empty { padding: 30px 8px; text-align: center; color: #64748b; }
    .quick-lookup-empty > i { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 50%; background: #f0f9ff; color: #0284c7; font-size: 20px; }
    .quick-lookup-empty p { font-weight: 600; font-size: 14px; }
    .quick-lookup-empty small { display: block; margin-top: 4px; font-size: 12px; }
    .quick-lookup-result { min-height: 68px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; background: #fff; }
    .quick-lookup-result:hover { background: #f0f9ff; }
    .quick-lookup-result img { width: 44px; height: 52px; border-radius: 6px; border: 0; box-shadow: none; }
    .quick-lookup-result p { line-height: 1.5; }
    .quick-student-dialog :is(.quick-student-photo-card, .quick-lookup-identity) { gap: 12px; padding: 0 0 12px !important; margin-bottom: 12px !important; border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0 !important; background: #fff; align-items: center; }
    .quick-student-dialog :is(.quick-student-photo-card, .quick-lookup-identity) img { display: block; width: 56px !important; height: 68px !important; border: 0 !important; border-radius: 6px !important; object-fit: cover; box-shadow: none; }
    .quick-lookup-photo { flex: 0 0 56px; border-radius: 6px; overflow: hidden; }
    .quick-student-dialog :is(.quick-student-photo-card, .quick-lookup-identity) p:first-child { font-size: 15px !important; line-height: 1.5 !important; }
    .quick-student-dialog .quick-student-latest-card { padding: 12px !important; border-radius: 6px !important; margin-bottom: 10px !important; box-shadow: none; background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
    .quick-student-dialog .quick-student-latest-card[data-status="ไม่ได้เช็ค"] { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
    .quick-student-dialog .quick-student-latest-card[data-status="ขาด"] { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
    .quick-student-dialog .quick-student-latest-card[data-status="ลา"] { background: #f0f9ff; color: #075985; border-color: #bae6fd; }
    .quick-student-dialog .quick-student-latest-title { font-size: 17px !important; line-height: 1.5 !important; }
    .quick-student-latest-row { flex-wrap: wrap; }
    .quick-student-latest-row > div:first-child { flex: 1 1 160px; }
    .quick-student-latest-status { font-size: 12px; }
    .quick-student-dialog .quick-student-latest-status span { border-radius: 4px; font-size: 12px !important; padding: 3px 6px !important; border-color: currentColor; }
    .quick-student-dialog .quick-student-assembly-card { border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0 !important; padding: 10px 0 !important; flex-wrap: wrap; }
    .quick-student-dialog .quick-student-subject-list { max-height: none !important; overflow: visible; border: 0; border-radius: 0 !important; padding: 0 !important; }
    .quick-student-dialog .quick-student-summary-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; position: sticky; bottom: -14px; margin: 0 -2px; padding: 10px 2px; background: #fff; border-top: 1px solid #e2e8f0; }
    .quick-student-dialog .quick-student-action-btn { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; min-height: 44px; padding: 8px 4px !important; border-radius: 6px !important; box-shadow: none; font-size: 12px !important; line-height: 1.4; font-weight: 600; }
    .quick-history-metrics { gap: 6px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
    .quick-history-metrics > div { border: 0; border-radius: 6px; padding: 8px 3px; }
    .quick-history-metrics p:last-child { font-size: 24px; line-height: 1.4; }
    .quick-history-group { margin-bottom: 12px; border-block: 1px solid #e2e8f0; }
    .quick-history-group summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 0; list-style: none; cursor: pointer; }
    .quick-history-group summary::-webkit-details-marker { display: none; }
    .quick-history-group summary > strong, .quick-history-group summary > div { flex: 1; min-width: 0; }
    .quick-history-group summary > span { flex: 0 0 auto; border: 0; border-radius: 4px; padding: 3px 6px; font-size: 12px; color: #9f1239; background: #fff1f2; }
    .quick-history-chevron { flex: 0 0 auto; color: #64748b; font-size: 10px; transition: transform 180ms ease; }
    .quick-history-group[open] > summary .quick-history-chevron { transform: rotate(180deg); }
    .quick-history-group summary p { font-size: 13px; line-height: 1.5; }
    .quick-history-group > div { padding-inline: 0; }
    .quick-history-group > div > div { min-height: 40px; gap: 8px; padding-block: 8px; }
    .quick-history-group > div > div > span:first-child { font-size: 12px; font-weight: 400; }
    .quick-history-copy { position: sticky; bottom: -14px; min-height: 44px; border-radius: 6px; font-size: 13px; }
    .quick-student-dialog :is(button, summary):focus-visible { outline: 2px solid #0284c7; outline-offset: -2px; }
    @media (max-width: 640px) {
        .swal2-popup.quick-student-dialog { max-height: calc(100dvh - 16px); width: calc(100vw - 16px) !important; }
        .quick-student-dialog .swal2-html-container.quick-student-dialog-html { padding: 12px !important; }
        .quick-student-dialog .swal2-title { font-size: 17px !important; padding: 12px 50px 12px 12px !important; }
        .quick-dialog-heading button { width: 36px; height: 44px; }
        .quick-student-dialog .quick-student-summary-actions, .quick-history-copy { bottom: -12px; }
    }
    @media (prefers-reduced-motion: reduce) { .quick-history-chevron { transition: none; } }
}

.sidebar-clock-wrap {
    padding: 2px 22px 14px;
}

.sidebar-clock-card {
    width: 100%;
    min-height: 72px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #111827;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.sidebar-clock-time {
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.sidebar-clock-date {
    max-width: 100%;
    padding: 0 0.7rem;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar nav ul {
    padding: 0 8px 14px;
}

#sidebar nav li {
    margin: 0;
}

#sidebar .nav-link,
#sidebar nav a:not(.nav-link) {
    --sidebar-icon-color: #38a9d6;
    --sidebar-icon-bg: #eef8ff;
    --sidebar-icon-border: #c7eaff;
    --sidebar-icon-shadow: rgba(56, 169, 214, 0.18);
    min-height: 51px;
    display: flex !important;
    align-items: center;
    gap: 13px;
    padding: 6px 14px !important;
    border-radius: 16px;
    color: #111827 !important;
    background: transparent !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

#sidebar .nav-link:hover,
#sidebar nav a:not(.nav-link):hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    transform: translateX(2px);
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

#sidebar .nav-link.bg-white\/20 {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.9)) !important;
    color: #0f172a !important;
    box-shadow: inset 4px 0 0 #38bdf8;
}

#sidebar .nav-link i,
#sidebar nav a:not(.nav-link) i {
    width: 40px !important;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-icon-color) !important;
    font-size: 20px;
    line-height: 1;
    text-align: center;
    border-radius: 14px;
    border: 1px solid var(--sidebar-icon-border);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.16) 38%, transparent 58%),
        linear-gradient(145deg, #ffffff 0%, var(--sidebar-icon-bg) 100%);
    box-shadow:
        0 8px 16px var(--sidebar-icon-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#sidebar .nav-link:hover i,
#sidebar nav a:not(.nav-link):hover i,
#sidebar .nav-link.bg-white\/20 i {
    transform: translateY(-1px) scale(1.04);
    box-shadow:
        0 10px 18px var(--sidebar-icon-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

#sidebar .nav-link.bg-white\/20 i {
    border-color: color-mix(in srgb, var(--sidebar-icon-color) 34%, #ffffff);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.18) 38%, transparent 58%),
        linear-gradient(145deg, #ffffff 0%, var(--sidebar-icon-bg) 72%, color-mix(in srgb, var(--sidebar-icon-color) 12%, #ffffff) 100%);
}

#sidebar .nav-link[data-target="dashboard"] {
    --sidebar-icon-color: #0ea5e9;
    --sidebar-icon-bg: #e0f2fe;
    --sidebar-icon-border: #bae6fd;
    --sidebar-icon-shadow: rgba(14, 165, 233, 0.2);
}

#sidebar .nav-link[data-target="live_monitor"] {
    --sidebar-icon-color: #22c55e;
    --sidebar-icon-bg: #dcfce7;
    --sidebar-icon-border: #bbf7d0;
    --sidebar-icon-shadow: rgba(34, 197, 94, 0.2);
}

#sidebar .nav-link[data-target*="scan"],
#sidebar .nav-link[data-target="scanning"] {
    --sidebar-icon-color: #475569;
    --sidebar-icon-bg: #f1f5f9;
    --sidebar-icon-border: #cbd5e1;
    --sidebar-icon-shadow: rgba(71, 85, 105, 0.16);
}

#sidebar .nav-link[data-target="assembly_report"],
#sidebar .nav-link[data-target="attendance_data"],
#sidebar .nav-link[data-target="summary"],
#sidebar .nav-link[data-target="gradebook"] {
    --sidebar-icon-color: #f59e0b;
    --sidebar-icon-bg: #fef3c7;
    --sidebar-icon-border: #fde68a;
    --sidebar-icon-shadow: rgba(245, 158, 11, 0.2);
}

#sidebar .nav-link[data-target="manual"],
#sidebar .nav-link[data-target="subjects"] {
    --sidebar-icon-color: #eab308;
    --sidebar-icon-bg: #fef9c3;
    --sidebar-icon-border: #fde68a;
    --sidebar-icon-shadow: rgba(234, 179, 8, 0.2);
}

#sidebar .nav-link[data-target="management"],
#sidebar .nav-link[data-target="teachers"],
#sidebar .nav-link[data-target*="history"] {
    --sidebar-icon-color: #3b82f6;
    --sidebar-icon-bg: #dbeafe;
    --sidebar-icon-border: #bfdbfe;
    --sidebar-icon-shadow: rgba(59, 130, 246, 0.2);
}

#sidebar .nav-link[data-target="manual_assembly"],
#sidebar .nav-link[data-target="manual_check"],
#sidebar .nav-link[data-target="settings"] {
    --sidebar-icon-color: #64748b;
    --sidebar-icon-bg: #f1f5f9;
    --sidebar-icon-border: #cbd5e1;
    --sidebar-icon-shadow: rgba(100, 116, 139, 0.16);
}

#sidebar .nav-link[data-target="enrollment"],
#sidebar .nav-link[data-target="my_profile"] {
    --sidebar-icon-color: #10b981;
    --sidebar-icon-bg: #d1fae5;
    --sidebar-icon-border: #a7f3d0;
    --sidebar-icon-shadow: rgba(16, 185, 129, 0.2);
}

#sidebar .nav-link[data-target="report"],
#sidebar .nav-link[data-target="student_card"],
#sidebar .nav-link[data-target="manage_exams"] {
    --sidebar-icon-color: #ef4444;
    --sidebar-icon-bg: #fee2e2;
    --sidebar-icon-border: #fecaca;
    --sidebar-icon-shadow: rgba(239, 68, 68, 0.2);
}

#sidebar .nav-link[data-target="randomizer"],
#sidebar .nav-link[data-target="scoring"],
#sidebar .nav-link[data-target="advisory_room"] {
    --sidebar-icon-color: #a855f7;
    --sidebar-icon-bg: #f3e8ff;
    --sidebar-icon-border: #e9d5ff;
    --sidebar-icon-shadow: rgba(168, 85, 247, 0.2);
}

#sidebar .nav-link[data-target="home_visit"] {
    --sidebar-icon-color: #14b8a6;
    --sidebar-icon-bg: #ccfbf1;
    --sidebar-icon-border: #99f6e4;
    --sidebar-icon-shadow: rgba(20, 184, 166, 0.2);
}

#sidebar nav a[onclick="performLogout()"] {
    --sidebar-icon-color: #ef4444;
    --sidebar-icon-bg: #fee2e2;
    --sidebar-icon-border: #fecaca;
    --sidebar-icon-shadow: rgba(239, 68, 68, 0.2);
    color: #b91c1c !important;
}

#sidebar li.mt-4 {
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.manual-bulk-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manual-bulk-actions .manual-bulk-btn {
    min-height: 50px;
    padding: 0.55rem 0.35rem;
    font-size: clamp(12px, 3.2vw, 16px);
    line-height: 1.15;
    white-space: nowrap;
}

.manual-bulk-actions .manual-bulk-btn i {
    flex: 0 0 auto;
    font-size: 0.95em;
}

.manual-bulk-actions .manual-import-icon-btn i {
    font-size: 1.25rem;
    margin: 0;
}

@media (min-width: 768px) {
    .manual-bulk-actions .manual-bulk-btn {
        min-height: 54px;
        padding: 0.7rem 0.75rem;
        font-size: 16px;
    }
}

.manual-subject-pending-grid {
    align-items: stretch;
}

.manual-subject-student-card {
    min-width: 0;
}

.manual-subject-student-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.manual-subject-photo-wrap {
    position: relative;
    flex: 0 0 auto;
}

.manual-subject-photo {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 999px;
}

.manual-subject-photo:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.manual-subject-photo-hint {
    display: none;
}

.manual-subject-student-info {
    min-width: 0;
    text-align: left;
}

.manual-assembly-profile-link {
    display: block;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: inherit;
    cursor: pointer;
}

.manual-assembly-profile-link:hover {
    color: #0369a1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.manual-assembly-profile-link:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 3px;
    border-radius: 2px;
}

.manual-subject-student-name {
    font-size: 1.08rem;
    line-height: 1.2;
}

.manual-subject-student-id {
    margin-top: 0.18rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.manual-subject-card-confirm {
    border-color: #86efac !important;
    background: #f0fdf4 !important;
    box-shadow: 0 18px 44px rgba(34, 197, 94, 0.24);
    animation: manualCardConfirm 620ms ease-out both;
}

.manual-subject-photo-confirm {
    animation: manualPhotoConfirm 420ms cubic-bezier(.2, 1.4, .34, 1) both;
}

.manual-subject-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.22), transparent 34%),
        radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.28), transparent 24%),
        radial-gradient(circle at 82% 78%, rgba(250, 204, 21, 0.24), transparent 26%),
        rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    animation: manualConfirmOverlay 1550ms ease both;
}

.manual-subject-confirm-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%);
    opacity: 0;
    animation: manualConfirmFlash 1550ms ease-out both;
}

.manual-subject-confirm-stage {
    position: relative;
    width: min(76vw, 760px);
    height: min(76vh, 760px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: manualConfirmStage 1550ms cubic-bezier(.18, 1.22, .28, 1) both;
}

.manual-subject-confirm-full-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 8px solid rgba(255, 255, 255, 0.92);
    border-radius: 2rem;
    box-shadow: 0 44px 100px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.32);
    animation: manualConfirmFullPhoto 1550ms cubic-bezier(.18, 1.22, .28, 1) both;
}

.manual-subject-confirm-check {
    position: absolute;
    right: 7%;
    bottom: 10%;
    width: clamp(5.2rem, 9vw, 8rem);
    height: clamp(5.2rem, 9vw, 8rem);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 24px 54px rgba(22, 163, 74, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    transform: scale(0);
    animation: manualConfirmCheck 980ms 430ms cubic-bezier(.2, 1.5, .34, 1) both;
}

.manual-subject-confirm-label {
    position: absolute;
    left: 50%;
    bottom: 3%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    padding: 0.65rem 1.15rem;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    opacity: 0;
    animation: manualConfirmLabel 980ms 500ms ease-out both;
}

.manual-subject-confirm-confetti {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.65rem;
    height: 1.15rem;
    border-radius: 0.22rem;
    background: #facc15;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: manualConfirmConfetti 1120ms 360ms ease-out both;
}

.manual-subject-confirm-confetti.confetti-1 { --x: -42vw; --y: -32vh; --r: -240deg; background: #facc15; animation-delay: 330ms; }
.manual-subject-confirm-confetti.confetti-2 { --x: -32vw; --y: 28vh; --r: 210deg; background: #38bdf8; animation-delay: 390ms; }
.manual-subject-confirm-confetti.confetti-3 { --x: -20vw; --y: -40vh; --r: 330deg; background: #fb7185; animation-delay: 430ms; }
.manual-subject-confirm-confetti.confetti-4 { --x: -12vw; --y: 36vh; --r: -180deg; background: #a78bfa; animation-delay: 470ms; }
.manual-subject-confirm-confetti.confetti-5 { --x: 8vw; --y: -38vh; --r: 260deg; background: #2dd4bf; animation-delay: 350ms; }
.manual-subject-confirm-confetti.confetti-6 { --x: 18vw; --y: 34vh; --r: -310deg; background: #f97316; animation-delay: 410ms; }
.manual-subject-confirm-confetti.confetti-7 { --x: 32vw; --y: -28vh; --r: 190deg; background: #22c55e; animation-delay: 450ms; }
.manual-subject-confirm-confetti.confetti-8 { --x: 42vw; --y: 24vh; --r: -260deg; background: #60a5fa; animation-delay: 500ms; }
.manual-subject-confirm-confetti.confetti-9 { --x: -46vw; --y: 2vh; --r: 300deg; background: #f472b6; animation-delay: 520ms; }
.manual-subject-confirm-confetti.confetti-10 { --x: 46vw; --y: -4vh; --r: -220deg; background: #fde047; animation-delay: 530ms; }
.manual-subject-confirm-confetti.confetti-11 { --x: -30vw; --y: -8vh; --r: 170deg; background: #34d399; animation-delay: 560ms; }
.manual-subject-confirm-confetti.confetti-12 { --x: 28vw; --y: 10vh; --r: -170deg; background: #c084fc; animation-delay: 580ms; }
.manual-subject-confirm-confetti.confetti-13 { --x: -8vw; --y: -46vh; --r: 280deg; background: #f59e0b; animation-delay: 600ms; }
.manual-subject-confirm-confetti.confetti-14 { --x: 4vw; --y: 44vh; --r: -300deg; background: #06b6d4; animation-delay: 620ms; }
.manual-subject-confirm-confetti.confetti-15 { --x: -40vw; --y: 18vh; --r: 240deg; background: #ef4444; animation-delay: 640ms; }
.manual-subject-confirm-confetti.confetti-16 { --x: 38vw; --y: -18vh; --r: -240deg; background: #84cc16; animation-delay: 660ms; }
.manual-subject-confirm-confetti.confetti-17 { --x: -18vw; --y: 44vh; --r: 210deg; background: #818cf8; animation-delay: 690ms; }
.manual-subject-confirm-confetti.confetti-18 { --x: 18vw; --y: -44vh; --r: -210deg; background: #fb923c; animation-delay: 720ms; }
@keyframes manualCardConfirm {
    0% { transform: scale(1); }
    45% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

@keyframes manualPhotoConfirm {
    0% { transform: scale(1); filter: saturate(1); }
    60% { transform: scale(1.05); filter: saturate(1.25) brightness(1.06); }
    100% { transform: scale(1.01); filter: saturate(1.08); }
}

@keyframes manualConfirmOverlay {
    0% { opacity: 0; }
    10% { opacity: 1; }
    86% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes manualConfirmFlash {
    0% { opacity: 0; transform: scale(0.6); }
    10% { opacity: 0.9; transform: scale(1); }
    28% { opacity: 0; transform: scale(1.45); }
    100% { opacity: 0; transform: scale(1.45); }
}

@keyframes manualConfirmStage {
    0% { transform: scale(0.18) rotate(-3deg); }
    24% { transform: scale(1.08) rotate(0.8deg); }
    46% { transform: scale(0.99) rotate(0deg); }
    82% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(0.9) rotate(1deg); }
}

@keyframes manualConfirmFullPhoto {
    0% { transform: rotate(-2deg); filter: saturate(1) brightness(0.98); }
    24% { transform: rotate(0deg); filter: saturate(1.34) brightness(1.1); }
    70% { transform: rotate(0deg); filter: saturate(1.22) brightness(1.05); }
    100% { transform: rotate(1deg); filter: saturate(1.05) brightness(1); }
}

@keyframes manualConfirmCheck {
    0% { opacity: 0; transform: scale(0.2) rotate(-18deg); }
    35% { opacity: 1; transform: scale(1.18) rotate(4deg); }
    72% { opacity: 1; transform: scale(1) rotate(0deg); }
    100% { opacity: 0; transform: scale(0.82) rotate(0deg); }
}

@keyframes manualConfirmLabel {
    0% { opacity: 0; transform: translate(-50%, 1rem) scale(0.9); }
    45% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    82% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -0.35rem) scale(0.96); }
}

@keyframes manualConfirmConfetti {
    0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.5); }
    16% { opacity: 1; }
    72% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 4vh)) rotate(calc(var(--r) + 90deg)) scale(0.65); }
}

@media (min-width: 1024px) {
    .manual-subject-page {
        padding: 1.5rem;
    }

    #manual-pending-list.manual-subject-pending-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 1.25rem;
    }

    .manual-subject-student-card {
        min-height: 31rem;
        justify-content: space-between;
    }

    .manual-subject-student-main {
        flex: 1 1 auto;
        flex-direction: column;
        justify-content: flex-start;
        text-align: center;
    }

    .manual-subject-photo-wrap {
        width: 100%;
        display: flex;
        justify-content: center;
        padding-top: 0.2rem;
    }

    .manual-subject-photo {
        width: min(22vw, 20rem);
        height: min(22vw, 20rem);
        border-radius: 1.6rem;
        border-width: 4px;
    }

    .manual-subject-photo-hint {
        position: absolute;
        right: 50%;
        bottom: 0.5rem;
        display: inline-flex;
        align-items: center;
        gap: 0.28rem;
        transform: translateX(50%);
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.68);
        color: #fff;
        padding: 0.25rem 0.55rem;
        font-size: 0.68rem;
        font-weight: 900;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.16s ease;
    }

    .manual-subject-photo-wrap:hover .manual-subject-photo-hint {
        opacity: 1;
    }

    .manual-subject-student-info {
        width: 100%;
        text-align: center;
    }

    .manual-subject-student-name {
        font-size: 1.25rem;
    }

    .manual-subject-student-id {
        font-size: 1rem;
    }

    .manual-subject-status-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .manual-subject-status-btn {
        min-height: 3.1rem;
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
        font-size: 1.08rem !important;
    }

    #manual-checked-list.manual-subject-checked-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 0.65rem;
    }
}

@media (min-width: 1440px) {
    #manual-pending-list.manual-subject-pending-grid {
        grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
    }

    .manual-subject-student-card {
        min-height: 34rem;
    }

    .manual-subject-photo {
        width: min(24vw, 23rem);
        height: min(24vw, 23rem);
    }

    .manual-subject-student-name {
        font-size: 1.38rem;
    }

    .manual-subject-student-id {
        font-size: 1.08rem;
    }
}

@media (max-width: 767px) {
    #sidebar.app-sidebar {
        width: min(286px, 86vw) !important;
    }

    .sidebar-brand-panel {
        padding-top: 28px;
    }
}

@media (min-width: 768px) {
    #sidebar.app-sidebar {
        flex: 0 0 286px;
        width: 286px !important;
        transition: width 0.24s ease, flex-basis 0.24s ease, transform 0.3s ease;
    }

    #sidebar .sidebar-brand-panel {
        display: none;
    }

    #sidebar .sidebar-clock-wrap {
        display: none;
    }

    #sidebar .nav-link,
    #sidebar nav a:not(.nav-link) {
        font-size: 14px;
    }

    body.on-dashboard #page-title .dashboard-title-brand {
        display: flex !important;
    }

    body.sidebar-compact #sidebar.app-sidebar {
        flex-basis: 56px;
        width: 56px !important;
        min-width: 56px;
        overflow-x: hidden;
        box-shadow: none;
    }

    body.sidebar-compact #sidebar .sidebar-compact-toggle-row {
        justify-content: center;
        padding: 8px 0 6px;
        border-bottom: 1px solid #e5e7eb;
    }

    body.sidebar-compact #sidebar .sidebar-mode-toggle {
        width: 40px;
        height: 40px;
        border-radius: 0;
        color: #6b7280;
        background: transparent;
    }

    body.sidebar-compact #sidebar .sidebar-clock-wrap {
        display: none;
    }

    body.sidebar-compact #sidebar nav {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    body.sidebar-compact #sidebar nav ul {
        padding: 0;
    }

    body.sidebar-compact #sidebar nav li {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    body.sidebar-compact #sidebar .nav-link,
    body.sidebar-compact #sidebar nav a:not(.nav-link) {
        --sidebar-icon-color: #71717a;
        --sidebar-icon-bg: transparent;
        --sidebar-icon-border: transparent;
        --sidebar-icon-shadow: rgba(0, 0, 0, 0);
        width: 100%;
        min-height: 48px;
        justify-content: center;
        gap: 0;
        padding: 4px 0 !important;
        border-radius: 0;
        font-size: 0;
        line-height: 0;
        color: transparent !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none;
    }

    body.sidebar-compact #sidebar .nav-link:hover,
    body.sidebar-compact #sidebar nav a:not(.nav-link):hover {
        background: #f3f4f6 !important;
        transform: none;
        box-shadow: none;
    }

    body.sidebar-compact #sidebar .nav-link.bg-white\/20 {
        background: #e0f2fe !important;
        box-shadow: inset 3px 0 0 #0ea5e9 !important;
    }

    body.sidebar-compact #sidebar .nav-link i,
    body.sidebar-compact #sidebar nav a:not(.nav-link) i {
        width: 44px !important;
        min-width: 44px;
        height: 44px;
        border: 0;
        border-radius: 8px;
        color: #737373 !important;
        background: transparent;
        box-shadow: none;
        font-size: 18px;
        transform: none;
    }

    body.sidebar-compact #sidebar .nav-link:hover i,
    body.sidebar-compact #sidebar nav a:not(.nav-link):hover i {
        color: #525252 !important;
        transform: none;
        box-shadow: none;
    }

    body.sidebar-compact #sidebar .nav-link.bg-white\/20 i {
        color: #0284c7 !important;
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    body.sidebar-compact #sidebar li.mt-4 {
        margin-top: 8px !important;
        padding-top: 8px !important;
        border-top: 1px solid #e5e7eb !important;
    }
}
#topbar-notification-button {
    flex: 0 0 auto;
}

.topbar-notification-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    color: #0284c7;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.topbar-notification-button:hover {
    color: #0369a1;
    border-color: #7dd3fc;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.16);
    transform: translateY(-1px);
}

.topbar-notification-button > i {
    font-size: 1.18rem;
}

.topbar-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 3px solid #f3f4f6;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    font-size: 0.67rem;
    font-weight: 900;
    line-height: 1;
    z-index: 3;
}

.topbar-notification-badge.hidden {
    display: none !important;
}

.topbar-notification-badge:not(.hidden) {
    display: grid !important;
}

.topbar-notification-badge.is-updated {
    animation: klassin-notification-badge-pop 400ms ease-out;
}

.topbar-notification-button.has-unread > i {
    color: #0284c7;
}

@keyframes klassin-notification-badge-pop {
    0% { transform: scale(0.7); }
    55% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

body.klassin-notification-open {
    overflow: hidden;
}

.klassin-notification-drawer {
    position: fixed;
    inset: 0;
    z-index: 10050;
}

body.klassin-notification-open #modal-student-full-profile { z-index: 10060; }
body.klassin-notification-open #modal-image-preview { z-index: 10070; }
body.klassin-notification-open .swal2-container { z-index: 10080; }

.klassin-notification-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 220ms ease;
}

.klassin-notification-panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(430px, 100%);
    height: 100%;
    background: #f8fafc;
    box-shadow: -20px 0 55px rgba(15, 23, 42, 0.2);
    transform: translateX(102%);
    transition: transform 220ms ease;
}

.klassin-notification-drawer.is-open .klassin-notification-backdrop {
    opacity: 1;
}

.klassin-notification-drawer.is-open .klassin-notification-panel {
    transform: translateX(0);
}

.klassin-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    padding: max(18px, env(safe-area-inset-top)) 22px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.klassin-notification-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #0284c7;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.klassin-notification-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.25;
}

.klassin-notification-header h2 i {
    margin-right: 7px;
    color: #0ea5e9;
}

.klassin-notification-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #475569;
    background: #f8fafc;
    transition: background 160ms ease, color 160ms ease;
}

.klassin-notification-close:hover {
    color: #dc2626;
    background: #fee2e2;
}

.klassin-notification-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.klassin-push-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
}

.klassin-push-status-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #64748b;
    background: #e2e8f0;
}

.klassin-push-status-icon.is-active {
    color: #047857;
    background: #d1fae5;
}

.klassin-push-status-icon.is-error {
    color: #b91c1c;
    background: #fee2e2;
}

.klassin-push-status-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.klassin-push-status-copy strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.klassin-push-status-copy span {
    overflow: hidden;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.klassin-push-device-count {
    padding: 5px 8px;
    border-radius: 999px;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 0.7rem;
    font-weight: 900;
    white-space: nowrap;
}

.klassin-notification-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.klassin-notification-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.2;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.klassin-notification-action:hover:not(:disabled) {
    border-color: #7dd3fc;
    box-shadow: 0 7px 16px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.klassin-notification-action.is-primary {
    border-color: #0284c7;
    color: #fff;
    background: #0284c7;
}

.klassin-notification-action.is-announcement {
    border-color: #fdba74;
    color: #9a3412;
    background: #fff7ed;
}

.klassin-notification-action.is-announcement:hover:not(:disabled) {
    border-color: #f97316;
    box-shadow: 0 7px 16px rgba(249, 115, 22, 0.16);
}

.klassin-notification-action:disabled,
.klassin-notification-action.is-busy {
    cursor: wait;
    opacity: 0.55;
}

.klassin-push-guidance {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 10px;
    padding: 11px 12px;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    background: #fffbeb;
    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1.55;
}

.klassin-announcement-form {
    display: grid;
    gap: 8px;
    text-align: left;
}

.klassin-announcement-form label,
.klassin-announcement-label {
    margin-top: 6px;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 900;
}

.klassin-announcement-form .swal2-input,
.klassin-announcement-form .swal2-textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.94rem;
}

.klassin-announcement-form .swal2-textarea {
    min-height: 132px;
    resize: vertical;
}

.klassin-announcement-modal {
    max-height: calc(100dvh - 24px);
}

.klassin-announcement-modal-content {
    width: 100%;
    max-height: calc(100dvh - 210px);
    margin: 0.75em 0 0 !important;
    padding: 0 3px 3px;
    overflow-y: auto;
}

.klassin-recipient-picker {
    padding: 8px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #f8fafc;
}

.klassin-recipient-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.klassin-recipient-tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 44px;
    padding: 7px 8px;
    border: 1px solid #dbe4ee;
    border-radius: 7px;
    color: #475569;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.klassin-recipient-tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.klassin-recipient-tab small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 11px;
    color: #64748b;
    background: #eef2f7;
    font-size: 0.65rem;
    font-weight: 900;
}

.klassin-recipient-tab.is-active {
    border-color: #60a5fa;
    color: #1d4ed8;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.klassin-recipient-tab.is-active small {
    color: #fff;
    background: #3b82f6;
}

.klassin-recipient-tab:focus-visible,
.klassin-recipient-option:focus-visible,
.klassin-recipient-search:focus-within {
    outline: 3px solid rgba(59, 130, 246, 0.2);
    outline-offset: 1px;
}

.klassin-recipient-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 44px;
    margin: 0 0 8px !important;
    padding: 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #64748b !important;
    background: #fff;
}

.klassin-recipient-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #0f172a;
    background: transparent;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
}

.klassin-recipient-search input::placeholder {
    color: #94a3b8;
}

.klassin-recipient-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 238px;
    padding: 1px 2px 1px 1px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.klassin-recipient-option {
    position: relative;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 62px;
    padding: 9px 10px;
    border: 1px solid #dbe4ee;
    border-radius: 7px;
    text-align: left;
    color: #334155;
    background: #fff;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.klassin-recipient-option.is-level {
    grid-column: auto;
    min-height: 70px;
    padding: 8px;
    gap: 7px;
}

.klassin-recipient-option[hidden],
.klassin-recipient-empty.hidden {
    display: none;
}

.klassin-recipient-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.klassin-recipient-option:active {
    transform: scale(0.99);
}

.klassin-recipient-option.is-selected {
    border-color: #3b82f6;
    color: #1e3a8a;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.klassin-recipient-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    color: #2563eb;
    background: #dbeafe;
    font-size: 0.95rem;
}

.klassin-recipient-option.is-level .klassin-recipient-option-icon {
    width: 34px;
    height: 34px;
}

.klassin-recipient-option-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.klassin-recipient-option-copy strong {
    overflow-wrap: anywhere;
    color: inherit;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.3;
}

.klassin-recipient-option-copy small {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
}

.klassin-recipient-option-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: transparent;
    background: #f1f5f9;
    font-size: 0.7rem;
}

.klassin-recipient-option.is-selected .klassin-recipient-option-check {
    color: #fff;
    background: #2563eb;
}

.klassin-recipient-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 84px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 800;
}

.klassin-announcement-target-detail {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    color: #1e3a8a;
    background: #eff6ff;
}

.klassin-announcement-target-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 7px;
    color: #fff;
    background: #2563eb;
}

.klassin-announcement-target-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.klassin-announcement-target-copy small {
    color: #64748b;
    font-size: 0.67rem;
    font-weight: 800;
}

.klassin-announcement-target-copy strong {
    overflow-wrap: anywhere;
    color: #1e3a8a;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.3;
}

.klassin-announcement-target-copy span {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.klassin-announcement-actions {
    gap: 8px;
    margin-top: 1em !important;
}

.klassin-announcement-actions .swal2-styled {
    min-height: 46px;
    margin: 0;
    border-radius: 7px;
    font-family: inherit;
    font-weight: 900;
}

.klassin-notification-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 2px 10px;
}

.klassin-notification-list-header > div {
    display: flex;
    flex-direction: column;
}

.klassin-notification-list-header strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.klassin-notification-list-header span {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
}

.klassin-notification-list-header button {
    padding: 7px 9px;
    border-radius: 6px;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 0.72rem;
    font-weight: 900;
}

.klassin-notification-list-header button:disabled {
    cursor: default;
    color: #94a3b8;
    background: #e2e8f0;
}

.klassin-notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.klassin-notification-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.klassin-notification-item:hover {
    border-color: #7dd3fc;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.klassin-notification-item.is-unread {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.klassin-notification-item.is-expanded {
    border-color: #38bdf8;
    background: #fff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.12);
}

.klassin-notification-item-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 50%;
    color: #2563eb;
    background: #dbeafe;
}

.klassin-notification-item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.klassin-notification-item-copy strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.klassin-notification-item-copy > span {
    display: -webkit-box;
    overflow: hidden;
    color: #475569;
    font-size: 0.77rem;
    font-weight: 600;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.klassin-notification-item.is-expanded .klassin-notification-item-copy strong {
    overflow: visible;
    font-size: 1rem;
    line-height: 1.5;
    text-overflow: clip;
    white-space: normal;
}

.klassin-notification-item.is-expanded .klassin-notification-body {
    display: block;
    overflow: visible;
    padding: 4px 0 3px;
    color: #334155;
    font-size: 1rem;
    line-height: 1.75;
    white-space: pre-line;
    -webkit-line-clamp: unset;
}

.klassin-notification-item.is-expanded .klassin-notification-item-copy time {
    font-size: 0.75rem;
}

.klassin-notification-item-copy time {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
}

.klassin-notification-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 0 4px #e0f2fe;
}

.klassin-notification-item-state {
    display: flex;
    min-width: 22px;
    align-items: center;
    flex-direction: column;
    gap: 12px;
}

.klassin-notification-expand-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #64748b;
    background: #f1f5f9;
    font-size: 0.62rem;
    transition: color 160ms ease, background 160ms ease, transform 180ms ease;
}

.klassin-notification-item.is-expanded .klassin-notification-expand-icon {
    color: #0369a1;
    background: #e0f2fe;
    transform: rotate(180deg);
}

.klassin-notification-empty {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #94a3b8;
    text-align: center;
}

.klassin-notification-empty i {
    font-size: 2rem;
    opacity: 0.55;
}

.klassin-notification-empty strong {
    font-size: 0.86rem;
}

/* System settings hub */
body.system-settings-modal-open {
    overflow: hidden;
}

.system-settings-page-shell {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 18px;
}

.system-settings-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: #0f172a;
    font-size: 1.55rem;
    font-weight: 900;
}

.system-settings-page-title i {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #0284c7;
    background: #f0f9ff;
}

.system-settings-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.system-settings-menu-card {
    --settings-tone: #475569;
    --settings-tone-2: #64748b;
    --settings-soft: #f8fafc;
    position: relative;
    isolation: isolate;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
    grid-template-rows: auto auto auto;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 10px 7px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--settings-tone) 30%, white);
    border-radius: 8px;
    color: #172033;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0 42%, transparent 72%),
        linear-gradient(155deg, var(--settings-soft) 0%, color-mix(in srgb, var(--settings-tone) 12%, white) 100%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09);
    text-align: center;
    transform: translateZ(0);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.system-settings-menu-card::before,
.system-settings-menu-card::after {
    position: absolute;
    content: '';
    pointer-events: none;
}

.system-settings-menu-card::before {
    inset: -28%;
    z-index: -2;
    opacity: 0.34;
    background: repeating-linear-gradient(135deg, transparent 0 20px, color-mix(in srgb, var(--settings-tone) 20%, transparent) 20px 21px);
    animation: systemSettingsBackdropDrift 13s linear infinite;
}

.system-settings-menu-card::after {
    right: -18%;
    bottom: -36%;
    z-index: -1;
    width: 72%;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--settings-tone) 18%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--settings-tone) 7%, transparent);
    transform: rotate(24deg);
    transition: transform 280ms ease;
}

.system-settings-menu-card:hover,
.system-settings-menu-card:focus-visible {
    border-color: var(--settings-tone);
    box-shadow: 0 12px 25px color-mix(in srgb, var(--settings-tone) 20%, transparent);
    outline: none;
    transform: translateY(-3px);
}

.system-settings-menu-card:hover::after,
.system-settings-menu-card:focus-visible::after {
    transform: rotate(17deg) translate(-5%, -5%);
}

.system-settings-menu-card:active {
    transform: translateY(-1px) scale(0.985);
}

.system-settings-menu-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--settings-tone-2), var(--settings-tone));
    box-shadow:
        0 7px 15px color-mix(in srgb, var(--settings-tone) 30%, transparent),
        inset 0 1px rgba(255, 255, 255, 0.34);
    font-size: 1.32rem;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.system-settings-menu-icon i {
    position: relative;
    z-index: 2;
}

.system-settings-menu-card:hover .system-settings-menu-icon,
.system-settings-menu-card:focus-visible .system-settings-menu-icon {
    box-shadow:
        0 10px 20px color-mix(in srgb, var(--settings-tone) 36%, transparent),
        inset 0 1px rgba(255, 255, 255, 0.42);
    transform: scale(1.06);
}

.system-settings-menu-card strong {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 2.6em;
    width: 100%;
    place-items: center;
    color: #172033;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.system-settings-menu-card small {
    position: relative;
    z-index: 1;
    display: none;
    max-width: 95%;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
}

.tone-cyan { --settings-tone: #0891b2; --settings-tone-2: #2563eb; --settings-soft: #ecfeff; }
.tone-teal { --settings-tone: #0f766e; --settings-tone-2: #14b8a6; --settings-soft: #f0fdfa; }
.tone-indigo { --settings-tone: #4f46e5; --settings-tone-2: #818cf8; --settings-soft: #eef2ff; }
.tone-green { --settings-tone: #16a34a; --settings-tone-2: #10b981; --settings-soft: #f0fdf4; }
.tone-rose { --settings-tone: #e11d48; --settings-tone-2: #f97316; --settings-soft: #fff1f2; }
.tone-amber { --settings-tone: #d97706; --settings-tone-2: #f59e0b; --settings-soft: #fffbeb; }
.tone-violet { --settings-tone: #7c3aed; --settings-tone-2: #a855f7; --settings-soft: #f5f3ff; }
.tone-blue { --settings-tone: #2563eb; --settings-tone-2: #0ea5e9; --settings-soft: #eff6ff; }
.tone-emerald { --settings-tone: #059669; --settings-tone-2: #22c55e; --settings-soft: #ecfdf5; }
.tone-sky { --settings-tone: #0284c7; --settings-tone-2: #38bdf8; --settings-soft: #f0f9ff; }
.tone-orange { --settings-tone: #ea580c; --settings-tone-2: #f59e0b; --settings-soft: #fff7ed; }

.system-settings-menu-card[data-system-setting-key="scan"]::before {
    inset: 0;
    opacity: 0.44;
    background: repeating-linear-gradient(0deg, transparent 0 17px, color-mix(in srgb, #0891b2 18%, transparent) 17px 18px);
    animation: systemSettingsScanGrid 5s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="scan"] .system-settings-menu-icon::after,
.system-settings-menu-card[data-system-setting-key="student_card"] .system-settings-menu-icon::after {
    position: absolute;
    right: 6px;
    left: 6px;
    z-index: 3;
    height: 2px;
    content: '';
    background: #a5f3fc;
    box-shadow: 0 0 7px #ecfeff;
    animation: systemSettingsScanLine 2.2s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="buddy"]::before {
    inset: -10%;
    opacity: 0.28;
    background-image:
        linear-gradient(color-mix(in srgb, #0f766e 20%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, #0f766e 20%, transparent) 1px, transparent 1px);
    background-size: 24px 24px;
    animation: systemSettingsCircuitMove 9s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="buddy"] .system-settings-menu-icon i {
    animation: systemSettingsBuddyBob 2.6s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="buddy"] .system-settings-menu-icon::after {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 10px;
    height: 10px;
    border-top: 2px solid #ccfbf1;
    border-right: 2px solid #ccfbf1;
    border-radius: 0 7px 0 0;
    content: '';
    animation: systemSettingsSignalPulse 1.8s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="version"]::before {
    opacity: 0.3;
    background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, #4f46e5 21%, transparent) 14px 16px, transparent 16px 28px);
    animation-duration: 10s;
}

.system-settings-menu-card[data-system-setting-key="version"] .system-settings-menu-icon::after {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 3;
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    content: 'v';
    color: #312e81;
    background: #eef2ff;
    font-size: 0.62rem;
    font-weight: 900;
    animation: systemSettingsBadgePop 2.8s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="registration"]::before {
    inset: 0;
    opacity: 0.24;
    background-image:
        linear-gradient(90deg, transparent 46%, color-mix(in srgb, #16a34a 24%, transparent) 46% 54%, transparent 54%),
        linear-gradient(transparent 46%, color-mix(in srgb, #16a34a 24%, transparent) 46% 54%, transparent 54%);
    background-size: 34px 34px;
    animation: systemSettingsCircuitMove 12s linear infinite reverse;
}

.system-settings-menu-card[data-system-setting-key="registration"] .system-settings-menu-icon::after {
    position: absolute;
    top: 2px;
    right: 3px;
    z-index: 3;
    content: '+';
    color: #dcfce7;
    font-size: 1.05rem;
    font-weight: 900;
    animation: systemSettingsBadgePop 2s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="theme"]::before {
    inset: -45%;
    opacity: 0.22;
    background: conic-gradient(from 45deg, #e11d48, #f59e0b, #16a34a, #0ea5e9, #7c3aed, #e11d48);
    animation: systemSettingsThemeWheel 18s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="theme"] .system-settings-menu-icon {
    background: conic-gradient(from 30deg, #f97316, #eab308, #22c55e, #0ea5e9, #7c3aed, #e11d48, #f97316);
}

.system-settings-menu-card[data-system-setting-key="theme"] .system-settings-menu-icon i {
    animation: systemSettingsPaletteTilt 3.4s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="student_card"]::before {
    inset: 0;
    opacity: 0.27;
    background: repeating-linear-gradient(90deg, transparent 0 8px, color-mix(in srgb, #d97706 22%, transparent) 8px 10px, transparent 10px 16px);
    animation: systemSettingsBarcodeMove 8s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="student_card"] .system-settings-menu-icon::after {
    right: auto;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: 2px;
    height: auto;
    background: #fef3c7;
    animation: systemSettingsCardRead 2.5s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="face_accuracy"]::before {
    inset: -20%;
    opacity: 0.28;
    background: repeating-radial-gradient(circle at 50% 50%, transparent 0 20px, color-mix(in srgb, #7c3aed 24%, transparent) 20px 22px, transparent 22px 38px);
    animation: systemSettingsTargetPulse 5s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="face_accuracy"] .system-settings-menu-icon i {
    animation: systemSettingsFocusPulse 2.4s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="assembly_time"]::before {
    inset: -34%;
    opacity: 0.24;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, #2563eb 28%, transparent) 0deg 2deg, transparent 2deg 30deg);
    animation: systemSettingsClockSweep 20s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="assembly_time"] .system-settings-menu-icon i {
    animation: systemSettingsClockTick 2s steps(4, end) infinite;
}

.system-settings-menu-card[data-system-setting-key="backup"]::before {
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(90deg, color-mix(in srgb, #2563eb 18%, transparent) 1px, transparent 1px),
        linear-gradient(color-mix(in srgb, #10b981 16%, transparent) 1px, transparent 1px);
    background-size: 26px 26px;
    animation: systemSettingsBackupGrid 8s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="backup"] .system-settings-menu-icon i {
    animation: systemSettingsBackupDrop 2.8s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="fcm"]::before {
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(30deg, transparent 47%, color-mix(in srgb, #ea580c 24%, transparent) 48% 51%, transparent 52%),
        linear-gradient(-30deg, transparent 47%, color-mix(in srgb, #2563eb 17%, transparent) 48% 51%, transparent 52%);
    background-size: 38px 32px;
    animation: systemSettingsFirebaseFlow 9s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="fcm"] .system-settings-menu-icon i {
    animation: systemSettingsFirebasePulse 2.6s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="line"]::before {
    inset: -12%;
    opacity: 0.26;
    background:
        linear-gradient(35deg, transparent 46%, color-mix(in srgb, #059669 22%, transparent) 46% 51%, transparent 51%),
        linear-gradient(-35deg, transparent 46%, color-mix(in srgb, #22c55e 18%, transparent) 46% 51%, transparent 51%);
    background-size: 42px 28px;
    animation: systemSettingsChatFlow 9s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="line"] .system-settings-menu-icon i {
    animation: systemSettingsMessagePop 2.5s ease-in-out infinite;
}

.system-settings-menu-card[data-system-setting-key="telegram"]::before {
    inset: -30%;
    opacity: 0.31;
    background: repeating-linear-gradient(145deg, transparent 0 22px, color-mix(in srgb, #0284c7 23%, transparent) 22px 24px, transparent 24px 44px);
    animation: systemSettingsTelegramRoute 8s linear infinite;
}

.system-settings-menu-card[data-system-setting-key="telegram"] .system-settings-menu-icon i {
    animation: systemSettingsPlaneFlight 3.2s ease-in-out infinite;
}

.teacher-backup-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 22px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 253, 245, 0.82)),
        repeating-linear-gradient(90deg, transparent 0 30px, rgba(37, 99, 235, 0.06) 30px 31px);
}

.teacher-backup-panel-visual {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
}

.teacher-backup-panel-visual > span {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    font-size: 1.35rem;
}

.teacher-backup-panel-visual > span:last-child {
    border-color: #bbf7d0;
    background: #16a34a;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.18);
}

.teacher-backup-panel-visual > i {
    font-size: 0.72rem;
}

.teacher-backup-panel-copy {
    min-width: 0;
}

.teacher-backup-panel-copy > strong {
    display: block;
    color: #172033;
    font-size: 1.05rem;
    font-weight: 900;
}

.teacher-backup-panel-copy > p {
    margin-top: 5px;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.65;
}

.teacher-backup-safety {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    color: #047857;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.5;
}

.teacher-backup-safety i {
    margin-top: 2px;
}

.teacher-backup-action {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 17px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 9px 20px rgba(37, 99, 235, 0.24);
    font-size: 0.88rem;
    font-weight: 900;
    white-space: nowrap;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.teacher-backup-action:hover,
.teacher-backup-action:focus-visible {
    background: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
    outline: none;
    transform: translateY(-2px);
}

.teacher-backup-confirmation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.teacher-backup-confirmation > div {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 6px 9px;
    padding: 13px 10px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    color: #2563eb;
    background: #eff6ff;
}

.teacher-backup-confirmation strong {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 900;
}

.teacher-backup-confirmation span {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.teacher-backup-confirmation-note {
    color: #475569;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.6;
}

.teacher-backup-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
}

.teacher-backup-progress-ring {
    --teacher-backup-progress: 0deg;
    position: relative;
    display: grid;
    width: 112px;
    height: 112px;
    margin-bottom: 8px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#2563eb 0 var(--teacher-backup-progress), #e2e8f0 var(--teacher-backup-progress) 360deg);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
}

.teacher-backup-progress-ring::before {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    content: '';
    background: #fff;
}

.teacher-backup-progress-ring span {
    position: relative;
    z-index: 1;
    color: #1d4ed8;
    font-size: 1.4rem;
    font-weight: 900;
}

.teacher-backup-progress > strong {
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
}

.teacher-backup-progress > p {
    max-width: 360px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .teacher-backup-panel {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 17px;
    }

    .teacher-backup-panel-visual {
        justify-content: center;
    }

    .teacher-backup-panel-copy {
        text-align: center;
    }

    .teacher-backup-safety {
        justify-content: center;
        text-align: left;
    }

    .teacher-backup-action {
        width: 100%;
    }
}

@keyframes systemSettingsBackdropDrift {
    to { transform: translate3d(40px, 40px, 0); }
}

@keyframes systemSettingsScanGrid {
    from { background-position: 0 0; }
    to { background-position: 0 36px; }
}

@keyframes systemSettingsScanLine {
    0%, 100% { top: 8px; opacity: 0.35; }
    50% { top: calc(100% - 10px); opacity: 1; }
}

@keyframes systemSettingsBackupGrid {
    to { background-position: 26px 26px; }
}

@keyframes systemSettingsBackupDrop {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(3px); }
}

@keyframes systemSettingsCircuitMove {
    to { background-position: 48px 24px; }
}

@keyframes systemSettingsBuddyBob {
    0%, 100% { transform: translateY(1px) rotate(-2deg); }
    50% { transform: translateY(-2px) rotate(2deg); }
}

@keyframes systemSettingsSignalPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes systemSettingsBadgePop {
    0%, 100% { transform: scale(0.86); }
    50% { transform: scale(1.08); }
}

@keyframes systemSettingsThemeWheel {
    to { transform: rotate(360deg); }
}

@keyframes systemSettingsPaletteTilt {
    0%, 100% { transform: rotate(-7deg); }
    50% { transform: rotate(8deg); }
}

@keyframes systemSettingsBarcodeMove {
    to { background-position: 48px 0; }
}

@keyframes systemSettingsCardRead {
    0%, 100% { left: 7px; opacity: 0.35; }
    50% { left: calc(100% - 9px); opacity: 1; }
}

@keyframes systemSettingsTargetPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.18; }
    50% { transform: scale(1.08); opacity: 0.34; }
}

@keyframes systemSettingsFocusPulse {
    0%, 100% { transform: scale(0.9); }
    50% { transform: scale(1.12); }
}

@keyframes systemSettingsClockSweep {
    to { transform: rotate(360deg); }
}

@keyframes systemSettingsClockTick {
    to { transform: rotate(18deg); }
}

@keyframes systemSettingsFirebaseFlow {
    to { background-position: 76px 0, -76px 0; }
}

@keyframes systemSettingsFirebasePulse {
    0%, 100% { transform: translateY(1px) scale(0.94); filter: brightness(1); }
    50% { transform: translateY(-2px) scale(1.08); filter: brightness(1.16); }
}

@keyframes systemSettingsChatFlow {
    to { background-position: 84px 0; }
}

@keyframes systemSettingsMessagePop {
    0%, 100% { transform: translateY(1px) scale(0.94); }
    45% { transform: translateY(-2px) scale(1.06); }
}

@keyframes systemSettingsTelegramRoute {
    to { transform: translate3d(50px, -30px, 0); }
}

@keyframes systemSettingsPlaneFlight {
    0%, 100% { transform: translate(-2px, 2px) rotate(-5deg); }
    50% { transform: translate(3px, -3px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .system-settings-menu-card::before,
    .system-settings-menu-card::after,
    .system-settings-menu-card .system-settings-menu-icon,
    .system-settings-menu-card .system-settings-menu-icon::before,
    .system-settings-menu-card .system-settings-menu-icon::after,
    .system-settings-menu-card .system-settings-menu-icon i {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

.fcm-settings-panel {
    overflow: hidden;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(124, 45, 18, 0.08);
}

.fcm-settings-panel.is-loading {
    pointer-events: none;
}

.fcm-configuration-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid #fed7aa;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.92)),
        repeating-linear-gradient(135deg, transparent 0 24px, rgba(234, 88, 12, 0.08) 24px 25px);
}

.fcm-configuration-status.is-ready {
    border-bottom-color: #a7f3d0;
    background: linear-gradient(110deg, #f0fdf4, #ecfeff);
}

.fcm-configuration-status.is-off {
    border-bottom-color: #cbd5e1;
    background: #f8fafc;
}

.fcm-configuration-status-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, #f59e0b, #ea580c);
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.24);
    font-size: 1.45rem;
}

.fcm-configuration-status.is-ready .fcm-configuration-status-icon {
    background: linear-gradient(145deg, #0ea5e9, #10b981);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.22);
}

.fcm-configuration-status.is-off .fcm-configuration-status-icon {
    background: #64748b;
    box-shadow: none;
}

.fcm-configuration-status-copy {
    min-width: 0;
}

.fcm-configuration-status-copy strong,
.fcm-configuration-status-copy span {
    display: block;
}

.fcm-configuration-status-copy strong {
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
}

.fcm-configuration-status-copy span {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
}

.fcm-enabled-toggle {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.fcm-enabled-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.fcm-enabled-toggle > span {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 160ms ease;
}

.fcm-enabled-toggle > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    content: '';
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
    transition: transform 160ms ease;
}

.fcm-enabled-toggle input:checked + span {
    background: #f97316;
}

.fcm-enabled-toggle input:checked + span::after {
    transform: translateX(20px);
}

.fcm-enabled-toggle input:focus-visible + span {
    outline: 3px solid rgba(14, 165, 233, 0.3);
    outline-offset: 2px;
}

.fcm-enabled-toggle b {
    color: #334155;
    font-size: 0.8rem;
    white-space: nowrap;
}

.fcm-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.fcm-status-badge,
.fcm-device-count {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 5px 10px;
    color: #64748b;
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 800;
}

.fcm-status-badge.is-ready {
    border-color: #a7f3d0;
    color: #047857;
    background: #ecfdf5;
}

.fcm-status-badge.is-missing {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.fcm-device-count {
    margin-left: auto;
    border-color: #bae6fd;
    color: #0369a1;
    background: #f0f9ff;
}

.fcm-settings-section {
    padding: 20px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.fcm-settings-section-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin-bottom: 15px;
}

.fcm-settings-section-heading > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #ea580c;
    background: #fff7ed;
}

.fcm-settings-section-heading h4 {
    color: #172033;
    font-size: 0.95rem;
    font-weight: 900;
}

.fcm-settings-section-heading p {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

.fcm-notification-settings {
    background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

.fcm-notification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.fcm-notification-option {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 66px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.fcm-notification-option:hover {
    border-color: #fdba74;
    box-shadow: 0 7px 16px rgba(124, 45, 18, 0.08);
    transform: translateY(-1px);
}

.fcm-notification-option-wide {
    grid-column: 1 / -1;
}

.fcm-notification-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 7px;
    color: #334155;
    background: #f1f5f9;
    font-size: 0.95rem;
}

.fcm-notification-option.tone-rose .fcm-notification-icon { color: #be123c; background: #fff1f2; }
.fcm-notification-option.tone-red .fcm-notification-icon { color: #dc2626; background: #fef2f2; }
.fcm-notification-option.tone-cyan .fcm-notification-icon { color: #0284c7; background: #f0f9ff; }
.fcm-notification-option.tone-violet .fcm-notification-icon { color: #7c3aed; background: #f5f3ff; }
.fcm-notification-option.tone-amber .fcm-notification-icon { color: #d97706; background: #fffbeb; }
.fcm-notification-option.tone-emerald .fcm-notification-icon { color: #059669; background: #ecfdf5; }
.fcm-notification-option.tone-blue .fcm-notification-icon { color: #2563eb; background: #eff6ff; }

.fcm-notification-copy {
    min-width: 0;
}

.fcm-notification-copy b,
.fcm-notification-copy small {
    display: block;
}

.fcm-notification-copy b {
    color: #1e293b;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.35;
}

.fcm-notification-copy small {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
}

.fcm-notification-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.fcm-notification-switch {
    position: relative;
    width: 40px;
    height: 23px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 150ms ease;
}

.fcm-notification-switch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    content: '';
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
    transition: transform 150ms ease;
}

.fcm-notification-option > input:checked + .fcm-notification-switch {
    background: #f97316;
}

.fcm-notification-option > input:checked + .fcm-notification-switch::after {
    transform: translateX(17px);
}

.fcm-notification-option > input:focus-visible + .fcm-notification-switch {
    outline: 3px solid rgba(249, 115, 22, 0.2);
    outline-offset: 2px;
}

.fcm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fcm-field {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.fcm-field-wide {
    grid-column: 1 / -1;
}

.fcm-field > span {
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
}

.fcm-field > span small {
    color: #94a3b8;
    font-weight: 600;
}

.fcm-field input,
.fcm-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 10px 11px;
    color: #172033;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    letter-spacing: 0;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.fcm-field textarea {
    min-height: 76px;
    resize: vertical;
    overflow-wrap: anywhere;
}

.fcm-field input:focus,
.fcm-field textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.fcm-service-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fcm-service-account-current {
    min-width: 0;
}

.fcm-service-account-current strong,
.fcm-service-account-current span {
    display: block;
}

.fcm-service-account-current strong {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 900;
}

.fcm-service-account-current span {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.fcm-file-button,
.fcm-action-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 0.78rem;
    font-weight: 900;
    transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
}

.fcm-file-button {
    flex: 0 0 auto;
    border: 1px solid #fdba74;
    color: #c2410c;
    background: #fff7ed;
}

.fcm-file-button:hover {
    background: #ffedd5;
}

.fcm-service-account-file-name,
.fcm-project-match,
.fcm-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    border-radius: 7px;
    padding: 9px 11px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.45;
}

.fcm-service-account-file-name {
    border: 1px dashed #cbd5e1;
    color: #64748b;
    background: #f8fafc;
}

.fcm-service-account-file-name.is-selected {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-style: solid;
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.fcm-service-account-file-name small {
    color: #64748b;
    font-weight: 700;
}

.fcm-project-match.is-ready {
    color: #047857;
    background: #ecfdf5;
}

.fcm-project-match.is-warning {
    color: #b45309;
    background: #fffbeb;
}

.fcm-security-note {
    align-items: flex-start;
    color: #475569;
    background: #f1f5f9;
}

.fcm-security-note i {
    margin-top: 2px;
    color: #0f766e;
}

.fcm-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 18px;
    background: #f8fafc;
}

.fcm-action-button.is-secondary {
    border: 1px solid #94a3b8;
    color: #334155;
    background: #fff;
}

.fcm-action-button.is-primary {
    border: 1px solid #ea580c;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    box-shadow: 0 7px 15px rgba(234, 88, 12, 0.22);
}

.fcm-file-button:hover,
.fcm-action-button:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.fcm-file-button:disabled,
.fcm-action-button:disabled,
.fcm-field input:disabled,
.fcm-field textarea:disabled {
    cursor: wait;
    opacity: 0.58;
}

@media (max-width: 640px) {
    .fcm-configuration-status {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 11px;
        padding: 14px;
    }

    .fcm-configuration-status-icon {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }

    .fcm-enabled-toggle {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 3px;
    }

    .fcm-status-badges {
        padding: 10px 12px;
    }

    .fcm-status-badge,
    .fcm-device-count {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        text-align: center;
    }

    .fcm-device-count {
        margin-left: 0;
    }

    .fcm-settings-section {
        padding: 17px 13px;
    }

    .fcm-form-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .fcm-notification-grid {
        grid-template-columns: 1fr;
    }

    .fcm-notification-option-wide {
        grid-column: auto;
    }

    .fcm-field-wide {
        grid-column: auto;
    }

    .fcm-service-account-row {
        align-items: stretch;
        flex-direction: column;
    }

    .fcm-file-button {
        width: 100%;
    }

    .fcm-service-account-file-name.is-selected {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .fcm-service-account-file-name small {
        grid-column: 2;
    }

    .fcm-settings-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        padding: 13px;
    }

    .fcm-action-button {
        width: 100%;
        min-height: 46px;
    }
}

.system-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: grid;
    place-items: center;
    padding: 16px;
}

.system-settings-modal.hidden {
    display: none !important;
}

.system-settings-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.58);
    opacity: 0;
    transition: opacity 180ms ease;
}

.system-settings-modal-dialog {
    position: relative;
    display: flex;
    width: min(900px, 100%);
    max-height: min(88vh, 920px);
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease;
}

.system-settings-modal.is-open .system-settings-modal-backdrop,
.system-settings-modal.is-open .system-settings-modal-dialog {
    opacity: 1;
}

.system-settings-modal.is-open .system-settings-modal-dialog {
    transform: translateY(0) scale(1);
}

.system-settings-modal-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.system-settings-modal-icon {
    --settings-tone: #475569;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    color: #fff;
    background: var(--settings-tone);
    font-size: 1.25rem;
}

.system-settings-modal-heading {
    min-width: 0;
}

.system-settings-modal-heading h2 {
    overflow: hidden;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-settings-modal-heading p {
    overflow: hidden;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-settings-modal-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #fecaca;
    border-radius: 50%;
    color: #dc2626;
    background: #fff;
    font-size: 1.05rem;
}

.system-settings-modal-close:hover {
    background: #fef2f2;
}

.system-settings-modal-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
    background: #f8fafc;
}

.system-settings-modal-content > .is-system-settings-modal-panel {
    margin: 0 !important;
}

@media (min-width: 768px) {
    .system-settings-page-shell {
        padding: 24px;
    }

    .system-settings-menu-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }

    .system-settings-menu-card {
        gap: 10px;
        padding: 14px;
    }

    .system-settings-menu-icon {
        width: 56px;
        height: 56px;
        font-size: 1.55rem;
    }

    .system-settings-menu-card strong {
        font-size: 0.95rem;
    }

    .system-settings-menu-card small {
        display: block;
    }

    .system-settings-modal-content {
        padding: 24px;
    }
}

@media (min-width: 540px) and (max-width: 767px) {
    .system-settings-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 539px) {
    .system-settings-menu-card {
        aspect-ratio: 1.04 / 1;
        gap: 6px;
        padding: 10px 8px;
    }

    .system-settings-menu-icon {
        width: 48px;
        height: 48px;
        font-size: 1.38rem;
    }

    .system-settings-menu-card strong {
        min-height: 2.5em;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .system-settings-menu-card small {
        display: -webkit-box;
        min-height: 2.6em;
        max-width: 100%;
        overflow: hidden;
        color: #526179;
        font-size: 0.64rem;
        line-height: 1.3;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .system-settings-page-shell {
        padding: 12px 8px;
    }

    .system-settings-page-title {
        margin-bottom: 14px;
        font-size: 1.3rem;
    }

    .system-settings-modal {
        padding: 8px;
    }

    .system-settings-modal-dialog {
        width: 100%;
        max-height: calc(100dvh - 16px);
    }

    .system-settings-modal-header {
        gap: 10px;
        padding: 12px;
    }

    .system-settings-modal-content {
        padding: 12px;
    }
}

@media (max-width: 640px) {
    .klassin-announcement-modal {
        width: calc(100vw - 16px) !important;
        max-width: none !important;
        max-height: calc(100dvh - 16px);
        padding: 14px 11px 11px !important;
        border-radius: 14px !important;
    }

    .klassin-announcement-modal .swal2-title {
        padding: 8px 38px 5px !important;
        font-size: 1.22rem !important;
        line-height: 1.25 !important;
    }

    .klassin-announcement-modal .swal2-close {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
        font-size: 1.8rem;
    }

    .klassin-announcement-modal-content {
        max-height: calc(100dvh - 190px);
        margin-top: 0.45em !important;
    }

    .klassin-recipient-picker {
        padding: 7px;
    }

    .klassin-recipient-tab {
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 42px;
        padding: 6px;
        gap: 4px;
        font-size: 0.72rem;
    }

    .klassin-recipient-tab small {
        display: none;
    }

    .klassin-recipient-search {
        height: 42px;
    }

    .klassin-recipient-options {
        max-height: 220px;
    }

    .klassin-recipient-option {
        min-height: 58px;
        padding: 8px;
    }

    .klassin-recipient-option.is-level {
        min-height: 68px;
    }

    .klassin-recipient-option-copy strong {
        font-size: 0.8rem;
    }

    .klassin-recipient-option-copy small {
        font-size: 0.66rem;
    }

    .klassin-announcement-form .swal2-textarea {
        min-height: 110px;
    }

    .klassin-announcement-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin: 10px 0 0 !important;
    }

    .klassin-announcement-actions .swal2-styled {
        width: 100%;
        padding: 0.7em 0.8em;
    }

    .topbar-notification-button {
        width: 46px;
        height: 46px;
    }

    .topbar-notification-badge {
        top: -5px;
        right: -5px;
    }

    .klassin-notification-panel {
        width: 100%;
    }

    .klassin-notification-header {
        min-height: 80px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .klassin-notification-content {
        padding: 14px;
    }

    .klassin-push-status {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .klassin-push-device-count {
        grid-column: 2;
        justify-self: start;
    }

    .klassin-notification-action {
        min-height: 48px;
    }
}

/* Exam retake requests and attempt history. */
.exam-retake-manage-button { display: inline-flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 9px 12px; border: 1px solid #7dd3fc; border-radius: 8px; background: #f0f9ff; color: #075985; font-size: 14px; line-height: 1.5; font-weight: 700; }
.exam-retake-manage-button span { min-width: 22px; border-radius: 4px; background: #be123c; color: #fff; padding: 0 5px; }
.exam-retake-popup { border-radius: 8px !important; }
.exam-retake-popup .swal2-html-container { margin: 16px 24px; }
.exam-retake-panel { text-align: left; color: #1f2937; font-size: 16px; line-height: 1.6; letter-spacing: 0; min-width: 0; }
.exam-retake-panel h3 { font-size: 20px; font-weight: 700; margin: 0 0 16px; overflow-wrap: anywhere; }
.exam-retake-settings { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-block: 1px solid #dbe3ea; }
.exam-retake-settings label { font-weight: 600; }
.exam-retake-settings > div { display: flex; gap: 8px; }
.exam-retake-settings input { width: 88px; min-height: 44px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #1f2937; padding: 8px 10px; font: inherit; }
.exam-retake-panel button, .exam-retake-student button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1px solid #0369a1; border-radius: 6px; color: #fff !important; background: #0369a1 !important; font-size: 16px; line-height: 1.5; font-weight: 600; letter-spacing: 0; white-space: normal; }
.exam-retake-panel button:hover, .exam-retake-student button:hover { background: #075985 !important; }
.exam-retake-panel button.is-secondary, .exam-retake-student button.exam-retake-refresh { background: #fff !important; color: #334155 !important; border-color: #cbd5e1; }
.exam-retake-panel button:disabled, .exam-retake-student button:disabled { cursor: not-allowed; opacity: .6; }
.exam-retake-panel button:focus-visible, .exam-retake-student button:focus-visible, .exam-retake-settings input:focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; }
.exam-retake-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin: 24px 0 8px; }
.exam-retake-heading h4 { font-size: 18px; font-weight: 700; margin: 0; }
.exam-retake-heading > span { font-size: 14px; color: #92400e; }
.exam-retake-person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid #dbe3ea; }
.exam-retake-person strong { font-size: 18px; }
.exam-retake-person p, .exam-retake-history p { margin: 4px 0; color: #475569; overflow-wrap: anywhere; }
.exam-retake-person .exam-retake-reason { color: #1f2937; white-space: pre-wrap; }
.exam-retake-person-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.exam-retake-request-state { display: inline-block; font-size: 14px; font-weight: 600; padding: 3px 8px; background: #f3f4f6; border-radius: 4px; }
.exam-retake-request-state.pending { background: #fffbeb; color: #92400e; }
.exam-retake-request-state.approved { background: #ecfdf5; color: #065f46; }
.exam-retake-request-state.rejected { background: #fff1f2; color: #9f1239; }
.exam-retake-empty { padding: 24px 0; text-align: center; color: #64748b; }
.exam-retake-history { padding: 16px 0; border-bottom: 1px solid #dbe3ea; }
.exam-retake-student { width: 100%; max-width: 300px; margin-top: 12px; font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.exam-retake-status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #475569; margin-bottom: 8px; }
.exam-retake-student button { width: 100%; }
.exam-retake-student button.exam-retake-refresh { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; }
.exam-retake-approved { color: #065f46; margin-bottom: 8px; }
.exam-retake-pending { color: #92400e; }
.exam-retake-rejected { color: #9f1239; margin-bottom: 8px; }
@media (max-width: 600px) {
    .exam-retake-popup .swal2-html-container { margin: 12px 16px; }
    .exam-retake-popup .swal2-title { font-size: 24px; }
    .exam-retake-settings { align-items: stretch; }
    .exam-retake-settings > div { width: 100%; }
    .exam-retake-settings button { flex: 1; }
    .exam-retake-person { grid-template-columns: minmax(0, 1fr); }
    .exam-retake-person-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
    .exam-retake-person-actions button { flex: 1 1 130px; }
    .exam-retake-student { max-width: none; }
}

/* Attendance-derived score topics. */
.score-topic-create-panel { max-width: 760px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.attendance-score { color: #1f2937; text-align: left; font-size: 16px; line-height: 1.5; min-width: 0; }
.attendance-score[hidden], .attendance-score [hidden] { display: none !important; }
.attendance-score-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.attendance-score label { display: flex; flex-direction: column; gap: 5px; font-size: 15px; font-weight: 600; min-width: 0; }
.attendance-score input, .attendance-score select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 10px; background: #fff; color: #1f2937; font: inherit; }
.attendance-score input[readonly] { background: #f3f4f6; color: #475569; }
.attendance-score input:focus, .attendance-score select:focus { outline: 2px solid #0284c7; outline-offset: 1px; }
.attendance-score fieldset { border: 0; border-top: 1px solid #e5e7eb; margin: 16px 0; padding: 10px 0 0; min-width: 0; }
.attendance-score legend { font-weight: 700; padding-right: 8px; font-size: 16px; }
.attendance-score-basis { margin: 14px 0; color: #475569; font-size: 14px; }
.attendance-score-preview-button, .attendance-score-toolbar button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 6px; padding: 10px 16px; font-size: 16px; font-weight: 700; background: #0369a1 !important; color: #fff !important; border: 1px solid #0369a1; }
.attendance-score button:disabled { opacity: .6; cursor: wait; }
.attendance-score-toolbar { margin-bottom: 12px; }
.attendance-score-message { font-size: 15px; color: #475569; margin-top: 12px; overflow-wrap: anywhere; }
.attendance-score-message:empty { display: none; }
.attendance-score-message.is-error { color: #b91c1c; }
.attendance-score-summary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-bottom: 1px solid #cbd5e1; }
.attendance-score-room { padding: 12px 0 0; }
.attendance-score-room h4 { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 700; margin: 0 0 8px; font-size: 16px; }
.attendance-score-room h4 span { color: #475569; font-weight: 400; font-size: 14px; }
.attendance-score-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 6px; }
.attendance-score table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.attendance-score th, .attendance-score td { padding: 9px 8px; border-bottom: 1px solid #e5e7eb; text-align: center; color: #1f2937; }
.score-entry-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; min-width: 0; }
.score-entry-student { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; min-width: 0; }
.score-entry-photo { position: relative; display: block; width: 84px; height: 112px; padding: 0; overflow: hidden; border: 4px solid #fff; border-radius: 8px; background: #e2e8f0; box-shadow: 0 3px 12px rgba(15,23,42,.15); cursor: zoom-in; }
.score-entry-photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; font-size: 40px; }
.score-entry-photo img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.score-entry-identity { min-width: 0; text-align: left; }
.score-entry-number { display: block; margin-bottom: 4px; color: #64748b; font-size: 13px; font-weight: 600; }
.score-entry-identity h4 { margin: 0; color: #172033; font-size: 18px; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.score-entry-identity p { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 0; color: #0369a1; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.score-entry-controls { min-width: 0; width: 100%; }
.score-entry-max { display: block; margin: 0 0 10px; color: #526575; font-size: 14px; text-align: left; }
.score-entry-max strong { color: #172033; }
.score-entry-keypad { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 12px; }
.score-entry-key { min-width: 64px; min-height: 64px; padding: 8px; border: 1px solid #94cce2; border-radius: 8px; background: #f0f9ff; color: #075985; font-size: 26px; font-weight: 700; line-height: 1; touch-action: manipulation; transition: background-color 120ms ease, border-color 120ms ease; }
.score-entry-key:active { background: #0369a1; color: #fff; border-color: #0369a1; }
.score-entry-key:disabled { opacity: .55; cursor: wait; }
.score-entry-photo:focus-visible, .score-entry-key:focus-visible, .score-entry-edit:focus-visible, .score-entry-save:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
.score-entry-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; }
.score-entry-input { width: 100%; min-width: 0; min-height: 64px; border: 1px solid #94cce2; border-radius: 8px; padding: 10px; background: #f0f9ff; color: #075985; text-align: center; font-size: 24px; font-weight: 700; }
.score-entry-save { min-height: 64px; border-radius: 8px; background: #0284c7; color: #fff; font-size: 24px; touch-action: manipulation; }
.score-entry-card.is-scored { border-color: #bbdfce; background: #f7fcf9; }
.score-entry-result { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.score-entry-value { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; color: #166534; }
.score-entry-value strong { font-size: 28px; font-weight: 700; }
.score-entry-value > span { color: #526575; font-size: 15px; }
.score-entry-edit { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: 0 0 52px; border: 1px solid #94a3b8; border-radius: 8px; background: #fff; color: #0369a1; font-size: 20px; touch-action: manipulation; }
@media (hover: hover) {
    .score-entry-key:hover { background: #e0f2fe; border-color: #0284c7; }
    .score-entry-edit:hover { background: #e0f2fe; }
}
@media (min-width: 900px) {
    .score-entry-card { grid-template-columns: minmax(220px, .9fr) minmax(0, 1.1fr); align-items: center; gap: 24px; padding: 20px; }
    .score-entry-student { grid-template-columns: 96px minmax(0, 1fr); gap: 18px; }
    .score-entry-photo { width: 96px; height: 128px; }
    .score-entry-identity h4 { font-size: 20px; }
    .score-entry-card.is-scored { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 360px) {
    .score-entry-card { padding: 12px; }
    .score-entry-student { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
    .score-entry-photo { width: 72px; height: 96px; }
}

.attendance-score thead th { background: #f1f5f9; white-space: nowrap; }
.attendance-score th:first-child { text-align: left; min-width: 150px; max-width: 240px; overflow-wrap: anywhere; }
.attendance-score td:last-child { color: #0369a1; }
.attendance-score small { display: block; font-size: 12px; font-weight: 400; color: #475569; }
.attendance-score-popup .swal2-html-container { margin: 12px 20px; max-width: 100%; }
.attendance-score-topic { color: #475569; font-size: 16px; text-align: left; margin-bottom: 14px; overflow-wrap: anywhere; }
.attendance-score-confirm { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 16px; color: #1f2937; margin-top: 20px; }
.attendance-score-confirm input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 3px; accent-color: #0369a1; }
@media (max-width: 480px) {
    .score-topic-create-panel { padding: 16px !important; }
    .attendance-score-fields { grid-template-columns: minmax(0, 1fr); }
    .attendance-score fieldset .attendance-score-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-score-preview-button, .attendance-score-toolbar button { width: 100%; }
    .attendance-score-popup .swal2-html-container { margin: 10px 12px; }
    .attendance-score-popup .swal2-title { font-size: 22px; }
    .attendance-score table { min-width: 0; }
    .attendance-score thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .attendance-score tbody { display: block; }
    .attendance-score tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 12px; border-bottom: 1px solid #cbd5e1; }
    .attendance-score tbody th:first-child { grid-column: 1 / -1; min-width: 0; max-width: none; padding: 0 0 6px; border: 0; }
    .attendance-score tbody td { border: 0; padding: 5px 0; min-width: 0; }
    .attendance-score tbody td::before { content: attr(data-label); display: block; font-size: 12px; color: #475569; }
    .attendance-score tbody td:last-child { grid-column: span 2; background: #f0f9ff; border-radius: 4px; font-size: 18px; }
}

.gradebook-export-options .swal2-title { font-size: 24px; line-height: 1.4; }
.gradebook-export-options .gradebook-export-options-list {
    display: grid !important;
    gap: 10px;
    margin: 20px 24px;
    text-align: left;
}
.gradebook-export-options-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    margin: 0;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    cursor: pointer;
}
.gradebook-export-options-list label:has(input:checked) { background: #ecfdf5; border-color: #16a34a; }
.gradebook-export-options-list input { flex: 0 0 18px; width: 18px; height: 18px; accent-color: #15803d; }
.gradebook-export-options-list span { min-width: 0; overflow-wrap: anywhere; }

/* Online exams share the subject-score page shell and navigation. */
.student-exam-lobby { width: min(100%, 1280px); margin: 0 auto; color: #0f172a; letter-spacing: 0; }
.exam-lobby-header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exam-lobby-layout { min-height: 570px; }
.exam-lobby-layout .student-score-subject-button { min-height: 82px; }
.exam-lobby-subject-count { display: grid; place-items: center; min-width: 25px; min-height: 25px; padding: 2px 6px; border-radius: 6px; color: var(--score-accent); background: var(--score-soft); font-size: 12px; font-weight: 800; }
.exam-lobby-overview { margin-bottom: 24px; }
.exam-lobby-overview .student-score-detail-subject { --score-tone: #0284c7; }
.exam-lobby-overview .student-score-detail-subject h3 { font-size: 24px; }
.exam-lobby-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; border-block: 1px solid #e2e8f0; }
.exam-lobby-metrics > div { min-width: 0; padding: 12px; border-right: 1px solid #e2e8f0; }
.exam-lobby-metrics > div:first-child { padding-left: 0; }
.exam-lobby-metrics > div:last-child { border-right: 0; }
.exam-lobby-metrics span, .exam-lobby-metrics strong { display: block; }
.exam-lobby-metrics span { color: #64748b; font-size: 11px; font-weight: 700; }
.exam-lobby-metrics strong { margin-top: 3px; font-size: 24px; line-height: 1.3; font-weight: 800; font-variant-numeric: tabular-nums; }
.exam-lobby-metrics .is-ready strong { color: #0369a1; }
.exam-lobby-metrics .is-upcoming strong { color: #b45309; }
.exam-lobby-metrics .is-completed strong { color: #047857; }
.exam-lobby-metrics .is-closed strong { color: #be123c; }
.exam-lobby-refresh { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #475569; }
.exam-lobby-refresh:disabled { cursor: wait; opacity: .65; }
.exam-lobby-refresh:disabled i { animation: exam-lobby-spin 1s linear infinite; }
@keyframes exam-lobby-spin { to { transform: rotate(360deg); } }
.exam-lobby-section { margin: 0 0 24px; }
.exam-lobby-section:last-child { margin-bottom: 0; }
.exam-lobby-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.exam-lobby-section-heading h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.5; font-weight: 800; }
.exam-lobby-section-heading > span { color: #64748b; font-size: 12px; white-space: nowrap; }
.exam-lobby-section.is-ready .exam-lobby-section-heading i { color: #2563eb; }
.exam-lobby-section.is-completed .exam-lobby-section-heading i { color: #059669; }
.exam-lobby-section.is-upcoming .exam-lobby-section-heading i { color: #d97706; }
.exam-lobby-section.is-closed .exam-lobby-section-heading i { color: #be123c; }
.exam-lobby-list { display: grid; gap: 0; }
.exam-lobby-section.is-ready .exam-lobby-list { gap: 12px; }
.exam-lobby-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; min-width: 0; padding: 14px 0; border-bottom: 1px solid #e2e8f0; }
.exam-lobby-item-symbol { display: grid; place-items: center; width: 38px; height: 42px; align-self: start; border-radius: 6px; color: #0369a1; background: #e0f2fe; font-size: 17px; }
.exam-lobby-item.is-completed .exam-lobby-item-symbol { color: #047857; background: #d1fae5; }
.exam-lobby-item.is-upcoming .exam-lobby-item-symbol { color: #b45309; background: #fef3c7; }
.exam-lobby-item.is-closed .exam-lobby-item-symbol { color: #be123c; background: #ffe4e6; }
.exam-lobby-item.is-open, .exam-lobby-item.is-resume { align-content: start; padding: 16px; border: 1px solid #bae6fd; border-top: 3px solid #0284c7; border-radius: 8px; background: #fff; }
.exam-lobby-item.is-resume { border-color: #a7f3d0; border-top-color: #059669; }
.exam-lobby-item-info { min-width: 0; }
.exam-lobby-subject { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 0 0 4px; color: #64748b; font-size: 11px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.exam-lobby-subject i { color: #0284c7; }
.exam-lobby-subject > span { color: #64748b; font-weight: 400; }
.exam-lobby-item h4 { margin: 0; color: #0f172a; font-size: 15px; line-height: 1.5; font-weight: 800; overflow-wrap: anywhere; }
.exam-lobby-item.is-open h4, .exam-lobby-item.is-resume h4 { font-size: 17px; }
.exam-lobby-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 7px; color: #64748b; font-size: 11px; line-height: 1.5; }
.exam-lobby-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.exam-lobby-meta .exam-lobby-status { padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.exam-lobby-item.is-open .exam-lobby-status { color: #0369a1; background: #e0f2fe; }
.exam-lobby-item.is-resume .exam-lobby-status, .exam-lobby-item.is-completed .exam-lobby-status { color: #047857; background: #d1fae5; }
.exam-lobby-item.is-upcoming .exam-lobby-status { color: #92400e; background: #fef3c7; }
.exam-lobby-item.is-closed .exam-lobby-status { color: #be123c; background: #ffe4e6; }
.exam-lobby-meta .exam-lobby-deadline { color: #1d4ed8; font-variant-numeric: tabular-nums; }
.exam-lobby-item-action { min-width: 0; grid-column: 2 / -1; }
.exam-lobby-start { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 10px 14px; border: 0; border-radius: 6px; background: #0284c7; color: #fff; font-size: 14px; line-height: 1.5; font-weight: 800; }
.exam-lobby-start i:last-child { margin-left: auto; }
.exam-lobby-start:disabled { opacity: .65; cursor: wait; }
.exam-lobby-score { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.exam-lobby-score > span { display: block; color: #64748b; font-size: 10px; line-height: 1.5; }
.exam-lobby-score strong { display: block; color: #047857; font-size: 24px; line-height: 1.35; font-weight: 800; }
.exam-lobby-score small { color: #64748b; font-size: 13px; font-weight: 400; }
.exam-lobby-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #92400e; }
.exam-lobby-wait span { font-size: 11px; }
.exam-lobby-wait strong { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exam-lobby-empty { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 180px; padding: 24px 14px; color: #64748b; font-size: 14px; line-height: 1.5; text-align: center; }
.exam-lobby-empty.is-notice { justify-content: flex-start; min-height: 0; margin-bottom: 22px; padding: 12px; border: 1px solid #dbeafe; border-radius: 6px; background: #f0f9ff; font-size: 12px; }
.exam-lobby-empty.is-error { color: #be123c; }
.exam-lobby-empty button { min-height: 44px; padding: 8px 12px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; color: #1d4ed8; }
.student-exam-lobby button:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }
.student-exam-lobby .exam-retake-student { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; max-width: none; margin-top: 0; font-size: 12px; }
.student-exam-lobby .exam-retake-status-line { justify-content: flex-start; gap: 8px; margin-bottom: 0; }
.student-exam-lobby .exam-retake-student > button { width: auto; min-height: 44px; padding: 8px 12px; font-size: 13px; }
.student-exam-lobby .exam-retake-student button.exam-retake-refresh { width: 36px; height: 44px; min-height: 44px; flex-basis: 36px; border: 0; background: transparent !important; font-size: 12px; }
.exam-lobby-item.is-completed .exam-retake-student > button { background: #fff !important; color: #0369a1 !important; border-color: #bae6fd; }
.exam-lobby-item.is-completed .exam-retake-student > button:disabled { color: #64748b !important; border-color: #dbe3ea; }
.exam-lobby-item.is-resume .exam-retake-student { align-items: stretch; }
.exam-lobby-item.is-resume .exam-retake-status-line, .exam-lobby-item.is-resume .exam-retake-student > button { width: 100%; }
@media (hover: hover) {
    .exam-lobby-start:hover { background: #0369a1; }
    .exam-lobby-refresh:hover { border-color: #0891b2; color: #0891b2; }
    .exam-lobby-item.is-completed:hover { background: #f0fdf4; }
}
@media (min-width: 1280px) {
    .exam-lobby-section.is-ready .exam-lobby-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .exam-lobby-section.is-ready .exam-lobby-item:only-child { grid-column: 1 / -1; }
    .exam-lobby-item.is-open, .exam-lobby-item.is-resume { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 14px; }
    .exam-lobby-item.is-open .exam-lobby-item-symbol, .exam-lobby-item.is-resume .exam-lobby-item-symbol { width: 32px; height: 38px; font-size: 15px; }
    .exam-lobby-item.is-resume .exam-lobby-score { grid-column: 2; text-align: left; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .exam-lobby-layout { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); }
    .exam-lobby-layout .student-score-page-detail { padding: 18px; }
    .exam-lobby-layout .student-score-subject-nav { padding: 18px 10px; }
    .exam-lobby-page-header { gap: 12px; padding: 20px 18px; }
    .exam-lobby-page-header .student-score-page-back { width: 44px; padding: 0; }
    .exam-lobby-page-header .student-score-page-back span { display: none; }
    .exam-lobby-page-header .student-score-page-heading h2 { font-size: 26px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .student-exam-lobby .exam-lobby-layout { display: block; min-height: 0; }
    .student-exam-lobby .student-score-subject-nav { padding: 14px 18px; border-right: 0; border-bottom: 1px solid #e2e8f0; }
    .student-exam-lobby .student-score-subject-nav-heading, .student-exam-lobby .student-score-subject-list { display: none; }
    .student-exam-lobby .student-score-subject-select-wrap { display: grid; gap: 6px; }
    .student-exam-lobby .student-score-subject-select-wrap > span:first-child { color: #475569; font-size: 10px; font-weight: 900; }
    .student-exam-lobby .student-score-subject-select-control { display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; align-items: center; gap: 7px; min-width: 0; min-height: 48px; padding: 0 11px; border: 1px solid #bae6fd; border-radius: 8px; color: #0284c7; background: #fff; }
    .student-exam-lobby .student-score-subject-select-control select { width: 100%; min-width: 0; height: 46px; border: 0; outline: 0; color: #0f172a; background: transparent; font-size: 13px; font-weight: 800; appearance: none; }
    .student-exam-lobby .student-score-subject-select-control > i:last-child { font-size: 10px; pointer-events: none; }
    .exam-lobby-page-header { grid-template-columns: auto minmax(0, 1fr); }
    .exam-lobby-header-actions { grid-column: 2; justify-self: start; }
}
@media (max-width: 767px) {
    .exam-lobby-header-actions { grid-column: 2; justify-self: start; }
    .exam-lobby-header-actions .student-score-page-count { min-height: 36px; padding: 8px 10px; font-size: 11px; }
    .exam-lobby-header-actions .exam-lobby-refresh { width: 36px; height: 36px; flex-basis: 36px; }
    .exam-lobby-layout { min-height: 0; }
    .exam-lobby-overview { margin-bottom: 20px; }
    .exam-lobby-overview .student-score-detail-subject { gap: 10px; }
    .exam-lobby-overview .student-score-detail-subject-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 19px; }
    .exam-lobby-overview .student-score-detail-subject h3 { font-size: 20px; }
    .exam-lobby-metrics { margin-top: 16px; }
    .exam-lobby-metrics > div { padding: 10px 6px; }
    .exam-lobby-metrics span { font-size: 10px; }
    .exam-lobby-metrics strong { font-size: 22px; }
    .exam-lobby-section-heading h3 { font-size: 16px; }
    .exam-lobby-item { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
    .exam-lobby-item-symbol { width: 30px; height: 36px; font-size: 14px; }
    .exam-lobby-item.is-open, .exam-lobby-item.is-resume { padding: 12px; }
    .exam-lobby-item.is-open h4, .exam-lobby-item.is-resume h4 { font-size: 16px; }
    .exam-lobby-item.is-open .exam-lobby-item-action, .exam-lobby-item.is-resume .exam-lobby-item-action { grid-column: 1 / -1; }
    .exam-lobby-score { min-width: 60px; }
    .exam-lobby-score strong { font-size: 21px; }
    .exam-lobby-score small { font-size: 11px; }
    .exam-lobby-item.is-resume .exam-lobby-score { grid-column: 2 / -1; text-align: left; }
    .exam-lobby-section { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .exam-lobby-refresh:disabled i { animation: none; } }

.klassin-notification-entry { min-width: 0; }
.klassin-notification-entry.is-absence { overflow: hidden; border: 1px solid #fecdd3; border-left: 3px solid #fb7185; border-radius: 8px; background: #fff7f8; }
.klassin-notification-entry.is-absence.is-unread { border-color: #fda4af; border-left-color: #e11d48; background: #fff1f2; }
.klassin-notification-entry.is-absence > .klassin-notification-item { padding: 10px; gap: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.klassin-notification-entry.is-absence .klassin-notification-item-icon { width: 30px; height: 30px; background: #ffe4e6; color: #be123c; font-size: 13px; }
.klassin-notification-entry.is-absence .klassin-notification-item-copy strong { color: #9f1239; font-size: 13px; line-height: 1.45; font-weight: 700; }
.klassin-notification-entry.is-absence .klassin-notification-item-copy > .klassin-notification-body { padding: 0; font-size: 12px; line-height: 1.5; font-weight: 400; }
.klassin-notification-entry.is-absence .klassin-notification-item-copy time { font-size: 10px; font-weight: 400; color: #6b7280; }
.klassin-notification-entry.is-absence .klassin-notification-dot { background: #e11d48; box-shadow: 0 0 0 3px #ffe4e6; }
.klassin-notification-entry.is-absence .klassin-notification-expand-icon { background: #ffe4e6; color: #9f1239; }
.klassin-notification-entry.is-absence.is-expanded { border-color: #fb7185; }
.klassin-absence-detail { margin: 0 10px; padding: 10px 0; border-top: 1px solid #fecdd3; color: #1f2937; text-align: left; font-size: 12px; line-height: 1.5; letter-spacing: 0; }
.klassin-absence-subject { margin-bottom: 10px; padding: 8px 10px; border: 1px solid #fdba74; border-left: 3px solid #f97316; border-radius: 4px; background: #ffedd5; color: #9a3412; }
.klassin-absence-subject strong, .klassin-absence-subject > span { display: block; overflow-wrap: anywhere; }
.klassin-absence-subject strong { color: #7c2d12; font-size: 13px; }
.klassin-absence-subject > span { margin-top: 2px; font-size: 11px; }
.klassin-absence-student { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; }
.klassin-absence-photo { display: grid; place-items: center; width: 48px; height: 64px; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 4px; background: #f1f5f9; color: #94a3b8; font-size: 22px; }
.klassin-absence-photo img { width: 100%; height: 100%; object-fit: cover; }
.klassin-absence-photo:is(button) { padding: 0; cursor: zoom-in; }
.klassin-absence-photo:disabled { cursor: default; }
.klassin-absence-photo > [hidden] { display: none; }
.klassin-absence-name { display: inline; padding: 4px 0; min-height: 44px; background: transparent; border: 0; color: #0369a1; text-align: left; font-size: 14px; line-height: 1.45; font-weight: 700; overflow-wrap: anywhere; }
.klassin-absence-name i { font-size: 11px; }
.klassin-absence-student p { margin: 0; color: #64748b; font-size: 11px; overflow-wrap: anywhere; }
.klassin-absence-contacts { margin-top: 8px; }
.klassin-absence-contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 2px 0; border-top: 1px solid #f3d9de; }
.klassin-absence-contact > div { min-width: 0; }
.klassin-absence-contact > div > span { display: block; color: #64748b; font-size: 11px; }
.klassin-absence-contact strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.klassin-absence-contact a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 4px 0; color: #047857; font-size: 12px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.klassin-absence-no-phone { color: #64748b; font-size: 12px; }
.klassin-absence-history { margin-top: 8px; padding-top: 8px; border-top: 1px solid #f3d9de; }
.klassin-absence-history h4 { margin: 0; font-size: 12px; font-weight: 700; }
.klassin-absence-history h4 i { color: #0891b2; margin-right: 4px; }
.klassin-absence-history > p { margin: 2px 0 4px; color: #64748b; font-size: 10px; }
.klassin-absence-history ul { margin: 0; padding: 0; list-style: none; }
.klassin-absence-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid #f3d9de; }
.klassin-absence-history li strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.klassin-absence-history li div > span { display: block; color: #64748b; font-size: 11px; }
.klassin-absence-history li time { display: block; color: #64748b; font-size: 10px; }
.klassin-absence-attendance { padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #f1f5f9; color: #475569; }
.klassin-absence-attendance.is-present { background: #dcfce7; color: #166534; }
.klassin-absence-attendance.is-late { background: #fef3c7; color: #92400e; }
.klassin-absence-attendance.is-leave { background: #e0f2fe; color: #075985; }
.klassin-absence-attendance.is-absent { background: #ffe4e6; color: #9f1239; }
.klassin-absence-loading { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 16px 0; color: #64748b; }
.klassin-absence-loading button { min-height: 44px; padding: 8px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; color: #0369a1; }
.klassin-absence-detail button:focus-visible, .klassin-absence-detail a:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }
@media (hover: hover) { .klassin-absence-name:hover, .klassin-absence-contact a:hover { text-decoration: underline; } }
