        .handsontable th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable thead th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable tbody th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_top th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_left th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_inline_start th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_top_left_corner th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_top_inline_start_corner th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .ht_clone_bottom th:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        .handsontable .htDimmed:not(.tuition-unpaid):not(.tuition-paid):not(.schedule-booking-unpaid):not(.schedule-booking-paid),
        .handsontable .wtHolder,
        .handsontable .htCore,
        #schedule-view .handsontable,
        #schedule-view .wtHider,
        #schedule-view .ht_master,
        #schedule-view .ht_clone_left,
        #schedule-view .ht_clone_inline_start,
        #schedule-view .ht_clone_top,
        #schedule-view .ht_clone_top_left_corner,
        #schedule-view .ht_clone_top_inline_start_corner {
            background-color: #ffffff !important;
            color: #374151 !important;
        }
        #schedule-view .handsontable td.tuition-unpaid,
        #schedule-view .handsontable td.tuition-unpaid.htDimmed,
        .handsontable td.tuition-unpaid,
        .handsontable td.tuition-unpaid.htDimmed {
            background-color: #fee2e2 !important;
            color: #991b1b !important;
            font-weight: 700;
        }
        #schedule-view .handsontable td.tuition-paid,
        #schedule-view .handsontable td.tuition-paid.htDimmed,
        .handsontable td.tuition-paid,
        .handsontable td.tuition-paid.htDimmed {
            background-color: #dcfce7 !important;
            color: #166534 !important;
            font-weight: 700;
        }
        /* 時間表：請假／補堂已上 → 黃底啡字（含 clone／htDimmed） */
        #schedule-view .handsontable td.schedule-makeup-done,
        #schedule-view .handsontable td.schedule-makeup-done.htDimmed,
        #schedule-view .handsontable .ht_master td.schedule-makeup-done,
        #schedule-view .handsontable .ht_clone_left td.schedule-makeup-done {
            background-color: #fef08a !important;
            background: #fef08a !important;
            color: #854d0e !important;
            font-weight: 700;
        }
        /* 試堂／短期自動對應：已付＝學費已收綠；未付＝學費未收粉紅底紅字 */
        #schedule-view .handsontable td.schedule-booking-paid,
        #schedule-view .handsontable td.schedule-booking-paid.htDimmed,
        #schedule-view .handsontable .ht_master td.schedule-booking-paid,
        #schedule-view .handsontable .ht_clone_left td.schedule-booking-paid {
            background-color: #dcfce7 !important;
            background: #dcfce7 !important;
            color: #166534 !important;
            font-weight: 700;
        }
        #schedule-view .handsontable td.schedule-booking-unpaid,
        #schedule-view .handsontable td.schedule-booking-unpaid.htDimmed,
        #schedule-view .handsontable .ht_master td.schedule-booking-unpaid,
        #schedule-view .handsontable .ht_clone_left td.schedule-booking-unpaid {
            background-color: #fee2e2 !important;
            background: #fee2e2 !important;
            color: #991b1b !important;
            font-weight: 700;
        }
        .handsontable th { font-weight: bold; border-color: #e5e7eb !important; }
        /* 時間表：只著色「有日期」的表頭格（含手工日期表頭內層），學生日期格保持白色 */
        #schedule-view .handsontable th.schedule-date-header-tint,
        #schedule-view .handsontable .ht_clone_top th.schedule-date-header-tint,
        #schedule-view .handsontable .ht_clone_top_inline_start_corner th.schedule-date-header-tint,
        #schedule-view .handsontable .ht_master th.schedule-date-header-tint,
        #schedule-view .handsontable th.schedule-date-header-tint .relative,
        #schedule-view .handsontable th.schedule-date-header-tint .colHeader,
        #schedule-view .handsontable th.schedule-date-header-tint .schedule-date-header-inner,
        #schedule-view .handsontable th.schedule-date-header-tint input {
            background-color: var(--schedule-date-header-bg, #cb67a7) !important;
            background: var(--schedule-date-header-bg, #cb67a7) !important;
            color: #111827 !important;
        }
        #schedule-view .handsontable th.schedule-tutor-header,
        #schedule-view .handsontable .ht_clone_top th.schedule-tutor-header,
        #schedule-view .handsontable .ht_master th.schedule-tutor-header,
        #schedule-view .handsontable th.schedule-tutor-header .relative,
        #schedule-view .handsontable th.schedule-tutor-header .colHeader,
        #schedule-view .handsontable th.schedule-fixed-white-header:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        #schedule-view .handsontable .ht_clone_top th.schedule-fixed-white-header:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        #schedule-view .handsontable .ht_master th.schedule-fixed-white-header:not(.schedule-date-header-tint):not(.schedule-header-custom-fill):not(.schedule-handcraft-header):not(.schedule-adult-date-header),
        #schedule-view .handsontable th.schedule-fixed-white-header:not(.schedule-date-header-tint) .relative,
        #schedule-view .handsontable th.schedule-fixed-white-header:not(.schedule-date-header-tint) .colHeader {
            background-color: #ffffff !important;
            background: #ffffff !important;
            color: #111827 !important;
        }
        #schedule-view .handsontable .schedule-adult-date-header,
        #schedule-view .handsontable th.schedule-adult-date-header,
        #schedule-view .handsontable th.schedule-adult-date-header .relative,
        #schedule-view .handsontable th.schedule-adult-date-header .colHeader,
        #schedule-view .handsontable th.schedule-adult-date-header .schedule-date-header-inner,
        #schedule-view .handsontable th.schedule-adult-date-header input {
            background-color: var(--schedule-adult-date-header-bg, #bdf2d3) !important;
            background: var(--schedule-adult-date-header-bg, #bdf2d3) !important;
            color: #111827 !important;
        }
        #schedule-view .handsontable th.schedule-date-header-tint .schedule-handcraft-label {
            background-color: transparent !important;
            background: transparent !important;
            color: #d97706 !important;
        }
        /* 只改手工日期表頭：不依賴表頭 class，避免被白底蓋過 */
        #schedule-view .handsontable th.schedule-handcraft-header,
        #schedule-view .handsontable .ht_clone_top th.schedule-handcraft-header,
        #schedule-view .handsontable .ht_master th.schedule-handcraft-header,
        #schedule-view .handsontable th.schedule-handcraft-header .relative,
        #schedule-view .handsontable th.schedule-handcraft-header .colHeader,
        #schedule-view .handsontable th.schedule-handcraft-header .schedule-date-header-inner,
        #schedule-view .handsontable th.schedule-handcraft-header input,
        #schedule-view .handsontable .schedule-handcraft-header {
            background-color: var(--schedule-handcraft-header-bg, var(--schedule-date-header-bg, #bdf2d3)) !important;
            background: var(--schedule-handcraft-header-bg, var(--schedule-date-header-bg, #bdf2d3)) !important;
            color: #111827 !important;
        }
        #schedule-view .handsontable th.schedule-header-custom-fill,
        #schedule-view .handsontable .ht_clone_top th.schedule-header-custom-fill,
        #schedule-view .handsontable .ht_master th.schedule-header-custom-fill,
        #schedule-view .ht_clone_top th.schedule-header-custom-fill,
        .handsontable .ht_clone_top th.schedule-header-custom-fill,
        .handsontable th.schedule-header-custom-fill,
        #schedule-view .handsontable th.schedule-header-custom-fill .relative,
        #schedule-view .handsontable th.schedule-header-custom-fill .colHeader,
        #schedule-view .handsontable th.schedule-header-custom-fill .schedule-date-header-inner,
        #schedule-view .handsontable th.schedule-header-custom-fill input {
            background-color: var(--schedule-header-custom-bg, #ffffff) !important;
            background: var(--schedule-header-custom-bg, #ffffff) !important;
            color: #111827 !important;
        }
        .handsontable td { position: relative; vertical-align: middle; border-color: #e5e7eb !important; font-size: 14px; background-color: #ffffff; color: #000000; }
        body.teacher-readonly .schedule-edit-only,
        body.teacher-readonly .triangle-btn,
        body.teacher-readonly .triangle-btn-br,
        body.teacher-readonly .triangle-btn-folder,
        body.teacher-readonly .corner-add-btn,
        body.teacher-readonly .folder-card > button,
        body.teacher-readonly #sidebar-nav > div.border-t {
            display: none !important;
        }
        /* 只有管理員可刪已繳學費雲端紀錄 */
        body:not(.role-administrator) .paid-record-delete { display: none !important; }
        body.teacher-readonly .folder-card-name {
            pointer-events: none !important;
        }
        body.teacher-readonly .time-input,
        body.teacher-readonly .room-input,
        body.teacher-readonly .tutor-input,
        body.teacher-readonly .limit-input {
            pointer-events: none !important;
            background: #f9fafb !important;
        }
        .schedule-table-toolbar {
            font-size: 1.05rem;
            padding-top: 0.6rem;
            padding-bottom: 0.6rem;
        }
        .schedule-table-toolbar .schedule-toolbar-field {
            font-size: 1.05rem;
            gap: 0.6rem;
        }
        .schedule-table-toolbar i {
            font-size: 1.05rem;
        }
        .schedule-table-toolbar .time-input,
        .schedule-table-toolbar .room-input,
        .schedule-table-toolbar .tutor-input,
        .schedule-table-toolbar .limit-input {
            font-size: 1.05rem;
            line-height: 1.35;
            padding: 0.3rem 0.6rem;
            min-height: 2.1rem;
            height: 2.1rem;
            box-sizing: border-box;
        }
        .schedule-table-toolbar .time-input { width: 14.4rem; }
        .schedule-table-toolbar .room-input { width: 7.2rem; }
        .schedule-table-toolbar .tutor-input,
        .schedule-table-toolbar .limit-input { width: 4.8rem; }
        .schedule-table-toolbar .schedule-edit-only button {
            font-size: 1.05rem;
            padding: 0.45rem 0.6rem;
        }
        html { color-scheme: light !important; background: #ffffff !important; }
        body { background: #ffffff !important; }
        html, body, main, .flex.flex-1.overflow-hidden,
        #schedule-view,
        #schedule-view > div,
        #schedule-folder-view,
        #student-view, #course-view, #trial-view, #short-view, #special-table-view, #tuition-desk-view, #contest-view, #dates-table-view, #report-view,
        #trial-folder-view, #short-folder-view, #special-folder-view, #tuition-folder-view, #dates-folder-view,
        #schedule-footer, #hot-table-zoom-container, #schedule-zoom-outer, #schedule-scroll-area,
        #sidebar-aside, #sidebar-aside > div, #sidebar-nav, #app-header, #dock-bar,
        .seamless-table-wrapper, .seamless-table-wrapper > div {
            background-color: #ffffff !important;
        }
        #sidebar-aside { border-right-color: #e5e7eb !important; }
        .htContextMenu, .htContextMenu table, .htContextMenu table tbody,
        .htContextMenu table tbody tr, .htContextMenu table tbody tr td,
        .htContextMenu .ht_master, .htContextMenu .wtHolder {
            background: #ffffff !important;
            color: #111827 !important;
        }
        .htContextMenu table tbody tr td:hover { background: #f3f4f6 !important; }
        #excel-color-picker {
            position: fixed; z-index: 20000; display: none; width: 242px;
            background: #ffffff; color: #1f1f1f; border: 1px solid #d4d4d4;
            border-radius: 2px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
            padding: 8px 8px 4px; font-size: 12px; font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
        }
        #excel-color-picker.open { display: block; }
        #excel-color-picker .ecp-mode {
            display: flex; gap: 4px; margin-bottom: 6px;
        }
        #excel-color-picker .ecp-mode-btn {
            flex: 1; border: 1px solid #d1d5db; background: #fff; color: #374151;
            border-radius: 4px; padding: 4px 0; font-size: 11px; font-weight: 700; cursor: pointer;
        }
        #excel-color-picker .ecp-mode-btn.active {
            background: #2563eb; border-color: #1d4ed8; color: #fff;
        }
        #excel-color-picker .ecp-hc {
            display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px;
            border-bottom: 1px solid #e5e5e5; margin-bottom: 6px; cursor: pointer; user-select: none;
        }
        #text-color-trigger {
            position: fixed; z-index: 26000; display: none; width: 30px; height: 30px;
            align-items: center; justify-content: center; border: 1px solid #d1d5db;
            border-radius: 6px; background: #fff; color: #111827; box-shadow: 0 4px 12px rgba(15,23,42,0.16);
            cursor: pointer; font-weight: 800; font-size: 14px; line-height: 1;
        }
        #text-color-trigger.open { display: flex; }
        #text-color-trigger .tc-bar {
            display: block; width: 14px; height: 3px; border-radius: 2px; background: currentColor; margin-top: 1px;
        }
        #excel-color-picker .ecp-title {
            font-weight: 600; color: #5a5a5a; margin: 6px 2px 5px; font-size: 11px;
        }
        #excel-color-picker .ecp-grid {
            display: grid; grid-template-columns: repeat(10, 18px); gap: 2px; justify-content: space-between;
        }
        #excel-color-picker .ecp-theme-shades { margin-top: 4px; }
        #excel-color-picker .ecp-swatch {
            width: 18px; height: 18px; border: 1px solid #c8c8c8; border-radius: 0; cursor: pointer; padding: 0;
            box-sizing: border-box;
        }
        #excel-color-picker .ecp-swatch:hover { outline: 1px solid #fff; box-shadow: 0 0 0 2px #c55a11; }
        #excel-color-picker .ecp-swatch.selected { outline: 1px solid #fff; box-shadow: 0 0 0 2px #c55a11; }
        #excel-color-picker .ecp-actions { margin-top: 6px; border-top: 1px solid #e5e5e5; padding-top: 2px; }
        #excel-color-picker .ecp-item {
            width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 0;
            background: transparent; padding: 6px 4px; color: #1f1f1f; cursor: pointer; font-size: 12px;
        }
        #excel-color-picker .ecp-item:hover { background: #f3f3f3; }
        #excel-color-picker .ecp-item-icon {
            width: 16px; height: 16px; border: 1px solid #b4b4b4; background: #fff; flex-shrink: 0; box-sizing: border-box;
        }
        #excel-color-picker .ecp-item-wheel {
            width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
            background: conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
        }
        #excel-more-colors-overlay {
            position: fixed; inset: 0; z-index: 21000; display: none;
            background: rgba(0, 0, 0, 0.28); align-items: center; justify-content: center;
        }
        #excel-more-colors-overlay.open { display: flex; }
        #excel-more-colors-dialog {
            width: 520px; max-width: calc(100vw - 24px); background: #f3f3f3; color: #1f1f1f;
            border: 1px solid #9a9a9a; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
            font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif; font-size: 12px;
        }
        #excel-more-colors-dialog .emd-titlebar {
            display: flex; align-items: center; justify-content: space-between;
            padding: 8px 10px 0 12px; font-size: 13px; font-weight: 600;
        }
        #excel-more-colors-dialog .emd-btns { display: flex; gap: 8px; }
        #excel-more-colors-dialog .emd-btns button {
            min-width: 76px; padding: 4px 10px; border: 1px solid #adadad; background: #fff; cursor: pointer;
        }
        #excel-more-colors-dialog .emd-btns button:hover { background: #e8f4fc; border-color: #7eb4ea; }
        #excel-more-colors-dialog .emd-tabs { display: flex; gap: 0; padding: 8px 12px 0; }
        #excel-more-colors-dialog .emd-tab {
            border: 1px solid #c6c6c6; background: #e8e8e8; padding: 5px 14px; cursor: pointer; margin-right: -1px;
        }
        #excel-more-colors-dialog .emd-tab.active { background: #fff; border-bottom-color: #fff; font-weight: 600; }
        #excel-more-colors-dialog .emd-body { background: #fff; border-top: 1px solid #c6c6c6; padding: 12px; }
        #excel-more-colors-dialog .emd-honeycomb-row { display: flex; justify-content: center; }
        #excel-more-colors-dialog .emd-honeycomb-row.offset { margin-left: 16px; }
        #excel-more-colors-dialog .emd-hex {
            width: 28px; height: 32px; border: 0; padding: 0; margin: -3px 1px; cursor: pointer;
            clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        }
        #excel-more-colors-dialog .emd-hex:hover { outline: 2px solid #c55a11; z-index: 1; }
        #excel-more-colors-dialog .emd-custom { display: flex; gap: 14px; align-items: flex-start; }
        #excel-more-colors-dialog .emd-spectrum-wrap { position: relative; }
        #excel-more-colors-dialog #emd-spectrum {
            width: 260px; height: 150px; display: block; cursor: crosshair; border: 1px solid #8a8a8a;
        }
        #excel-more-colors-dialog #emd-crosshair {
            position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; pointer-events: none;
            border: 1px solid #000; border-radius: 50%; box-shadow: 0 0 0 1px #fff;
        }
        #excel-more-colors-dialog .emd-lum-wrap { position: relative; height: 150px; width: 22px; }
        #excel-more-colors-dialog #emd-luminance {
            width: 14px; height: 150px; display: block; border: 1px solid #8a8a8a; cursor: ns-resize;
        }
        #excel-more-colors-dialog #emd-lum-arrow {
            position: absolute; left: 14px; top: 0; width: 0; height: 0; pointer-events: none;
            border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 8px solid #111;
            margin-top: -6px;
        }
        #excel-more-colors-dialog .emd-fields { display: grid; grid-template-columns: auto 72px; gap: 6px 8px; align-items: center; }
        #excel-more-colors-dialog .emd-fields input, #excel-more-colors-dialog .emd-fields select {
            width: 72px; border: 1px solid #8a8a8a; padding: 2px 4px; font-size: 12px;
        }
        #excel-more-colors-dialog .emd-preview {
            width: 72px; border: 1px solid #8a8a8a; overflow: hidden;
        }
        #excel-more-colors-dialog .emd-preview div { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
        #emoji-picker {
            position: fixed; z-index: 20000; display: none; width: 292px;
            background: #ffffff; color: #111827; border: 1px solid #d1d5db;
            border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
            padding: 10px; font-size: 12px;
        }
        #emoji-picker.open { display: block; }
        #emoji-picker .emp-title {
            font-weight: 700; color: #4b5563; margin: 0 0 8px; font-size: 12px;
        }
        #emoji-picker .emp-grid {
            display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
        }
        #emoji-picker .emp-btn {
            width: 100%; aspect-ratio: 1; border: 1px solid #e5e7eb; border-radius: 6px;
            background: #fff; cursor: pointer; font-size: 18px; line-height: 1; padding: 0;
        }
        #emoji-picker .emp-btn:hover { border-color: #2563eb; background: #eff6ff; }
        #hot-table-zoom-container.schedule-zoomed-out .seamless-table-wrapper {
            margin-bottom: 0.25rem !important;
        }
        #app-header { overflow: visible !important; padding: 0.45rem 0.85rem !important; }
        #header-main-row {
            display: flex; align-items: center; gap: 0.45rem; min-width: 0; width: 100%;
        }
        #header-title-block {
            display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; min-width: 0;
        }
        #page-title {
            min-width: 0 !important; max-width: min(220px, 28vw);
            font-size: 1.15rem !important; line-height: 1.2; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis;
        }
        #header-toolbar-scroll {
            flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden;
            -webkit-overflow-scrolling: touch; background: #ffffff;
            border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.2rem 0.3rem 0.15rem;
            scrollbar-width: thin; scrollbar-color: #93c5fd #ffffff;
        }
        #header-toolbar-scroll::-webkit-scrollbar { height: 8px; }
        #header-toolbar-scroll::-webkit-scrollbar-track { background: #ffffff; border-radius: 999px; }
        #header-toolbar-scroll::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 999px; }
        #header-toolbar-scroll::-webkit-scrollbar-thumb:hover { background: #60a5fa; }
        #header-toolbar {
            display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
            gap: 0.3rem; width: max-content; min-height: 2rem;
        }
        #header-toolbar .header-chip {
            display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap;
            height: 1.85rem; padding: 0 0.45rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 700;
            border: 1px solid #d1d5db; background: #ffffff; color: #374151;
        }
        #logout-button {
            display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap;
            height: 1.85rem; padding: 0 0.55rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 700;
            border: 1px solid #d1d5db; background: #ffffff; color: #374151; flex-shrink: 0;
        }
        #header-toolbar .header-chip-blue { background: #2563eb; border-color: #1d4ed8; color: #fff; }
        #header-toolbar .header-chip-soft { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
        #header-toolbar .relative.search-box { width: 12rem; min-width: 9rem; flex: 0 0 auto; }
        #header-toolbar .relative.search-box input { height: 1.85rem; padding-top: 0; padding-bottom: 0; font-size: 0.75rem; }
        #header-toolbar.schedule-match-title {
            min-height: 2.15rem;
            gap: 0.4rem;
        }
        #header-toolbar.schedule-match-title .header-chip {
            font-size: 1.15rem;
            height: 2.15rem;
            padding: 0 0.7rem;
        }
        #header-toolbar.schedule-match-title .header-chip i {
            font-size: 0.95rem;
        }
        #header-toolbar.schedule-match-title .search-box {
            width: 22rem;
            min-width: 16rem;
        }
        #header-toolbar.schedule-match-title .search-box input {
            font-size: 1.15rem;
            height: 2.15rem;
            padding-left: 2rem;
        }
        #header-toolbar.schedule-match-title .search-box i {
            font-size: 0.95rem;
        }
        #search-results {
            position: fixed !important; z-index: 30000 !important;
            background: #ffffff !important; color: #111827 !important;
            border: 1px solid #d1d5db; border-radius: 0.5rem;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
            max-height: 320px; overflow-y: auto; min-width: 320px; max-width: min(520px, 92vw);
        }
        #schedule-zoom-outer { position: relative; min-height: 120px; width: 100%; background: #fff; overflow: visible; }
        #hot-table-zoom-container {
            position: relative;
            transform-origin: top left;
            width: 100%;
            background: #fff;
        }
        #schedule-scroll-area {
            position: relative;
            background: #ffffff !important;
            padding-bottom: 4rem !important;
            overscroll-behavior: contain;
            overflow-x: hidden;
            overflow-y: auto;
        }
        .schedule-lazy-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            width: 100%;
            box-sizing: border-box;
            background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
            border-top: 1px dashed #e5e7eb;
            color: #6b7280;
            font-size: 13px;
            font-weight: 600;
            text-align: center;
            padding: 1rem;
            user-select: none;
        }
        .schedule-lazy-placeholder .schedule-lazy-hint {
            font-size: 11px;
            font-weight: 500;
            color: #9ca3af;
        }
        #schedule-slot-sidebar .schedule-slot-item {
            width: 100%;
            text-align: left;
            border: 1px solid #e5e7eb;
            background: #fff;
            border-radius: 0.6rem;
            padding: 0.45rem 0.5rem 0.45rem 0.65rem;
            cursor: pointer;
            transition: background .15s, border-color .15s, box-shadow .15s;
            display: flex;
            align-items: flex-start;
            gap: 0.35rem;
        }
        #schedule-slot-sidebar .schedule-slot-item:hover {
            border-color: #93c5fd;
            background: #f8fbff;
        }
        #schedule-slot-sidebar .schedule-slot-item.active {
            border-color: #2563eb;
            background: #eff6ff;
            box-shadow: 0 0 0 1px #2563eb inset;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-body {
            flex: 1;
            min-width: 0;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-time {
            font-size: 12px;
            font-weight: 700;
            color: #1f2937;
            line-height: 1.3;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-meta {
            margin-top: 2px;
            font-size: 11px;
            color: #6b7280;
            line-height: 1.35;
            white-space: normal;
            word-break: break-word;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-move {
            display: flex;
            flex-direction: column;
            gap: 2px;
            flex-shrink: 0;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-move button {
            width: 22px;
            height: 18px;
            padding: 0;
            border: 1px solid #d1d5db;
            border-radius: 4px;
            background: #fff;
            color: #4b5563;
            font-size: 10px;
            line-height: 1;
            cursor: pointer;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-move button:hover:not(:disabled) {
            border-color: #60a5fa;
            color: #2563eb;
            background: #eff6ff;
        }
        #schedule-slot-sidebar .schedule-slot-item .slot-move button:disabled {
            opacity: 0.35;
            cursor: default;
        }
        #schedule-slot-sidebar .schedule-slot-item.dragging {
            opacity: 0.55;
        }
        #schedule-slot-sidebar .schedule-slot-item.drag-over {
            border-color: #2563eb;
            box-shadow: 0 0 0 1px #93c5fd inset;
        }
        @media (max-width: 900px) {
            #schedule-slot-sidebar { width: 11rem; }
        }
        /* Stacked timetables should scroll vertically on the page; horizontal scroll stays inside each table. */
        #schedule-view .handsontable .wtHolder {
            overflow-y: hidden !important;
        }
        #schedule-view .handsontable .ht_master .wtHolder {
            overflow-x: auto !important;
            overflow-y: hidden !important;
        }
        #schedule-view .ht_clone_left .wtHolder,
        #schedule-view .ht_clone_inline_start .wtHolder,
        #schedule-view .ht_clone_top .wtHolder,
        #schedule-view .ht_clone_bottom .wtHolder,
        #schedule-view .ht_clone_top_left_corner .wtHolder,
        #schedule-view .ht_clone_top_inline_start_corner .wtHolder,
        #schedule-view .ht_clone_bottom_left_corner .wtHolder,
        #schedule-view .ht_clone_bottom_inline_start_corner .wtHolder {
            overflow: hidden !important;
        }
        #schedule-view .ht_clone_left,
        #schedule-view .ht_clone_inline_start,
        #schedule-view .ht_clone_top_left_corner,
        #schedule-view .ht_clone_top_inline_start_corner,
        #schedule-view .ht_clone_bottom_left_corner,
        #schedule-view .ht_clone_bottom_inline_start_corner {
            background: #ffffff !important;
        }
        .seamless-table-wrapper { background: #ffffff !important; box-shadow: none !important; }
        
        .triangle-btn {
            position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
            cursor: pointer; color: #6b7280; font-size: 10px; padding: 2px 5px;
            border-radius: 4px; background: #f3f4f6; border: 1px solid #d1d5db;
            z-index: 10; user-select: none; transition: all 0.2s;
        }
        .triangle-btn:hover { background-color: #3b82f6; color: white; border-color: #2563eb; }
        .triangle-btn-danger:hover { background-color: #ef4444; color: white; border-color: #dc2626; }
        .triangle-btn-warning:hover { background-color: #eab308; color: white; border-color: #ca8a04; }
        .tuition-refund-tag { font-size: 10px; font-weight: 700; color: #b45309; line-height: 1.2; }
        #schedule-refund-menu {
            position: fixed; z-index: 10080; min-width: 148px; padding: 4px;
            background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
        }
        #schedule-refund-menu button {
            display: block; width: 100%; text-align: left; padding: 8px 10px;
            font-size: 13px; font-weight: 600; color: #1f2937; background: transparent;
            border: 0; border-radius: 6px; cursor: pointer;
        }
        #schedule-refund-menu button:hover { background: #fffbeb; color: #b45309; }
        .schedule-refund-cell { overflow: visible !important; position: relative !important; }
        .schedule-refund-cell .schedule-refund-triangle {
            position: absolute; right: 4px; bottom: 4px; top: auto; transform: none; margin: 0;
        }

        .excel-tab {
            padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
            border-top-left-radius: 8px; border-top-right-radius: 8px;
            border: 1px solid #d1d5db; border-bottom: none;
            background-color: #f3f4f6; color: #4b5563; transition: all 0.2s;
        }
        .excel-tab.active { background-color: #ffffff; color: #2563eb; font-weight: 700; border-top: 3px solid #2563eb; }

        .folder-card { position: relative; border: 1px solid #d1d5db; background: #fff; padding: 1.25rem 0.75rem; text-align: center; border-radius: 0.5rem; transition: all 0.2s; font-weight: 500; color: #374151; min-height: 108px; height: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; cursor: default;}
        .folder-card:hover { border-color: #3b82f6; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); background-color: #f8fafc; }
        .folder-card .triangle-btn-folder { position: absolute; right: 4px; bottom: 4px; cursor: pointer; color: #6b7280; font-size: 12px; padding: 2px 6px; border-radius: 4px; background: #f3f4f6; border: 1px solid #d1d5db; transition: all 0.2s; z-index: 10; }
        .folder-card .triangle-btn-folder:hover { background-color: #10b981; color: white; border-color: #059669; }
        .folder-card-name { cursor: text; outline: none; border-radius: 4px; transition: background-color 0.2s; white-space: normal; overflow: visible; word-break: break-word; line-height: 1.3; max-width: 100%; padding: 0 1.75rem; box-sizing: border-box; }
        .folder-card-name:hover { background-color: #e5e7eb; }
        .folder-card-name:focus { background-color: #ffffff; box-shadow: 0 0 0 2px #3b82f6; }

        [contenteditable="true"]:hover { background-color: #f3f4f6; cursor: text; }
        [contenteditable="true"]:focus { background-color: #ffffff; outline: 2px solid #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

        #receipt-template { position: absolute; left: -9999px; top: 0; width: 1024px; background: white; padding: 14px 22px 22px 20px; font-family: 'PingFang HK', 'Microsoft JhengHei', sans-serif; color: #000; }
        .receipt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
        .receipt-logo { text-align: center; font-size: 24px; font-weight: bold; letter-spacing: 2px; }
        .receipt-logo-en { font-size: 12px; letter-spacing: 1px; color: #555; }
        .receipt-info-box { border: 1px solid #000; padding: 10px; margin-bottom: 15px; font-size: 13px; }
        .receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .receipt-row { display: flex; border-bottom: 1px dotted #ccc; padding-bottom: 2px; }
        .receipt-label { min-width: 70px; display: inline-block; }
        .receipt-value { font-weight: bold; flex-grow: 1; border-bottom: 1px solid #000; text-align: center; }
        .receipt-details { font-size: 13px; line-height: 1.6; }
        .receipt-checkbox { display: inline-block; width: 12px; height: 12px; border: 1px solid #000; margin-right: 4px; vertical-align: middle; }
        .receipt-footer { margin-top: 20px; font-size: 11px; color: #555; line-height: 1.4; border-top: 1px solid #000; padding-top: 10px; }
        #receipt-terms { color: #dc2626 !important; }
        #receipt-template .receipt-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            column-gap: 108px;
            min-height: 112px;
            margin-bottom: 12px;
        }
        #receipt-template .receipt-brand {
            display: flex;
            align-items: stretch;
            gap: 28px;
            flex-shrink: 0;
            height: 96px;
            margin-top: 16px;
        }
        #receipt-template .receipt-brand-text {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            width: 134px;
            line-height: 1;
            padding: 20px 0 6px;
        }
        #receipt-template .receipt-cn {
            display: flex;
            justify-content: space-between;
            font-size: 36px;
            font-weight: 700;
            white-space: nowrap;
        }
        #receipt-template .receipt-en {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            font-size: 14px;
            white-space: nowrap;
        }
        #receipt-template .receipt-right {
            min-width: 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            padding-top: 0;
        }
        #receipt-template .receipt-no-line {
            display: flex;
            justify-content: flex-end;
            align-items: baseline;
            white-space: nowrap;
            line-height: 1;
            margin-bottom: 26px;
            font-size: 14px;
            color: #787878;
        }
        #receipt-template .receipt-contact {
            color: #363636;
            font-size: 13px;
            line-height: 1.2;
            display: flex;
            flex-wrap: nowrap;
            justify-content: space-between;
            align-items: center;
            gap: 10px 14px;
            white-space: nowrap;
        }
        #receipt-template .receipt-contact + .receipt-contact { margin-top: 16px; }
        #receipt-template .receipt-contact i { color: #363636; width: 13px; text-align: center; margin-right: 4px; }

        .handsontableInput { color: #000000 !important; background-color: #ffffff !important; }
        #sidebar-aside {
            transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out, border 0.3s ease-in-out;
            width: max-content;
            max-width: min(40vw, 22rem);
        }
        #sidebar-aside .sidebar-title,
        #sidebar-nav button,
        #custom-sidebar-container > div,
        #custom-sidebar-container span {
            white-space: nowrap;
        }
        #sidebar-nav button { width: 100%; }
        .sidebar-collapsed { width: 0 !important; overflow: hidden !important; opacity: 0; border: none; }
        
        @keyframes excelFlash { 0% { background-color: #fef08a; } 50% { background-color: #ffffff; } 100% { background-color: #fef08a; } }
        .excel-flash-row td { animation: excelFlash 0.5s ease-in-out 3; background-color: #fef08a !important; color: #854d0e !important; }

        #dates-hot-container .htCore td, #special-hot-container .htCore td, #trial-hot-container .htCore td, #short-hot-container .htCore td { background-color: #ffffff !important; color: #333333 !important; }
        #dates-hot-container .htCore th, #special-hot-container .htCore th, #trial-hot-container .htCore th, #short-hot-container .htCore th { background-color: #ffffff !important; color: #374151 !important; font-weight: bold; }
        #trial-hot-container .htCore td.tuition-unpaid,
        #short-hot-container .htCore td.tuition-unpaid,
        #special-hot-container .htCore td.tuition-unpaid,
        #contest-hot-container .htCore td.tuition-unpaid,
        #trial-hot-container td.booking-fee-cell.booking-fee-unpaid,
        #short-hot-container td.booking-fee-cell.booking-fee-unpaid,
        #special-hot-container td.booking-fee-cell.booking-fee-unpaid,
        #contest-hot-container td.booking-fee-cell.booking-fee-unpaid {
            background-color: #fee2e2 !important;
            color: #991b1b !important;
            font-weight: bold;
        }
        #trial-hot-container .htCore td.tuition-paid,
        #short-hot-container .htCore td.tuition-paid,
        #special-hot-container .htCore td.tuition-paid,
        #contest-hot-container .htCore td.tuition-paid,
        #trial-hot-container td.booking-fee-cell.booking-fee-paid,
        #short-hot-container td.booking-fee-cell.booking-fee-paid,
        #special-hot-container td.booking-fee-cell.booking-fee-paid,
        #contest-hot-container td.booking-fee-cell.booking-fee-paid {
            background-color: #dcfce7 !important;
            color: #166534 !important;
            font-weight: bold;
        }
        #trial-hot-container td.booking-fee-cell,
        #short-hot-container td.booking-fee-cell,
        #special-hot-container td.booking-fee-cell,
        #contest-hot-container td.booking-fee-cell {
            overflow: visible !important;
            position: relative !important;
        }
        #contest-hot-container td.contest-header-cell {
            background-color: var(--contest-header-bg, #1e3a5f) !important;
            background: var(--contest-header-bg, #1e3a5f) !important;
            color: var(--contest-header-fg, #ffffff) !important;
            font-weight: 700 !important;
            position: relative !important;
            overflow: visible !important;
            padding-right: 28px !important;
        }
        #contest-hot-container td.contest-header-cell .triangle-btn {
            color: var(--contest-header-fg, #ffffff);
            background: rgba(255,255,255,0.16);
            border-color: rgba(255,255,255,0.45);
        }
        /* 比賽報名：欄寬／表頭列高拖曳把手加大，方便喺深藍表頭拖拉 */
        #contest-hot-container .manualColumnResizer,
        #contest-hot-container .manualColumnResizer:hover,
        #contest-hot-container .manualColumnResizer.active {
            width: 8px !important;
            margin-left: -4px !important;
            background: rgba(59, 130, 246, 0.45) !important;
        }
        #contest-hot-container .manualRowResizer,
        #contest-hot-container .manualRowResizer:hover,
        #contest-hot-container .manualRowResizer.active {
            height: 8px !important;
            margin-top: -4px !important;
            background: rgba(59, 130, 246, 0.45) !important;
        }
        #contest-hot-container td.contest-deadline {
            color: #dc2626 !important;
            font-weight: 700 !important;
        }
        .triangle-btn-br { position: absolute; right: 4px; bottom: 4px; cursor: pointer; color: #6b7280; font-size: 10px; padding: 2px 5px; border-radius: 4px; background: #f3f4f6; border: 1px solid #d1d5db; z-index: 10; user-select: none; transition: all 0.2s; pointer-events: auto; }
        .triangle-btn-br:hover { background-color: #3b82f6; color: white; border-color: #2563eb; }
        .triangle-btn-br.triangle-btn-warning:hover { background-color: #eab308; color: white; border-color: #ca8a04; }
        #student-hot-container .handsontable,
        #student-hot-container .handsontable .htCore,
        #student-hot-container .handsontable td,
        #student-hot-container .handsontable th,
        #student-hot-container .handsontable .htDimmed {
            background-color: #ffffff !important;
            color: #000000 !important;
        }
        @media print {
            body * { visibility: hidden !important; }
            #report-view, #report-view * { visibility: visible !important; }
            #report-view { position: absolute; inset: 0; width: 100%; padding: 0 !important; background: white !important; }
            #monthly-report-filter, #report-view button, #daily-room-report-date, #daily-room-report-tab, #daily-room-report-tab-tutor, .no-print { display: none !important; }
            .shadow-md, .shadow-sm { box-shadow: none !important; }

            /* 點名紙列印：蓋過上面報表規則，避免 Safari 印出空白 */
            body.printing-rollcall-sheet #report-view,
            body.printing-rollcall-sheet #report-view * {
                visibility: hidden !important;
                display: none !important;
            }
            body.printing-rollcall-sheet > *:not(#rollcall-print-root) {
                display: none !important;
                visibility: hidden !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root {
                display: block !important;
                visibility: visible !important;
                position: absolute !important;
                left: 0 !important;
                top: 0 !important;
                width: 100% !important;
                margin: 0 !important;
                padding: 4mm !important;
                background: #fff !important;
                color: #111 !important;
                z-index: 999999 !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root,
            body.printing-rollcall-sheet #rollcall-print-root * {
                visibility: visible !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .overflow-x-auto,
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-pair-row {
                display: grid !important;
                grid-template-columns: 1fr 1fr !important;
                gap: 8mm !important;
                overflow: visible !important;
                width: 100% !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-block {
                display: block !important;
                break-inside: avoid !important;
                page-break-inside: avoid !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-sheet-table {
                display: table !important;
                width: 100% !important;
                border-collapse: collapse !important;
                table-layout: fixed !important;
                font-size: 11px !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-sheet-table tbody { display: table-row-group !important; }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-sheet-table tr { display: table-row !important; }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-sheet-table td {
                display: table-cell !important;
                border: 1px solid #111 !important;
                padding: 3px 5px !important;
                vertical-align: middle !important;
                color: #111 !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-date-cell {
                font-weight: 700 !important;
                text-align: center !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-tutor-cell {
                font-weight: 700 !important;
                text-align: center !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-leave-cell {
                background: #d1d5db !important;
                text-align: center !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-trial-cell {
                background: #ffff00 !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-makeup-cell {
                background: #e0f2fe !important;
            }
            body.printing-rollcall-sheet #rollcall-print-root .rollcall-spacer td {
                border: none !important;
                height: 10px !important;
                background: transparent !important;
            }
        }
        #rollcall-print-root { display: none; }
        body.printing-rollcall-sheet #rollcall-print-root {
            display: block !important;
            position: fixed;
            inset: 0;
            z-index: 999999;
            background: #fff;
            padding: 12px;
            overflow: auto;
        }
        .rollcall-pair-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem;
            margin-bottom: 1.25rem;
            align-items: start;
        }
        .rollcall-color-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
        .rollcall-color-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 12px; color: #374151; }
        .rollcall-color-item input[type="color"] { width: 1.6rem; height: 1.4rem; padding: 0; border: 1px solid #d1d5db; background: #fff; cursor: pointer; }
        .rollcall-sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
        .rollcall-sheet-table td {
            border: 1px solid #111; padding: 5px 8px; vertical-align: middle; background: #fff; color: #111;
        }
        .rollcall-sheet-table td.rollcall-date-cell { font-weight: 700; text-align: center; }
        .rollcall-sheet-table td.rollcall-tutor-cell { font-weight: 700; text-align: center; }
        .rollcall-sheet-table td.rollcall-leave-cell { background: #d1d5db !important; text-align: center; }
        .rollcall-sheet-table td.rollcall-status-cell { text-align: left; font-size: 12px; }
        .rollcall-sheet-table td.rollcall-trial-cell { background: #ffff00 !important; }
        .rollcall-sheet-table td.rollcall-makeup-cell { background: #e0f2fe !important; }
        .rollcall-sheet-table tr.rollcall-spacer td { border: none; height: 14px; background: transparent !important; }
        @media print {
            body.printing-recent-paid * { visibility: hidden !important; }
            body.printing-recent-paid #recent-paid-report,
            body.printing-recent-paid #recent-paid-report * { visibility: visible !important; }
            body.printing-recent-paid #recent-paid-report { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; box-shadow: none; }
            body.printing-recent-paid #recent-paid-report button,
            body.printing-recent-paid .paid-report-filters,
            body.printing-recent-paid .paid-filter-row,
            body.printing-recent-paid .paid-sort-icon { display: none !important; }

            body.printing-monthly-paid * { visibility: hidden !important; }
            body.printing-monthly-paid #monthly-paid-report,
            body.printing-monthly-paid #monthly-paid-report * { visibility: visible !important; }
            body.printing-monthly-paid #monthly-paid-report { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; box-shadow: none; }
            body.printing-monthly-paid #monthly-paid-report button,
            body.printing-monthly-paid .paid-report-filters,
            body.printing-monthly-paid .paid-record-delete,
            body.printing-monthly-paid .paid-record-edit,
            body.printing-monthly-paid .paid-record-refund,
            body.printing-monthly-paid .paid-record-upgrade-temp { display: none !important; }
            .paid-record-delete { display: none !important; }
            [data-report-data-body].hidden { display: block !important; }
            [data-report-collapse-btn],
            [data-report-export-btn] { display: none !important; }
        }
        @media print {
            body.printing-receipt * { visibility: hidden !important; }
            body.printing-receipt #report-view,
            body.printing-receipt #report-view * { visibility: hidden !important; }
            body.printing-receipt #receipt-template,
            body.printing-receipt #receipt-template * { visibility: visible !important; }
            body.printing-receipt #receipt-template {
                position: absolute !important; left: 0 !important; top: 0 !important;
                width: 198mm !important; max-width: 198mm !important;
                height: auto !important; min-height: 0 !important;
                max-height: 136mm !important; padding: 4mm 6mm !important;
                box-sizing: border-box; box-shadow: none !important;
                overflow: hidden !important;
                page-break-inside: avoid !important;
                break-inside: avoid !important;
                page-break-after: avoid !important;
            }
            body.printing-receipt #receipt-terms { color: #dc2626 !important; }
        }

        /* Remove spacing between timetable tables for seamless overlap */
        .seamless-table-wrapper {
            margin-bottom: 0 !important;
            border-bottom: none !important;
            border-radius: 0 !important;
        }
        .seamless-table-wrapper:first-child {
            border-top-left-radius: 0.75rem !important;
            border-top-right-radius: 0.75rem !important;
        }
        .seamless-table-wrapper:last-child {
            border-bottom: 1px solid #d1d5db !important;
            border-bottom-left-radius: 0.75rem !important;
            border-bottom-right-radius: 0.75rem !important;
            margin-bottom: 1.5rem !important;
        }

        /* 報表總覽四卡：避免 grid/flex min-content 撐爆，內容留喺白色卡內 */
        #report-view .report-overview-cards > * {
            min-width: 0;
            overflow: hidden;
        }
        #report-view .report-overview-cards .flex-wrap {
            max-width: 100%;
        }
        #report-view .report-overview-cards #rep-class-counts > span,
        #report-view .report-overview-cards #rep-paid-by-class > span {
            max-width: 100%;
        }

        .staff-report-only #report-view > .grid,
        .staff-report-only #report-view > .bg-white,
        .staff-report-only #monthly-report-section button[onclick="printMonthlyReports()"],
        .staff-report-only #monthly-report-section .report-category-tab,
        .staff-report-only #report-search-input {
            display: none !important;
        }
        .staff-report-only #absence-report-section { display: block !important; }
        /* 導師：只開點名紙，跟時間表導師欄對準 */
        .teacher-rollcall-only #report-view > .grid,
        .teacher-rollcall-only #report-view > #absence-report-section,
        .teacher-rollcall-only #monthly-report-section button[onclick="printMonthlyReports()"],
        .teacher-rollcall-only #monthly-report-section button[onclick="exportMonthlyReports()"],
        .teacher-rollcall-only #monthly-report-section .report-category-tab,
        .teacher-rollcall-only #report-search-input {
            display: none !important;
        }
        .teacher-rollcall-only #daily-room-report-tab-tutor[disabled] {
            opacity: 1;
            background: #eff6ff;
            font-weight: 700;
        }
        .paid-sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
        .paid-sort-th:hover { background: #e5e7eb; }
        .paid-sort-icon { margin-left: 0.25rem; color: #9ca3af; font-size: 0.7rem; }
        .paid-sort-th.is-active .paid-sort-icon { color: #2563eb; }
        .paid-filter-row th { padding: 4px 6px; background: #f9fafb; }
        .paid-filter-row select { width: 100%; min-width: 5.5rem; max-width: 9rem; font-size: 12px; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 2px 4px; background: #fff; }
        #schedule-actions-top { flex-direction: row !important; flex-wrap: wrap !important; }
        #schedule-actions-top > * { white-space: nowrap; }
        #header-tools-wrap { position: relative; z-index: 10060; }
        #header-tools-menu {
            position: fixed; z-index: 10070;
            min-width: 14rem; max-height: min(70vh, 28rem); overflow-y: auto;
            background: #fff; border: 1px solid #d1d5db; border-radius: 0.75rem;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18); padding: 0.4rem; display: none;
        }
        #header-tools-menu.open { display: flex; flex-direction: column; gap: 0.25rem; }
        #header-tools-menu .header-tool-item {
            display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left;
            border: 0; background: transparent; border-radius: 0.5rem; padding: 0.55rem 0.7rem;
            font-size: 0.875rem; font-weight: 700; color: #374151; cursor: pointer;
        }
        #header-tools-menu .header-tool-item:hover { background: #f3f4f6; }
        #header-tools-menu label.header-tool-item { margin: 0; }
        #header-tools-menu .header-tool-item.hidden { display: none !important; }
        .report-category-tab { padding: .45rem .8rem; border-radius: .5rem; font-size: .875rem; font-weight: 700; color: #4b5563; background: #f3f4f6; }
        .report-category-tab:hover, .report-category-tab.active { background: #2563eb; color: #fff; }
        .report-pagination { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding-top: .75rem; font-size: .875rem; }
        .report-pagination button { border: 1px solid #d1d5db; border-radius: .375rem; padding: .25rem .6rem; background: #fff; }
        .report-pagination button:disabled { opacity: .45; cursor: not-allowed; }

        #mobile-sidebar-backdrop { display: none; }
        @media (max-width: 767px) {
            body { height: 100dvh; }
            #sidebar-aside {
                position: fixed !important; inset: 0 auto 0 0; z-index: 9500;
                width: min(82vw, 320px) !important; height: 100dvh;
                transform: translateX(-105%); opacity: 1 !important;
                box-shadow: 8px 0 24px rgba(0, 0, 0, .2);
            }
            #sidebar-aside.sidebar-collapsed { overflow: visible !important; border-right: 1px solid #e5e7eb !important; }
            body.mobile-sidebar-open #sidebar-aside { transform: translateX(0); }
            body.mobile-sidebar-open #mobile-sidebar-backdrop {
                display: block; position: fixed; inset: 0; z-index: 9400;
                background: rgba(15, 23, 42, .45);
            }
            #app-header { padding: .45rem .6rem !important; }
            #header-main-row { flex-wrap: wrap; }
            #header-title-block { width: 100%; }
            #header-toolbar-scroll { width: 100%; }
            #page-title { max-width: 70vw !important; }
            #app-header #bottom-actions-container { gap: .5rem !important; overflow-x: auto; justify-content: flex-start; }
            #student-view, #course-view, #trial-view, #short-view, #special-table-view, #dates-table-view, #report-view { padding: .75rem !important; }
            #schedule-view > div { padding: .75rem !important; }
            #student-view .bg-gray-100, #course-view .bg-gray-100, #trial-view .bg-gray-100, #short-view .bg-gray-100, #special-table-view .bg-gray-100 { padding: .65rem !important; }
            #student-view .bg-gray-100 > div, #course-view .bg-gray-100 > div, #trial-view .bg-gray-100 > div, #short-view .bg-gray-100 > div, #special-table-view .bg-gray-100 > div { flex-wrap: wrap; gap: .5rem; }
            #student-view button, #course-view button, #trial-view button, #short-view button, #special-table-view button, #dates-table-view button { min-height: 38px; }
            .handsontable td, .handsontable th { font-size: 14px !important; }
            .handsontable .htCore td { min-height: 38px; }
            .handsontable .wtHolder { -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
            .triangle-btn-br { min-width: 28px; min-height: 28px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
            [id$="-modal"] { padding: .75rem !important; }
            [id$="-modal"] > div { width: 100% !important; max-width: none !important; max-height: calc(100dvh - 1.5rem) !important; border-radius: .75rem !important; }
            #receipt-template { min-width: 0 !important; }
        }

    