/* 管理端新版第三輪第 2 頁起（2026-11-14）：style-kd2-admin2.css 到 752 行（上限 800），之後接這支。規則同前：限定 body.kd2-adm、只換畫面。 */

/* ===================== 學生系統 → 報名名單（第三輪第 2 頁，只改 CSS）=====================
   畫面全在 students/enroll-apply.js（行內樣式）。托育月報（dc-report）10-20 已照新版重做過，這輪看過不動。 */
body.kd2-adm #page-enroll-list button { box-shadow: none !important; background-image: none !important; white-space: nowrap; }
body.kd2-adm #page-enroll-list button::after { display: none !important; }
/* 報名連結、滿額狀態、每張報名卡：白卡淡陰影、22 圓角、拿掉框（被標「拒收／黑名單／需注意」的卡留淡紅框） */
body.kd2-adm #ea-body > div[style*="border:1.5px solid var(--separator)"], body.kd2-adm #ea-rows > div[style*="border:1.5px solid"] {
  border: 0 !important; border-radius: 22px !important; background: var(--kd-surface) !important; box-shadow: var(--kd-shadow-1);
}
body.kd2-adm #ea-rows > div[style*="rgba(220,38,38,0.45)"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--kd-danger) 45%, transparent), var(--kd-shadow-1); }
/* 七格數字：原本每格淡米色、電腦上只佔左邊一截 → 併成一張白卡、一排平分、格子間細線 */
body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 0 !important; padding: 12px 4px; border-radius: 22px; background: var(--kd-surface); box-shadow: var(--kd-shadow-1);
}
body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] > div { background: transparent !important; border-radius: 0 !important; padding: 4px 2px !important; min-width: 0; }
body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] > div + div { border-left: 1px solid var(--kd-line); }
body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] > div > div:first-child { font-variant-numeric: tabular-nums; }
body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] > div > div:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 篩選：下拉、搜尋白底膠囊 */
body.kd2-adm #ea-body :is(#ea-f-unit, #ea-f-grade, #ea-f-status, #ea-f-q) { height: 38px; padding: 0 14px !important; border: 1.5px solid var(--kd-line) !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-surface) !important; }
body.kd2-adm #ea-link { border: 0 !important; border-radius: var(--kd-r-pill) !important; background: color-mix(in srgb, var(--kd-ink) 5%, transparent) !important; padding: 9px 14px !important; }
/* 按鈕：膠囊；＋手動新增、轉準新生＝淡橘（原本橘漸層）、複製實心主色、刪除淡紅、其他淡灰 */
body.kd2-adm #ea-body :is(button, a[href*="preview=1"]) {
  min-height: 34px; padding: 0 14px !important; border: 0 !important; border-radius: var(--kd-r-pill) !important;
  background: color-mix(in srgb, var(--kd-ink) 6%, transparent) !important; color: var(--kd-ink) !important; display: inline-flex; align-items: center; font-weight: 600;
}
body.kd2-adm #ea-body button:is([onclick^="eaEdit(0)"], [onclick^="eaToPrepaid"]) { background: var(--kd-primary-soft) !important; color: var(--kd-primary-text) !important; font-weight: 700; }
body.kd2-adm #ea-body button[onclick^="eaCopyLink"] { background: var(--kd-primary) !important; color: #fff !important; font-weight: 700; }
body.kd2-adm #ea-body button[onclick^="eaDelete"] { background: var(--kd-danger-soft) !important; color: var(--kd-danger) !important; }
body.kd2-adm #ea-rows select[onchange^="eaSetStatus"] { min-height: 34px; padding: 0 12px !important; border-radius: var(--kd-r-pill) !important; }
/* 卡片上的小標（年段、自動、狀態、特殊身分、已預收）：圓角 8 → 膠囊 */
body.kd2-adm #ea-rows span[style*="border-radius:8px"] { border-radius: var(--kd-r-pill) !important; }
body.kd2-adm #ea-rows div[style*="background:var(--bg)"][style*="border-radius:8px"], body.kd2-adm #ea-rows div[style*="rgba(220,38,38,0.08)"] { border-radius: 12px !important; }
/* 手動新增／編輯視窗：日期選擇器外框沒有下邊距（原本 input 有 margin-bottom，被 .kdp 包起來藏掉），「這是預產期」那行的 margin-top:-4px 就疊到日期框上 */
#ea-modal .kdp { margin-bottom: 10px; }
body.kd2-adm #ea-modal > div { border-radius: 22px !important; }
/* 手機：七格數字一排塞不下（字會擠成「已保…」）→ 四格一排、第二排三格，格子間細線照舊 */
@media (max-width: 600px) {
  body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; row-gap: 8px !important; }
  body.kd2-adm #ea-body > div[style*="grid-template-columns:repeat(auto-fill"] > div:nth-child(5) { border-left: 0; }
}

