/* Shared School workspace theme. Existing role, tab and modal state stays in JS. */
.school-dashboard-shell {
    --school-ink: #243d33;
    --school-muted: #60705d;
    --school-green: #245343;
    --school-green-dark: #183e30;
    --school-mint: #a9d7b8;
    --school-line: #e3e8dc;
    --school-paper: #fffef9;
    --school-canvas: #f6f5ed;
    --school-shadow: 0 4px 18px rgb(36 61 51 / 4%);
    color: var(--school-ink);
    background: var(--school-canvas);
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.school-dashboard-shell *,
.school-dashboard-shell *::before,
.school-dashboard-shell *::after { box-sizing: border-box; }

.school-dashboard-shell .school-sidebar {
    width: 250px;
    background: var(--school-paper);
    border-color: var(--school-line);
    box-shadow: none;
}

.school-sidebar .dashboard-sidebar-panel {
    padding: 24px 18px 18px;
    scrollbar-width: thin;
    scrollbar-color: #d5decf transparent;
}

.school-sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 58px;
    margin: 0 8px 27px;
}

.school-sidebar-brand img { width: 176px; height: auto; }

.school-sidebar .school-sidebar-user {
    padding: 15px 10px;
    margin-bottom: 24px;
    border: 1px solid var(--school-line);
    border-radius: 16px;
    background: #f4f6ee;
    align-items: center;
    gap: 5px;
}

.school-sidebar-user .sidebar-user-meta { gap: 10px; }
.school-sidebar-user .sidebar-user-meta > div:first-child {
    width: 38px;
    height: 38px;
    color: var(--school-green);
    background: #dcebd7;
    border-radius: 13px;
    font-size: 15px;
}

.school-sidebar #sidebar-user-name { color: var(--school-ink); font-size: 14px; }
.school-sidebar #sidebar-user-role { color: #61715f; font-size: 12px; }
.school-sidebar #sidebar-user-email { color: #75826e; font-size: 11px; }
.school-sidebar #sidebar-edit-name-btn { width: 28px; height: 28px; }
.school-sidebar #sidebar-toggle-btn { width: 27px; height: 30px; color: #738271; }
.school-sidebar #sidebar-toggle-btn:hover { color: var(--school-green); background: #e3ebda; }

.school-sidebar #dashboard-tabs { gap: 4px; margin-bottom: 28px; }
.school-sidebar #dashboard-tabs > * + * { margin-top: 0; }
.school-sidebar .dashboard-tab {
    position: relative;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 12px;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #677564;
    transition: background-color 160ms, color 160ms;
}

.school-sidebar .dashboard-tab i { color: #8b9e84; font-size: 14px; }
.school-sidebar .dashboard-tab:hover { color: var(--school-green); background: #edf2e7; }
.school-sidebar .dashboard-tab.active {
    background: var(--school-green);
    color: #fff;
    box-shadow: 0 4px 10px rgb(36 83 67 / 13%);
    font-weight: 700;
}

.school-sidebar .dashboard-tab.active i { color: #c6e6bc; }
.school-sidebar .dashboard-tab.active::after {
    content: '';
    position: absolute;
    right: 14px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c6e6bc;
}

.school-sidebar .dashboard-tab.hidden { display: none; }
.school-sidebar #logout-btn {
    padding: 12px;
    color: #6d7968;
    background: transparent;
    border-top: 1px solid var(--school-line);
    border-radius: 0;
    font-size: 13px;
}

.school-sidebar #logout-btn:hover { color: var(--school-green); background: #f4f6ee; }
.school-dashboard-shell .school-workspace { background: var(--school-canvas); }

.school-topbar {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 101px;
    padding: 21px 38px 20px;
    border-bottom: 1px solid var(--school-line);
    background: var(--school-paper);
}

.school-page-kicker {
    margin-bottom: 4px;
    color: #6a765e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2.2px;
}

#school-page-title { margin: 0; color: var(--school-ink); font-size: 21px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.35; }
#school-page-description { margin-top: 5px; font-size: 13px; line-height: 1.6; color: var(--school-muted); }
.school-topbar-date {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--school-line);
    border-radius: 11px;
    color: #65715c;
    background: #fafbf5;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.school-topbar-date i { color: #8c9c78; }
.school-topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.school-topbar #dashboard-action-buttons-container {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.school-topbar #dashboard-action-buttons-container > * + * { margin-left: 0; }
.school-topbar #dashboard-action-buttons-container:has(> .hidden):not(:has(> button:not(.hidden))) { display: none; }
.school-workspace .school-workspace-scroll {
    padding: 30px 38px 48px;
    scrollbar-width: thin;
    scrollbar-color: #d1daca var(--school-canvas);
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    min-height: 0;
}

.school-workspace-scroll > .tab-content { max-width: 1440px; margin-inline: auto; }
.school-subject-links { display: flex; align-items: center; gap: 8px; }
.school-subject-links a { padding: 9px 12px; border: 1px solid #d7e0cd; border-radius: 10px; background: #f4f7ee; color: #35553d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.school-subject-links a:hover { background: #e8efdc; border-color: #b7cbaa; }
.school-subject-links a:focus-visible, .school-task-action:focus-visible { outline: 3px solid #91b570; outline-offset: 3px; }
.school-today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.school-today-panel { min-width: 0; padding: 22px; background: var(--school-paper); border: 1px solid var(--school-line); border-radius: 20px; box-shadow: var(--school-shadow); }
.school-today-panel h2 { margin: 0 0 14px; color: #35553d; font-size: 18px; font-weight: 800; }
.school-today-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; list-style: none; padding: 0; margin: 0; scrollbar-width: thin; }
.school-task-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e3e9da; border-radius: 12px; background: #f7f9f2; }
.school-task-check { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border: 1px solid #d0dcc3; border-radius: 50%; color: #829178; font-size: 15px; }
.school-task-row[data-completed="true"] .school-task-check { color: #fff; background: #547a42; border-color: #547a42; }
.school-task-info { flex: 1; min-width: 0; }
.school-task-info strong { display: block; color: #3e513b; font-size: 14px; overflow-wrap: anywhere; }
.school-task-info small { display: block; margin-top: 4px; color: #697961; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.school-task-action { flex: 0 0 auto; min-height: 40px; padding: 8px 11px; border-radius: 8px; background: #e2ecd7; color: #375638; font-size: 12px; font-weight: 700; white-space: nowrap; }
.school-task-action:hover:enabled { background: #cddfba; }
.school-task-action:disabled { cursor: default; color: #798371; background: #edf0e7; }
.school-today-empty { padding: 22px 12px; color: #72806b; font-size: 13px; text-align: center; border: 1px dashed #dce4d2; border-radius: 12px; }
.school-game-entry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px; margin-bottom: 24px; border: 1px solid var(--school-line); border-radius: 16px; background: #f0f5e8; }
.school-game-entry .school-game-button { border: 1px solid #c4d6b6; color: #35573d; background: var(--school-paper); }
.school-game-entry .school-game-button:hover:enabled { background: #e4efd9; }
.school-game-entry .school-game-button:disabled { opacity: 0.55; cursor: default; }
#school-game-entry-cost { margin: 0; color: #65755b; font-size: 12px; }
.school-workshop-container { width: 100%; height: max(600px, calc(100dvh - 250px)); }
#school-workshop-frame { display: block; width: 100%; height: 100%; border: 0; border-radius: 16px; background: var(--school-paper); }

.school-launchpad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.school-launchpad-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    min-height: 102px;
    padding: 20px 18px;
    border: 1px solid #e4e8da;
    border-radius: 18px;
    text-align: left;
    background: var(--school-paper);
    box-shadow: var(--school-shadow);
    transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}

.school-launchpad-card:hover { transform: translateY(-3px); border-color: #b7c8a8; box-shadow: 0 8px 20px rgb(36 61 51 / 8%); }
.school-launchpad-card > img,
.school-launchpad-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.school-launchpad-icon img { width: 100%; height: 100%; object-fit: contain; }
.school-launchpad-card strong { display: block; color: #3c513c; font-size: 14px; font-weight: 800; line-height: 1.5; letter-spacing: -0.3px; }
.school-launchpad-card span:not(.school-launchpad-icon) { display: block; margin-top: 5px; color: #60705d; font-size: 12px; line-height: 1.5; }
.school-launchpad-card > span:not(.school-launchpad-icon):not(.school-launchpad-arrow) { margin-top: 0; }
.school-launchpad-card .school-launchpad-arrow { position: absolute; top: 14px; right: 14px; margin: 0; color: #8fa07f; font-size: 16px; line-height: 1; }
.school-launchpad-card > i { margin-left: auto; color: #a1b28e; font-size: 11px; }
.school-launchpad-card:nth-child(2) { background: #fcf8ee; border-color: #ede6d5; }
.school-launchpad-card:nth-child(3) { background: #f0f6ee; border-color: #e0eadb; }
.school-launchpad-card:nth-child(4) { background: #f4f2f8; border-color: #e8e3ed; }

.school-workspace #dashboard-grid { gap: 22px; }
.school-workspace #student-dashboard-left-wrapper > * + *,
.school-workspace #dashboard-right-wrapper > * + * { margin-top: 22px; }
.school-workspace :is(#bulk-wallet-manage-modal, #wallet-section, #market, #teacher-admin-panel, #teacher-purchase-log-section, #asset-allocation-section, #transfer-action-section, #transfer-history-section, #student-info-panel) {
    padding: 24px;
    background: var(--school-paper);
    border: 1px solid var(--school-line);
    border-radius: 20px;
    box-shadow: var(--school-shadow);
}

.school-workspace #dashboard-grid h2 { font-size: 17px; letter-spacing: -0.5px; line-height: 1.6; color: #3d543b; }
.school-workspace #bulk-manage-class-title { font-size: 18px; color: var(--school-green); }
.school-workspace #bulk-manage-class-subtitle { color: var(--school-muted); font-size: 13px; }
.school-workspace #bulk-wallet-manage-student-list { padding: 0; border: none; border-radius: 0; background: transparent; max-height: 490px; scrollbar-width: thin; scrollbar-color: #d3ddcb transparent; }
.school-workspace #bulk-wallet-manage-student-list > [data-student-id] {
    margin-top: 9px;
    padding: 13px 14px;
    border: 1px solid #e8eadf;
    border-radius: 13px;
    background: #fcfcf6;
    gap: 12px;
    transition: border-color 160ms, background-color 160ms;
}

.school-workspace #bulk-wallet-manage-student-list > [data-student-id]:first-child { margin-top: 0; }
.school-workspace #bulk-wallet-manage-student-list > [data-student-id]:hover { border-color: #c5d6b8; background: #f5f8ef; }
.school-workspace #bulk-wallet-manage-student-list > [data-student-id] > div:first-child { color: #43573b; font-size: 14px; }
.school-workspace #bulk-wallet-manage-student-list label {
    padding: 6px 8px;
    border-radius: 7px;
    border-color: #e0e5d8;
    color: #79816b;
    font-size: 12px;
}

.school-workspace #bulk-wallet-manage-student-list label:has(input:checked) { color: #365c3f; background: #e6efdd; border-color: #c4d7b6; }
.school-workspace #bulk-wallet-manage-student-list .bulk-wallet-amount { height: 36px; padding: 6px; font-size: 14px; border-radius: 7px; }
.school-workspace #bulk-wallet-manage-student-list .btn { padding: 7px 11px; min-height: 36px; border-radius: 7px; font-size: 12px; }
.school-workspace #bulk-wallet-manage-student-list .class-hw-btn { color: #8d7131; background: #f4eaca; }
.school-workspace #bulk-wallet-manage-student-list .class-lr-btn { color: #50733e; background: #e4eed8; }
.school-workspace #bulk-wallet-manage-student-list .class-view-btn { color: #547d79; background: #e1eeea; }
.school-workspace #bulk-wallet-manage-student-list .class-adjust-btn { color: #7b7d65; background: #ececdf; border-color: transparent; }

.school-workspace #wallet-financial-info { gap: 13px; }
.school-workspace #wallet-financial-info > div { padding: 17px 15px; border: 1px solid #e6ebdf; border-radius: 15px; background: #f5f8ef; }
.school-workspace #wallet-financial-info > div:nth-child(2) { background: #edf5ee; border-color: #dfeadf; }
.school-workspace #wallet-financial-info > div:nth-child(3) { background: #f4f0f8; border-color: #e9e2ee; }
.school-workspace #wallet-financial-info > div:nth-child(4) { background: #faf1e9; border-color: #f0e4d9; }
.school-workspace #wallet-financial-info .text-sm { font-size: 13px; font-weight: 500; }
.school-workspace #wallet-financial-info :is(#currentBalance, #totalAssetValue, #aedu-token-balance, #warning-token-balance) { margin-top: 6px; font-size: 25px; letter-spacing: -0.7px; line-height: 1.5; }
.school-workspace #currentBalance { color: #5a7b3d; }
.school-workspace #totalAssetValue { color: #2e7860; }
.school-workspace #aedu-token-balance { color: #8a70a1; }
.school-workspace #warning-token-balance { color: #b78254; }
.school-workspace #wallet-financial-info .text-xs { margin-top: 5px; font-size: 12px; line-height: 1.6; }
.school-workspace .wallet-adjust-btn { border-radius: 7px; background: #e5ebdc; color: #526542; font-size: 12px; }
.school-workspace .wallet-adjust-btn:hover { background: #d7e2c8; }
.school-workspace .wallet-adjust-btn.danger { color: #9b614c; background: #f4e4d9; }
.school-workspace #life-rules-container > div:first-child { border-color: #e8dfbc; background: #faf5e2; box-shadow: none; border-radius: 14px; }
.school-workspace #life-rules-container .bg-amber-400 { background: #caa45b; }

/* Students switch today's tasks beside their wallet; the market sits below. */
#student-transfer-overview { display: contents; }
.school-workspace #student-transfer-overview > div { margin-top: 22px; }
.school-today-tabs { display: none; }
#aedu-token-summary[hidden], #total-asset-summary[hidden], .school-today-panel[hidden] { display: none !important; }
#dashboard-container[data-school-role="student"] #main-tab-content.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}
#dashboard-container[data-school-role="student"] :is(#dashboard-grid, #student-dashboard-left-wrapper, #dashboard-right-wrapper) { display: contents !important; }
#dashboard-container[data-school-role="student"] :is(#school-today-section, #wallet-section, #market, #student-transfer-overview) { min-width: 0; margin: 0; order: 0; }
#dashboard-container[data-school-role="student"] #school-today-section {
    display: block;
    grid-row: 1;
    padding: 22px;
    border: 1px solid var(--school-line);
    border-radius: 20px;
    background: var(--school-paper);
    box-shadow: var(--school-shadow);
}
#dashboard-container[data-school-role="student"] .school-today-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.school-today-tabs button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; color: #6b7280; font-size: 15px; font-weight: 800; }
.school-today-tabs button[aria-selected="true"] { color: #b45309; background: #fef3c7; }
.school-today-tabs button:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
.school-today-count { min-width: 23px; padding: 1px 6px; border-radius: 999px; background: #e5e7eb; color: #4b5563; font-size: 12px; text-align: center; }
.school-today-tabs button[aria-selected="true"] .school-today-count { color: #92400e; background: #fde68a; }
#dashboard-container[data-school-role="student"] #school-today-section .school-today-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#dashboard-container[data-school-role="student"] .school-today-panel h2 { display: none; }
#dashboard-container[data-school-role="student"] #wallet-section { grid-row: 2; }
#dashboard-container[data-school-role="student"] #student-transfer-overview { display: flex; flex-direction: column; gap: 22px; grid-row: 4; }
#dashboard-container[data-school-role="student"] #student-transfer-overview > div { margin: 0; }
#dashboard-container[data-school-role="student"] #market { grid-row: 3; }
#dashboard-container[data-school-role="student"] :is(#aedu-token-summary, #total-asset-summary, .rpg-points, #school-drawer-token-summary, #main-dashboard-bottom-content, #wallet-section > hr) { display: none; }
#dashboard-container[data-school-role="student"] #wallet-financial-info { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
#dashboard-container[data-school-role="student"] #wallet-financial-info > div { min-width: 0; padding: 14px 12px; }
#dashboard-container[data-school-role="student"] #wallet-financial-info :is(#currentBalance, #warning-token-balance) { font-size: clamp(20px, 1.6vw, 25px); overflow-wrap: anywhere; }
#dashboard-container[data-school-role="student"] #wallet-section #asset-allocation-section {
    margin-top: 18px;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid var(--school-line);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
#dashboard-container[data-school-role="student"] #asset-allocation-section .chart-container { height: 190px; }

@media (min-width: 1024px) {
    #dashboard-container[data-school-role="student"] #main-tab-content.active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #dashboard-container[data-school-role="student"] #school-today-section { display: flex; flex-direction: column; align-self: stretch; min-height: 0; }
    #dashboard-container[data-school-role="student"] #school-today-section .school-today-panel { flex: 1; min-height: 0; position: relative; }
    #dashboard-container[data-school-role="student"] #school-today-section .school-today-list { position: absolute; inset: 0; max-height: none; }
    #dashboard-container[data-school-role="student"] #wallet-section { grid-row: 1; grid-column: 2; }
    #dashboard-container[data-school-role="student"] #market { grid-row: 2; grid-column: 1; }
    #dashboard-container[data-school-role="student"] #student-transfer-overview { grid-row: 2; grid-column: 2; }
}

@media (min-width: 1200px) {
    #dashboard-container[data-school-role="student"] #main-tab-content.active { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.school-workspace :is(#teacher-purchase-log-list, #transfer-history-list) > li { padding: 10px 12px; border-radius: 10px; background: #f6f8f1; border-color: #e8ecdF; line-height: 1.7; }
.school-workspace :is(#teacher-purchase-log-empty, #transfer-history-empty) { padding: 26px 15px; border: 1px dashed #dce4d2; border-radius: 12px; background: #f8faf3; font-size: 13px; }
.school-workspace #teacher-admin-panel { background: #edf3e5; border-color: #dce7ce; }
.school-workspace #teacher-admin-panel .btn { font-size: 13px; min-height: 42px; }
.school-workspace #teacher-admin-panel h2 { color: #547140; }

/* Only ordinary workspace panels receive the paper treatment. */
.school-workspace .tab-content:not(#main-tab-content) > :is(.bg-white, .bg-white\/80),
.school-workspace :is(#copy-promise-history-container, #learning-problem-list, #life-rule-list, #aiedu-korean-tab-container) {
    background: var(--school-paper);
    border: 1px solid var(--school-line);
    border-radius: 20px;
    box-shadow: var(--school-shadow);
}

.school-workspace .tab-content:not(#main-tab-content) > h2,
.school-workspace .tab-content:not(#main-tab-content) > div > h2 { color: #355238; font-size: 20px; letter-spacing: -0.7px; }
.school-workspace .tab-content:not(#main-tab-content) > .flex:first-child { gap: 16px; flex-wrap: wrap; margin-bottom: 23px; }
.school-workspace :is(#learning-problems-tab-content, #life-rules-management-tab-content) > .flex:first-child > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
.school-workspace :is(#learning-problems-tab-content, #life-rules-management-tab-content) > .flex:first-child > div:last-child > * { margin-left: 0; }
.school-workspace .type-filter-btn { border-radius: 9px; border-color: #dfe6d5; background: #f7f9f2; color: #6b7c5d; }
.school-workspace .type-filter-btn.active { color: #fff; background: var(--school-green); border-color: var(--school-green); box-shadow: none; }
.school-workspace .cloud-file-card { border-color: var(--school-line); border-radius: 16px; box-shadow: var(--school-shadow); }
.school-workspace .cloud-file-card:hover { border-color: #b2c9a3; box-shadow: 0 6px 18px rgb(36 61 51 / 8%); }
.school-workspace #shop-item-list > .bg-white { border-radius: 19px; border: 1px solid var(--school-line); box-shadow: var(--school-shadow); }

.school-workspace .btn,
body:has(#dashboard-container.active) .modal-content .btn {
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    transition: background-color 160ms, border-color 160ms, box-shadow 160ms;
    box-shadow: none;
}

.school-workspace .btn-primary,
body:has(#dashboard-container.active) .modal-content .btn-primary { background: #245343; color: #fff; }
.school-workspace .btn-primary:hover,
body:has(#dashboard-container.active) .modal-content .btn-primary:hover { background: #183e30; box-shadow: 0 3px 8px rgb(36 83 67 / 13%); }
.school-workspace .btn-secondary,
body:has(#dashboard-container.active) .modal-content .btn-secondary { background: #f3f5ec; color: #637154; border: 1px solid #dde4d3; }
.school-workspace .btn-secondary:hover,
body:has(#dashboard-container.active) .modal-content .btn-secondary:hover { background: #e8efdd; border-color: #c9d6b9; }
.school-workspace .btn-purple,
body:has(#dashboard-container.active) .modal-content .btn-purple { background: #857296; }
.school-workspace .btn:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; }

.school-workspace :is(input.form-input, select.form-input, textarea.form-input, .bulk-wallet-amount),
body:has(#dashboard-container.active) .modal-content :is(input.form-input, select.form-input, textarea.form-input) {
    border-color: #dfe5d8;
    border-radius: 10px;
    background: #fffefb;
    color: #42533a;
    font-size: 14px;
    transition: border-color 160ms, box-shadow 160ms;
}

.school-workspace :is(input, textarea)::placeholder { color: #9aA28d; }
.school-workspace :is(input[type='checkbox'], input[type='radio']),
body:has(#dashboard-container.active) .modal-content :is(input[type='checkbox'], input[type='radio']) { accent-color: #397752; }
.school-workspace :is(input, textarea, select):focus,
body:has(#dashboard-container.active) .modal-content .form-input:focus { border-color: #8cb779; outline: none; box-shadow: 0 0 0 3px rgb(144 183 121 / 17%); }
.school-workspace label { line-height: 1.6; }
.school-workspace :is(.text-gray-500, .text-stone-500, .text-slate-500) { color: var(--school-muted); }
.school-workspace :is(.border-gray-200, .border-stone-200) { border-color: var(--school-line); }
.school-workspace hr { border-color: var(--school-line); }
.school-workspace :is(#homework-tab-content, #copy-promises-tab-content, #learning-problems-tab-content, #life-rules-management-tab-content) table { font-size: 14px; }
.school-workspace :is(#homework-tab-content, #copy-promises-tab-content, #learning-problems-tab-content, #life-rules-management-tab-content) thead { background: #eef3e6; }
.school-workspace :is(#homework-tab-content, #copy-promises-tab-content, #learning-problems-tab-content, #life-rules-management-tab-content) th { color: #6f8062; font-size: 12px; font-weight: 700; padding: 16px 20px; }
.school-workspace :is(#homework-tab-content, #copy-promises-tab-content, #learning-problems-tab-content, #life-rules-management-tab-content) td { padding: 17px 20px; border-color: var(--school-line); }
.school-workspace :is(#homework-tab-content, #copy-promises-tab-content) tbody tr:hover { background: #f7faf1; }
.school-workspace #homework-tab-content > .bg-white { overflow-x: auto; }

body:has(#dashboard-container.active) .modal-overlay { background-color: rgb(29 50 36 / 45%); backdrop-filter: blur(4px); }
body:has(#dashboard-container.active) .modal-content {
    padding: 30px;
    border: 1px solid #e4e9dc;
    border-radius: 22px;
    background: #fffef9;
    color: #334b36;
    box-shadow: 0 20px 70px rgb(25 47 31 / 18%);
}

body:has(#dashboard-container.active) .modal-content > :is(h2, h3) { color: #36553b; font-size: 19px; letter-spacing: -0.5px; }
body:has(#dashboard-container.active) .modal-content .close-button { color: #9aaa8a; top: 12px; right: 18px; }
.school-dashboard-shell :is(button, a, input, textarea, select):focus-visible,
body:has(#dashboard-container.active) .modal-content :is(button, a, input, textarea, select):focus-visible { outline: 3px solid #91ba71; outline-offset: 3px; }

@media (min-width: 768px) {
    #dashboard-container.sidebar-collapsed .school-sidebar { width: 82px; }
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-sidebar-panel { padding: 23px 12px 18px; }
    #dashboard-container.sidebar-collapsed .school-sidebar-brand { width: 45px; margin: 0 6px 24px; overflow: hidden; }
    #dashboard-container.sidebar-collapsed .school-sidebar-brand img { width: 174px; max-width: none; flex: 0 0 174px; }
    #dashboard-container.sidebar-collapsed .school-sidebar-user { justify-content: center; padding: 9px 0; background: transparent; border-color: transparent; }
    #dashboard-container.sidebar-collapsed .school-sidebar-user .sidebar-user-meta { display: none; }
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-tab { padding-inline: 12px; min-height: 45px; }
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-tab.active::after { display: none; }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .school-dashboard-shell .school-sidebar { width: 219px; }
    .school-sidebar-brand { margin-inline: 5px; }
    .school-sidebar-brand img { width: 166px; }
    .school-sidebar .dashboard-sidebar-panel { padding-inline: 14px; }
    .school-topbar { padding-inline: 25px; }
    .school-workspace .school-workspace-scroll { padding: 25px; }
    .school-topbar-date { padding: 9px 10px; font-size: 12px; }
    .school-launchpad { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .school-launchpad-card { min-height: 86px; padding: 16px; }
    .school-workspace #wallet-financial-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1199px) and (min-width: 1024px) {
    .school-workspace #dashboard-grid.teacher-layout { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .school-workspace #dashboard-grid.teacher-layout #teacher-admin-panel { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 1023px) {
    .school-workspace #dashboard-grid.teacher-layout #dashboard-right-wrapper { order: 2; }
    .school-workspace #dashboard-grid.teacher-layout #teacher-admin-panel { order: 3; }
}

@media (max-width: 767px) {
    .school-dashboard-shell .school-sidebar,
    #dashboard-container.sidebar-collapsed .school-sidebar { width: 100%; height: auto; max-height: 184px; flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--school-line); }
    .school-sidebar .dashboard-sidebar-panel,
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-sidebar-panel {
        position: relative;
        display: grid;
        grid-template-columns: minmax(120px, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        flex: none;
        gap: 8px 12px;
        padding: 13px 16px 10px;
        overflow: visible;
    }
    .school-sidebar-brand { min-height: 35px; margin: 0; }
    .school-sidebar-brand img { width: 143px; }
    .school-sidebar .school-sidebar-user { padding: 0; margin: 0 40px 0 0; border: none; border-radius: 0; background: transparent; max-width: 167px; }
    .school-sidebar-user .sidebar-user-meta { gap: 7px; }
    .school-sidebar-user .sidebar-user-meta > div:first-child { width: 28px; height: 28px; border-radius: 10px; font-size: 12px; }
    .school-sidebar #sidebar-user-name { font-size: 13px; }
    .school-sidebar #sidebar-user-role { font-size: 11px; }
    .school-sidebar #sidebar-user-email { display: none; }
    .school-sidebar #sidebar-edit-name-btn { width: 28px; height: 28px; font-size: 12px; }
    .school-sidebar #sidebar-toggle-btn { width: 23px; height: 28px; margin-left: 4px; font-size: 10px; }
    .school-sidebar #logout-btn { position: absolute; top: 17px; right: 15px; width: 29px; height: 29px; padding: 0; border: 1px solid #e5eadc; border-radius: 9px; font-size: 11px; }
    .school-sidebar #logout-btn .sidebar-action-label { display: none; }
    .school-sidebar #dashboard-tabs { display: flex; flex-direction: row; grid-column: 1 / -1; gap: 6px; margin: 0 -16px; padding: 3px 16px 1px; overflow-x: auto; scrollbar-width: none; flex: none; }
    .school-sidebar #dashboard-tabs::-webkit-scrollbar { display: none; }
    .school-sidebar .dashboard-tab { flex: 0 0 auto; width: auto; min-height: 44px; padding: 10px 12px; font-size: 14px; gap: 7px; white-space: nowrap; border-radius: 9px; }
    .school-sidebar .dashboard-tab i { font-size: 13px; width: 14px; }
    .school-sidebar .dashboard-tab.active { box-shadow: none; }
    .school-sidebar .dashboard-tab.active::after { display: none; }
    #dashboard-container.sidebar-collapsed .school-sidebar .sidebar-user-meta { opacity: 1; width: auto; }
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-tab { font-size: 14px; gap: 7px; padding-inline: 12px; }
    #dashboard-container.sidebar-collapsed .school-sidebar .dashboard-tab i { font-size: 13px; }
    #dashboard-container.sidebar-collapsed .school-sidebar #dashboard-tabs { display: none; }
    .school-topbar { min-height: 88px; padding: 18px 20px 16px; gap: 12px; flex-wrap: wrap; }
    .school-page-kicker { font-size: 10px; letter-spacing: 1.7px; }
    #school-page-title { font-size: 19px; }
    #school-page-description { max-width: 225px; font-size: 13px; }
    .school-topbar-date { padding: 8px; font-size: 11px; border-radius: 9px; gap: 5px; }
    .school-topbar-right { gap: 7px; }
    .school-topbar #dashboard-action-buttons-container { gap: 5px; }
    .school-topbar #dashboard-action-buttons-container .btn { padding: 9px 10px; font-size: 12px; }
    .school-workspace .school-workspace-scroll { padding: 18px 17px 32px; }
    .school-topbar-right { justify-content: flex-start; width: 100%; }
    .school-subject-links a { padding: 8px 9px; font-size: 11px; }
    .school-today-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
    .school-today-panel { padding: 17px; border-radius: 17px; }
    .school-task-row { padding: 10px 8px; gap: 8px; }
    .school-task-action { padding-inline: 8px; }
    .school-game-entry { padding: 14px; }
    #school-game-entry-cost { width: 100%; }
    .school-workshop-container { height: max(640px, calc(100dvh - 300px)); }
    .school-launchpad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 22px; }
    .school-launchpad-card { gap: 9px; min-height: 86px; padding: 13px 11px; border-radius: 14px; }
    .school-launchpad-card > img, .school-launchpad-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .school-launchpad-card strong { font-size: 14px; }
    .school-launchpad-card span:not(.school-launchpad-icon) { font-size: 12px; margin-top: 3px; }
    .school-launchpad-card > i, .school-launchpad-card > span.school-launchpad-arrow { display: none; }
    .school-workspace #dashboard-grid { gap: 16px; }
    .school-workspace #student-dashboard-left-wrapper > * + *, .school-workspace #dashboard-right-wrapper > * + * { margin-top: 16px; }
    .school-workspace :is(#bulk-wallet-manage-modal, #wallet-section, #market, #teacher-admin-panel, #teacher-purchase-log-section, #asset-allocation-section, #transfer-action-section, #transfer-history-section, #student-info-panel) { padding: 19px 17px; border-radius: 17px; }
    .school-workspace #bulk-wallet-manage-modal > div:first-child { gap: 12px; }
    .school-workspace #bulk-wallet-manage-modal > div:first-child > div:last-child { width: 100%; }
    .school-workspace #bulk-wallet-manage-modal > div:first-child > div:last-child .btn { flex: 1; padding: 10px 12px; font-size: 13px; }
    .school-workspace #bulk-wallet-manage-student-list > [data-student-id] { padding: 12px; gap: 10px; }
    .school-workspace #bulk-wallet-manage-student-list > [data-student-id] > div:last-child { gap: 9px; justify-content: flex-start; }
    .school-workspace #bulk-wallet-manage-student-list > [data-student-id] > div:last-child > div:first-child { border-right: none; padding-right: 0; gap: 5px; }
    .school-workspace #bulk-wallet-manage-student-list label { padding: 6px 7px; font-size: 12px; }
    .school-workspace #bulk-wallet-manage-student-list .bulk-wallet-amount { width: 58px; height: 35px; }
    .school-workspace #bulk-wallet-manage-student-list .btn { min-height: 40px; }
    .school-workspace #wallet-financial-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .school-workspace #wallet-financial-info > div { padding: 12px 10px; border-radius: 11px; }
    .school-workspace #wallet-financial-info :is(#currentBalance, #totalAssetValue, #aedu-token-balance, #warning-token-balance) { font-size: 22px; }
    .school-workspace #wallet-financial-info .text-xs { font-size: 12px; }
    .school-workspace .tab-content:not(#main-tab-content) > .flex:first-child { gap: 12px; margin-bottom: 17px; }
    .school-workspace .tab-content:not(#main-tab-content) > .flex:first-child > div:last-child { justify-content: flex-start; }
    .school-workspace .btn { padding: 10px 12px; font-size: 14px; }
    .school-workspace :is(#homework-tab-content, #copy-promises-tab-content) table { min-width: 510px; }
    .school-workspace .tab-content:not(#main-tab-content) > .bg-white { border-radius: 17px; }
    body:has(#dashboard-container.active) .modal-content { padding: 24px 20px; border-radius: 18px; }
}

@media (max-width: 374px) {
    .school-sidebar-brand img { width: 123px; }
    .school-sidebar .school-sidebar-user { max-width: 145px; margin-right: 32px; }
    .school-sidebar-user .sidebar-user-meta > div:first-child { display: none; }
    .school-topbar-date { font-size: 11px; }
    .school-launchpad-card { gap: 7px; }
    .school-launchpad-card > img, .school-launchpad-icon { width: 31px; height: 31px; flex-basis: 31px; }
}

@media (prefers-reduced-motion: reduce) {
    .school-dashboard-shell *, .school-dashboard-shell *::before, .school-dashboard-shell *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
    .school-launchpad-card:hover, .school-workspace .cloud-file-card:hover { transform: none; }
}