/* ===================== 排班／導護表／出勤看板（第三輪第 3 頁，只改 CSS）=====================
   三個都是浮層（admin/staff-shift.js、guard-duty.js、staff-attendance.js），10 月已用 kd-btn／kd-tag 新 token 做過；
   班導那版（kd2-shift／kd2-guard）是「我的一週」個人檢視，管理員要排全園的表，不走它。出勤看板已經是新版，不動。
   剩下的舊痕跡：ui-polish 給 kd-btn 加的漸層光澤；排班畫筆選中是橘色漸層（別頁選中都是深色）；手機排班表老師名字被切（「王大象老」）。 */
body.kd2-adm :is(#staff-shift-overlay, #guard-duty-overlay) .kd-btn { box-shadow: none !important; background-image: none !important; border-radius: var(--kd-r-pill) !important; }
body.kd2-adm :is(#staff-shift-overlay, #guard-duty-overlay) .kd-btn::after { display: none !important; }
/* 排班：畫筆（班別）選中 → 深色底，裡面的班別小標照舊有顏色 */
body.kd2-adm #staff-shift-overlay [data-brush].kd-btn--primary { background: var(--kd-ink) !important; border-color: var(--kd-ink) !important; color: #fff !important; }
body.kd2-adm #staff-shift-overlay [data-brush] { border-radius: 14px !important; }
@media (max-width: 600px) {
  /* 手機排班表：老師欄 58px 塞不下「王大象老師」→ 72px、名字字小一號 */
  body.kd2-adm #staff-shift-overlay #ss-scroll th:first-child { width: 72px !important; }
  body.kd2-adm #staff-shift-overlay #ss-scroll td:first-child { font-size: 0.75rem !important; padding: 1px 4px !important; }
}
/* 導護表：排表／工作設定的底部「取消／儲存」釘在底，但浮層有下內距，捲動時後面的欄位（就定位置）會從按鈕底下露出來
   → 按鈕列往下補一條同底色的「影子」蓋住那段內距（sticky 釘不進內距裡，只能用畫的蓋）；所有人都受惠，不限管理員 */
#guard-duty-overlay div[style*="position:sticky;bottom:0"] { box-shadow: 0 var(--kd-sp-4) 0 var(--kd-surface); z-index: 2; }
body.kd2-adm #guard-duty-overlay .gdt-table { border-radius: 16px; }

/* ===================== 才藝其餘：老師薪資／國定假日／停課／停課申請／調課申請（第三輪第 4 頁，只改 CSS）=====================
   畫面在 arts/teacher-payroll*.js、billing/billing-config.js（假日）、arts/course-cancel-admin.js（停課）、arts/course-requests.js（停課／調課申請）。
   薪資金額、停課判斷都不動（老師薪資只換按鈕顏色）。補課設定（makeup-settings）整組隱藏中，不動。 */
body.kd2-adm :is(#page-teacher-payroll, #page-billing-config, #page-leave-manage, #page-course-stop-list, #page-course-change-list) button { box-shadow: none !important; background-image: none !important; white-space: nowrap; }
body.kd2-adm :is(#page-teacher-payroll, #page-billing-config, #page-leave-manage, #page-course-stop-list, #page-course-change-list) button::after { display: none !important; }
body.kd2-adm :is(#page-teacher-payroll, #page-billing-config, #page-leave-manage, #page-course-stop-list, #page-course-change-list) .kd-btn { border-radius: var(--kd-r-pill) !important; }
body.kd2-adm :is(#page-course-stop-list, #page-course-change-list) .card { border-radius: 22px !important; border: 0 !important; box-shadow: var(--kd-shadow-1); }
/* 老師薪資：單月／全年切換選中深色（原本橘），手機上加了年份選單時兩顆被擠成直的 → 不斷行、右邊那組可換行 */
body.kd2-adm :is(#payroll-tab-month, #payroll-tab-year) { white-space: nowrap; min-height: 32px; }
body.kd2-adm :is(#payroll-tab-month, #payroll-tab-year):is([style*="background: var(--accent)"], [style*="background:var(--accent)"]) { background: var(--kd-ink) !important; color: #fff !important; }
body.kd2-adm #page-teacher-payroll > .section-header > div { flex-wrap: wrap; justify-content: flex-end; }
body.kd2-adm #page-teacher-payroll > .section-header > div > div:first-child { flex: none; }
/* 國定假日：新增那排（日期｜名稱｜新增）手機把「新增」推出畫面、電腦把「新增」拉成一大條（全站 .btn 是 width:100%）→ 日期、名稱分、新增照字寬淡橘膠囊（手機放不下就換到下一排） */
body.kd2-adm #page-billing-config > div > div:nth-child(2) { flex-wrap: wrap; align-items: center; }
body.kd2-adm #page-billing-config > div > div:nth-child(2) > .kdp { flex: 1 1 150px; width: auto !important; min-width: 140px; }
body.kd2-adm #page-billing-config #holiday-name { flex: 1 1 120px !important; min-width: 0; height: 38px; padding: 0 14px !important; border: 1.5px solid var(--kd-line) !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-surface); }
body.kd2-adm #page-billing-config .kdp-trigger { height: 38px; border: 1.5px solid var(--kd-line); border-radius: var(--kd-r-pill); background: var(--kd-surface); }
body.kd2-adm #page-billing-config button[onclick^="addHoliday"] { flex: none !important; width: auto !important; margin: 0 !important; min-height: 38px; padding: 0 18px !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-primary-soft) !important; color: var(--kd-primary-text) !important; font-weight: 700; }
body.kd2-adm #page-billing-config #holiday-year { border-radius: var(--kd-r-pill) !important; }
/* 假日清單：一張白卡、列跟列細線 */
body.kd2-adm #holiday-list:has(> div) { padding: 4px 16px; border-radius: 22px; background: var(--kd-surface); box-shadow: var(--kd-shadow-1); }
body.kd2-adm #holiday-list > div[style*="border-bottom"] { padding: 10px 0 !important; border-bottom-color: var(--kd-line) !important; }
body.kd2-adm #holiday-list > div[style*="border-bottom"]:last-child { border-bottom: 0 !important; }
/* 停課申請／調課申請：同意實心綠 → 淡綠、駁回紅框 → 淡紅、還原／取消排程淡灰，全膠囊 */
body.kd2-adm :is(#course-stop-list, #course-change-list) button { min-height: 34px; padding: 0 14px !important; border: 0 !important; border-radius: var(--kd-r-pill) !important; font-weight: 700 !important; }
body.kd2-adm :is(#course-stop-list, #course-change-list) button:is([onclick*="'approved')"]) { background: var(--kd-success-soft) !important; color: var(--kd-success) !important; }
body.kd2-adm :is(#course-stop-list, #course-change-list) button:is([onclick*="'rejected')"]) { background: var(--kd-danger-soft) !important; color: var(--kd-danger) !important; }
body.kd2-adm :is(#course-stop-list, #course-change-list) button:is([onclick^="revertCourseStopReq"], [onclick^="cancelCourseStopSchedule"]) { background: color-mix(in srgb, var(--kd-ink) 6%, transparent) !important; color: var(--kd-ink) !important; }
body.kd2-adm :is(#course-stop-list, #course-change-list) .card span[style*="border-radius:8px"] { border-radius: var(--kd-r-pill) !important; }
body.kd2-adm #course-stop-add-btn { min-height: 34px; padding: 0 16px !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-primary-soft) !important; color: var(--kd-primary-text) !important; }
/* 電腦：這三頁內容一欄拉滿一千多 px，按鈕被拉成一長條 → 限寬置中（老師薪資本來就限寬） */
@media (min-width: 1024px) {
  body.kd2-adm :is(#page-billing-config, #page-course-stop-list, #page-course-change-list) { max-width: 820px; margin-inline: auto; }
}

/* ===================== 請假其餘：請假申請／校園公告／稽核／個人紀錄／颱風假／不開放日／特休獎金（第三輪第 5 頁，禁區只改 CSS）=====================
   批示、紀錄查詢第 4 批已換。請假申請：班導走 kd2-leave.js 新版（body.kd2-ct），管理員自己請假還是舊表單 → 只換外觀，假別判斷、額度、送出都不動。
   特休額度（leave-annual-guard.js）完全沒碰；上線前照 docs/scenarios/特休請假固定情境.md 在家裡電腦用正式副本跑。 */
body.kd2-adm :is(#page-tl-apply, #page-tl-announce, #page-leave-audit, #page-tl-person, #page-tl-closures, #page-tl-blocked, #page-tl-bonus) button { box-shadow: none !important; background-image: none !important; }
body.kd2-adm :is(#page-tl-apply, #page-tl-announce, #page-leave-audit, #page-tl-person, #page-tl-closures, #page-tl-blocked, #page-tl-bonus) button::after { display: none !important; }
body.kd2-adm :is(#page-tl-apply, #page-tl-announce, #page-leave-audit, #page-tl-person, #page-tl-closures, #page-tl-blocked, #page-tl-bonus) .card { border: 0 !important; border-radius: 22px !important; box-shadow: var(--kd-shadow-1); }
/* 主要動作（送出假單、發布公告、新增停課日、試算）：實心主色膠囊（原本橘漸層） */
body.kd2-adm :is(#page-tl-apply, #page-tl-announce, #page-tl-closures, #page-tl-bonus) button:is([onclick^="submitTeacherLeave"], [onclick^="submitStaffAnnouncement"], [onclick^="submitSchoolClosure"], [onclick^="loadLeaveBonus"]) {
  min-height: 40px; border: 0 !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-primary) !important; color: #fff !important; font-weight: 700;
}
/* 次要（匯出特休明細、複製整月表格、清除公告表單）：淡灰膠囊 */
body.kd2-adm :is(#page-tl-announce, #page-leave-audit, #page-tl-bonus) button:is([onclick^="exportLeaveDetailJPG"], [onclick^="laCopyTable"], [onclick^="resetStaffAnnouncementForm"]) {
  min-height: 34px; border: 0 !important; border-radius: var(--kd-r-pill) !important; background: color-mix(in srgb, var(--kd-ink) 6%, transparent) !important; color: var(--kd-ink) !important; font-weight: 600;
}
/* 請假申請：假別、時數選中深色（原本橘漸層／橘底），沒選白底細框 */
body.kd2-adm #page-tl-apply :is(.tl-type-btn, .tl-hr-btn, .tl-hr-sub-btn) { border: 1.5px solid var(--kd-line) !important; border-radius: 14px !important; background: var(--kd-surface) !important; color: var(--kd-ink) !important; }
body.kd2-adm #page-tl-apply :is(.tl-type-btn, .tl-hr-btn, .tl-hr-sub-btn).active { background: var(--kd-ink) !important; border-color: var(--kd-ink) !important; color: #fff !important; }
body.kd2-adm #page-tl-apply .tl-type-btn:disabled { opacity: .55; }
body.kd2-adm #page-tl-apply #tl-calendar-container { border: 0 !important; border-radius: 16px !important; background: color-mix(in srgb, var(--kd-ink) 3%, var(--kd-surface)) !important; }
/* 特休獎金頁首：手機上標題＋年份＋試算＋匯出擠一排，「試算」被擠成直的、「匯出特休明細」斷兩行 → 不斷行、按鈕那組可換到下一排 */
body.kd2-adm #page-tl-bonus > .section-header { flex-wrap: wrap; gap: 8px; }
body.kd2-adm #page-tl-bonus > .section-header > .section-title { flex: 1 1 auto; }
body.kd2-adm #page-tl-bonus > .section-header > div { flex-wrap: wrap; margin-left: auto; }
body.kd2-adm #page-tl-bonus > .section-header button { white-space: nowrap; }
body.kd2-adm #tl-bonus-year { border-radius: var(--kd-r-pill) !important; min-height: 36px; }
/* 電腦：表單、月曆一欄拉滿一千多 px（月曆格子扁長、送出鈕一長條）→ 限寬置中；稽核、特休獎金是表格，照舊拉滿 */
@media (min-width: 1024px) {
  body.kd2-adm :is(#page-tl-apply, #page-tl-announce, #page-tl-person, #page-tl-closures, #page-tl-blocked) { max-width: 760px; margin-inline: auto; }
}

/* ===================== 收費其餘：才藝堂數／學期繳／新生／設定／會計（第三輪第 6 頁，禁區只改 CSS）=====================
   畫面在 billing/talent-batch.js、prepaid-semester.js、prepaid-newcomer.js、fee-settings.js、accounting-*.js。總表、過期未收第 4 批已換。
   費袋、金額、收費判斷一律不動；這段只換按鈕、卡片，並修新生表單在手機上擠壞。 */
body.kd2-adm :is(#page-talent-batch-billing, #page-semester-prepay, #page-prepaid-records, #page-fee-settings, #page-accounting) button { box-shadow: none !important; background-image: none !important; }
body.kd2-adm :is(#page-talent-batch-billing, #page-semester-prepay, #page-prepaid-records, #page-fee-settings, #page-accounting) button::after { display: none !important; }
body.kd2-adm :is(#page-talent-batch-billing, #page-semester-prepay, #page-prepaid-records, #page-fee-settings, #page-accounting) .card:not([style*="dashed"]) { border: 0 !important; border-radius: 22px !important; box-shadow: var(--kd-shadow-1); }
/* 主要動作（確認登記、新增預繳、新增費率、查詢）：實心主色膠囊（原本橘漸層拉成一長條） */
body.kd2-adm :is(#page-semester-prepay, #page-prepaid-records, #page-fee-settings, #page-accounting) button:is([onclick^="submitSemesterPrepay"], [onclick^="submitPrepaidRecord"], [onclick^="addTuitionRate"], [onclick^="fetchAccountingReport"]) {
  min-height: 40px; border: 0 !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-primary) !important; color: #fff !important; font-weight: 700;
}
/* 會計：羊奶費／補助款／每月成本的「＋新增／修改」淡色膠囊、會計健檢淡灰 */
body.kd2-adm #page-accounting button:is([onclick^="showMilkFeeForm"], [onclick^="showGovSubsidyForm"], [onclick^="showMonthlyCostForm"]) { min-height: 34px; padding: 0 14px !important; border: 0 !important; border-radius: var(--kd-r-pill) !important; background: var(--kd-primary-soft) !important; color: var(--kd-primary-text) !important; font-weight: 700; }
body.kd2-adm #page-accounting button[onclick^="openAccountingHealth"], body.kd2-adm #page-talent-batch-billing button[onclick^="scanOrphanPayments"] { min-height: 34px; border: 0 !important; border-radius: var(--kd-r-pill) !important; background: color-mix(in srgb, var(--kd-ink) 6%, transparent) !important; color: var(--kd-ink) !important; }
/* 才藝堂數：篩選膠囊選中深色 */
body.kd2-adm #page-talent-batch-billing .tb-filter-btn { border-radius: var(--kd-r-pill) !important; min-height: 32px; }
body.kd2-adm #page-talent-batch-billing .tb-filter-btn.active { background: var(--kd-ink) !important; border-color: var(--kd-ink) !important; color: #fff !important; }
/* 新生：新增預繳表單拿掉左邊色條；手機上「姓名｜金額」「生日｜年段」兩欄 1fr 1fr，輸入框有天生最小寬，
   把右邊擠到剩一點點——「請先輸入生日」變成一字一行、生日框被撐成一大塊 → 兩欄改 minmax(0,1fr)、輸入框可縮 */
body.kd2-adm #prepaid-content > .card[style*="border-left:4px"] { border-left: 0 !important; }
body.kd2-adm #prepaid-content .card div[style*="grid-template-columns:1fr 1fr;"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
body.kd2-adm #prepaid-content .card div[style*="grid-template-columns:1fr 1fr 1fr;"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body.kd2-adm #prepaid-content .card :is(input, select, #pp-class-badge) { min-width: 0; width: 100%; box-sizing: border-box; }
body.kd2-adm #prepaid-content #pp-class-badge { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 電腦：學期繳、新生是表單，一欄拉滿一千多 px → 限寬置中（設定、會計、才藝堂數是報表，照舊） */
@media (min-width: 1024px) {
  body.kd2-adm :is(#page-semester-prepay, #page-prepaid-records) { max-width: 820px; margin-inline: auto; }
  /* 查詢（會計）、新增費率（設定）：全站 .btn width:100% 拉成一長條 → 照字寬 */
  body.kd2-adm :is(#page-accounting button[onclick^="fetchAccountingReport"], #page-fee-settings button[onclick^="addTuitionRate"]) { width: auto !important; padding: 0 28px !important; }
}
/* 設定：「未設定」那張費率卡是紅色虛線框（提醒還有孩子沒身份），上面拿框的規則不碰它，只把圓角對齊 */
body.kd2-adm #page-fee-settings .card[style*="dashed"] { border-radius: 22px !important; }
