:root {
  --ink: #162622;
  --muted: #66736f;
  --green-950: #0b2422;
  --green-900: #102f2c;
  --green-700: #1d5b53;
  --green-500: #3d8c7f;
  --mint: #d8ebe5;
  --cream: #f5f2e9;
  --paper: #fffdf8;
  --line: #dce3df;
  --gold: #d7ad66;
  --shadow: 0 24px 70px rgba(16, 47, 44, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body { margin: 0; color: var(--ink); font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.login-layout { min-height: 100svh; display: grid; grid-template-columns: minmax(360px, 46%) 1fr; }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 72px); color: #f4f4ed; background: var(--green-900); }
.brand-panel::before { content: ""; position: absolute; width: 440px; height: 440px; right: -220px; top: 15%; border: 1px solid rgba(216, 235, 229, .18); border-radius: 50%; box-shadow: 0 0 0 80px rgba(216, 235, 229, .035), 0 0 0 160px rgba(216, 235, 229, .025); }
.brand-panel::after { content: ""; position: absolute; width: 1px; height: 34%; left: clamp(32px, 5vw, 72px); bottom: 13%; background: linear-gradient(transparent, var(--gold)); opacity: .7; }
.brand-lockup, .mobile-brand, .dashboard-brand { display: flex; align-items: center; gap: 14px; font-weight: 700; letter-spacing: .12em; }
.brand-mark { display: block; width: 50px; height: 50px; border: 0; object-fit: contain; flex: 0 0 auto; }
.brand-lockup .brand-mark, .mobile-brand .brand-mark { width: 60px; height: 60px; }
.brand-lockup > span, .mobile-brand > span { font-size: 32px; }
.brand-copy { position: relative; z-index: 1; max-width: 520px; padding-left: 26px; }
.eyebrow { margin: 0 0 18px; font-size: 11px; font-weight: 800; letter-spacing: .24em; }
.eyebrow.accent { color: var(--green-700); }
.brand-copy h1 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(42px, 5.2vw, 72px); font-weight: 600; line-height: 1.25; letter-spacing: .04em; }
.brand-copy > p:last-child { max-width: 430px; margin: 26px 0 0; color: #bfcfca; font-size: 15px; line-height: 1.9; }
.brand-footer { margin: 0; color: #8da39d; font-size: 11px; letter-spacing: .17em; text-transform: uppercase; }

.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 28px 24px; background: var(--cream); }
.login-card { width: min(440px, 100%); padding: clamp(34px, 5vw, 56px); background: var(--paper); border: 1px solid rgba(16,47,44,.08); box-shadow: var(--shadow); }
.mobile-brand { display: none; }
.login-card h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 34px; font-weight: 600; letter-spacing: .06em; }
.login-intro { margin: 12px 0 34px; color: var(--muted); font-size: 14px; }
label { display: block; margin: 20px 0 9px; color: #42514d; font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 52px; padding: 0 72px 0 48px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; border-radius: 2px; outline: none; transition: border-color .2s, box-shadow .2s; }
.input-wrap input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61,140,127,.13); }
.input-icon { position: absolute; z-index: 1; left: 15px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 22px; height: 22px; color: var(--green-700); background: var(--mint); border-radius: 50%; font-size: 10px; font-weight: 800; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 7px 9px; color: var(--green-700); background: transparent; border: 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.primary-button { width: 100%; height: 54px; margin-top: 30px; color: #fff; background: var(--green-900); border: 0; cursor: pointer; font-weight: 700; letter-spacing: .12em; box-shadow: 0 10px 24px rgba(16,47,44,.16); transition: transform .2s, background .2s; }
.primary-button:hover { background: var(--green-700); transform: translateY(-1px); }
.primary-button:focus-visible, .logout-link:focus-visible { outline: 3px solid rgba(61,140,127,.32); outline-offset: 3px; }
.test-note { margin: 17px 0 0; color: #7c827f; text-align: center; font-size: 12px; }
.test-note span { margin-right: 4px; color: var(--gold); font-size: 8px; }
.secure-note { margin: 17px 0 0; color: #60716c; text-align: center; font-size: 12px; }
.secure-note span { margin-right: 4px; color: #3d8c7f; font-size: 8px; }
.login-error { margin: 20px 0 0; padding: 12px 14px; color: #8b1e1e; background: #fff0ed; border-left: 3px solid #c43d32; font-size: 13px; line-height: 1.55; }
.copyright { margin: 30px 0 0; color: #8b938f; font-size: 11px; }

.dashboard-page { min-height: 100svh; background: #f1f4f1; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 12px clamp(22px, 5vw, 72px); color: #fff; background: var(--green-900); box-shadow: 0 8px 26px rgba(16,47,44,.14); }
.dashboard-brand { color: inherit; text-decoration: none; letter-spacing: .08em; }
.brand-lockup > span, .mobile-brand > span, .dashboard-brand > span > strong { font-family: DFKai-SB, BiauKai, "標楷體", serif; }
.dashboard-brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.dashboard-brand small { color: #abc0bb; font-size: 10px; font-weight: 500; letter-spacing: .14em; }
.header-breadcrumb { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; margin-left: clamp(24px, 4vw, 64px); color: #abc0bb; font-size: 13px; white-space: nowrap; }
.header-breadcrumb a, .header-breadcrumb strong { max-width: 220px; overflow: hidden; color: inherit; font-weight: 500; text-decoration: none; text-overflow: ellipsis; }
.header-breadcrumb a:hover { color: #fff; }
.header-breadcrumb strong { color: #fff; font-weight: 700; }
.header-breadcrumb > span { color: #6f9189; font-size: 17px; }
.brand-mark.small { width: 50px; height: 50px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.mobile-topbar-greeting { display: none; }
.status-pill { padding: 7px 11px; color: #c9ddd7; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; font-size: 11px; }
.status-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: #72c7a9; border-radius: 50%; box-shadow: 0 0 0 3px rgba(114,199,169,.12); }
.logout-form { margin: 0; }
.logout-link { padding: 0; color: #f0f3f1; background: transparent; border: 0; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 700; }
.dashboard-main { width: min(1320px, calc(100% - 44px)); margin: 0 auto; padding: clamp(40px, 6vw, 78px) 0 64px; }
.staff-main { min-height: calc(100svh - 130px); }
.staff-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: clamp(30px, 5vw, 54px); color: #f4f4ed; background: linear-gradient(125deg, var(--green-900), var(--green-700)); box-shadow: var(--shadow); }
.staff-hero .eyebrow { color: #b9d8d0; }
.staff-hero h1 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(34px, 5vw, 54px); font-weight: 600; letter-spacing: .05em; }
.staff-hero > div:first-child > p:last-child { margin: 14px 0 0; color: #d1e2dd; }
.staff-date-card { min-width: 220px; padding: 18px 22px; color: var(--ink); background: rgba(255,255,255,.92); border-left: 3px solid var(--gold); text-align: right; }
.staff-date-card span, .staff-date-card strong { display: block; }.staff-date-card span { color: var(--muted); font-size: 11px; letter-spacing: .1em; }.staff-date-card strong { margin-top: 5px; font-size: 14px; }
.staff-profile { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.staff-profile article { padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); }
.staff-profile span, .staff-profile strong { display: block; }.staff-profile span { color: var(--muted); font-size: 12px; }.staff-profile strong { margin-top: 8px; color: var(--green-900); font-size: 18px; }
.staff-announcement { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 24px; margin-top: 24px; padding: 24px 28px; background: #e7efeb; border-left: 3px solid var(--green-700); }
.staff-announcement .eyebrow { margin-bottom: 6px; }.staff-announcement h2 { margin: 0; font-size: 19px; }.staff-announcement small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }.staff-announcement-content { max-width: 620px; }.staff-announcement-content p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }.staff-announcement-content .table-link { display: inline-block; margin-top: 10px; }
.staff-announcement-list { min-width: 0; max-height: 170px; margin: 0; padding: 0; overflow-y: scroll; scrollbar-gutter: stable; list-style: none; }
.staff-announcement-list li + li { border-top: 1px solid rgba(16,47,44,.12); }
.staff-announcement-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; width: 100%; padding: 8px 12px 8px 2px; color: var(--ink); background: transparent; border: 0; text-align: left; cursor: pointer; }
.staff-announcement-item-title { overflow: hidden; font-weight: 700; text-overflow: clip; white-space: nowrap; }
.staff-announcement-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.staff-announcement-empty { margin: 4px 0 0; color: var(--muted); }
.mobile-announcement-heading { display: none; }
.mobile-announcement-toggle { display: none; }
.staff-announcement-item.is-unread .staff-announcement-item-title { animation: announcement-unread-blink 1s step-end infinite; }
@keyframes announcement-unread-blink { 50% { opacity: .18; } }
.staff-announcement-dialog { box-sizing: border-box; width: min(680px, calc(100% - 28px)); max-height: calc(100svh - 28px); padding: 28px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.staff-announcement-dialog::backdrop { background: rgba(5,24,22,.58); }
.staff-quick-buttons { display: none; align-items: center; gap: 8px; }
.staff-quick-buttons button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: #fff; background: var(--green-700); border: 0; border-radius: 12px; box-shadow: 0 3px 10px rgba(16,47,44,.16); cursor: pointer; font: inherit; font-weight: 800; }
.staff-quick-buttons button:first-child { color: var(--green-900); background: #dfe9e5; }
.staff-duty-dialog { box-sizing: border-box; width: min(760px, calc(100% - 16px)); max-height: calc(100svh - 16px); padding: 20px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); overflow-y: auto; }
.staff-duty-dialog::backdrop { background: rgba(5,24,22,.58); }
.staff-duty-dialog-close { position: absolute; top: 8px; right: 10px; z-index: 5; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--muted); background: var(--paper); border: 0; border-radius: 50%; cursor: pointer; font-size: 28px; line-height: 1; }
.staff-duty-calendar-heading { position: relative; margin-bottom: 12px; text-align: center; }
.staff-duty-month-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.staff-duty-calendar-heading h2 { margin: 0; font-family: "Noto Serif TC","PMingLiU",serif; font-size: 30px; }
.staff-duty-calendar-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.staff-duty-month-nav { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green-700); background: #eef3f0; border: 1px solid var(--line); text-decoration: none; font-size: 24px; font-weight: 800; }
.staff-duty-calendar-heading > span { position: absolute; top: -10px; left: 50px; padding: 3px 7px; color: var(--green-700); background: #e3efeb; border-radius: 999px; font-size: 10px; font-weight: 800; }
.staff-duty-weekdays,.staff-duty-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.staff-duty-weekdays { background: #eef3f0; border: 1px solid var(--line); border-bottom: 0; }
.staff-duty-weekdays strong { padding: 9px 2px; color: var(--muted); border-right: 1px solid var(--line); text-align: center; font-size: 11px; }
.staff-duty-weekdays strong:last-child { border-right: 0; }
.staff-duty-calendar { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.staff-duty-dialog.is-month-loading .staff-duty-month-nav { pointer-events: none; opacity: .45; }
.staff-duty-blank,.staff-duty-day { min-width: 0; min-height: 96px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.staff-duty-blank { background: #f5f7f5; }
.staff-duty-day { position: relative; background: var(--paper); }
.staff-duty-day.is-mine { background:#e0f2eb; box-shadow:inset 0 0 0 2px #74aa9c; }
.staff-duty-day.is-mine > strong { color:#0d5d53; }
.staff-duty-day > strong { font-family: Georgia,serif; font-size: 18px; }
.staff-duty-day.is-weekend > strong,.staff-duty-day.is-holiday > strong { color: #c64337; }
.staff-duty-holiday-name { display: block; margin-top: 2px; color: #c64337; font-size: 8px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.staff-duty-day > div { display: grid; gap: 3px; margin-top: 8px; }
.staff-duty-day > div span { padding: 3px 5px; overflow: hidden; color: #fff; background: var(--green-700); border-radius: 999px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 800; }
.staff-announcement-dialog-close { position: absolute; top: 10px; right: 12px; margin: 0; }
.staff-announcement-dialog-close button { width: 34px; height: 34px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 27px; }
.announcement-detail h2, .staff-all-announcements-dialog > h2 { margin: 0 44px 20px 0; font-family: "Noto Serif TC","PMingLiU",serif; font-size: 26px; }
.announcement-detail dl { display: flex; gap: 22px; margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.announcement-detail dl div { display: flex; gap: 7px; }.announcement-detail dt { font-weight: 800; }.announcement-detail dd { margin: 0; }
.announcement-detail-content { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.8; overflow-wrap: anywhere; }
.announcement-content-link { display: inline-flex; align-items: center; max-width: 100%; margin: 3px 2px; padding: 9px 14px; overflow: hidden; color: #fff; background: var(--green-900); font-weight: 800; line-height: 1.4; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.announcement-content-link:hover, .announcement-content-link:focus-visible { background: var(--green-700); }
.announcement-detail-attachment { display: flex; gap: 12px; margin-top: 18px; font-size: 13px; }
.part-lookup-search { box-sizing: border-box; width: min(320px,100%); padding: 9px 11px; border: 1px solid var(--line); background: var(--paper); font: inherit; }
.part-lookup-table th:first-child,.part-lookup-table td:first-child { width: 72px; text-align: center; }
.part-lookup-thumbnail { display: inline-grid; place-items: center; width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line); background: #eef3f0; }
.part-lookup-thumbnail-empty { color: var(--muted); font-weight: 800; }
.part-lookup-stock { display: none; }
.part-lookup-table tr[hidden] { display: none !important; }
.part-lookup-photo-button { display: inline-grid; padding: 0; background: transparent; border: 0; cursor: zoom-in; }
.part-lookup-photo-dialog { position: relative; box-sizing: border-box; width: min(92vw, 900px); max-height: 92svh; padding: 42px 12px 12px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.part-lookup-photo-dialog::backdrop { background: rgba(5,28,25,.72); }
.part-lookup-photo-dialog::after { content: "CiChen"; position: absolute; top: 52%; left: 50%; z-index: 2; color: rgba(16,47,44,.28); font-size: clamp(51px,15vw,132px); font-weight: 800; pointer-events: none; transform: translate(-50%,-50%) rotate(-24deg); white-space: nowrap; }
.part-lookup-photo-dialog img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(92svh - 58px); margin: 0 auto; object-fit: contain; }
.part-lookup-photo-close { position: absolute; top: 3px; right: 7px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-size: 28px; line-height: 1; }

/* Payroll management and employee salary slip */
.payroll-page-header { align-items: end; display: flex; justify-content: space-between; gap: 24px; }
.payroll-period-form, .payroll-actions { display: flex; align-items: center; gap: 9px; }
.payroll-period-form input, .payroll-actions input { min-height: 42px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; }
.payroll-view-tabs { display: flex; margin: 18px 0; border: 1px solid var(--line); background: var(--paper); }
.payroll-view-tabs a { min-width: 160px; padding: 13px 18px; color: var(--muted); border-right: 1px solid var(--line); font-weight: 800; text-align: center; text-decoration: none; }
.payroll-view-tabs a.active { color: #fff; background: var(--green-700); }
.payroll-flow { display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 16px; border: 1px solid var(--line); background: var(--paper); }
.payroll-flow span { padding: 14px 18px; color: var(--muted); border-right: 1px solid var(--line); font-weight: 800; text-align: center; }
.payroll-flow span:last-child { border-right: 0; }
.payroll-flow span.active { color: var(--ink); background: var(--mint); box-shadow: inset 0 -4px var(--green-700); }
.payroll-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin-bottom: 16px; }
.payroll-summary article { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--green-700); }
.payroll-summary small { display: block; color: var(--muted); font-weight: 700; }
.payroll-summary strong { display: block; margin-top: 8px; font-size: 25px; }
.payroll-record-heading { align-items: center; }
.payroll-actions form { display: flex; align-items: center; gap: 8px; margin: 0; }
.historical-payroll-banner { display: flex; align-items: center; gap: 14px; padding: 14px 24px; color: #6f2b24; background: #fff0ec; border-bottom: 1px solid #e5c1b9; }
.historical-payroll-banner span { flex: 1; color: #775b55; }
.historical-payroll-banner a { color: var(--green-700); font-weight: 800; }
.payroll-main .payroll-actions [data-history-manual-open],.payroll-main .payroll-actions [data-history-import-open] { display: none; }
.historical-payroll-dialog { width: min(1050px, calc(100% - 28px)); }
.historical-import-dialog { width: min(620px, calc(100% - 28px)); }
.historical-payroll-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.historical-payroll-grid .form-span-2 { grid-column: 1 / -1; }
.historical-salary-import-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.75fr); gap: 28px; align-items: center; margin-bottom: 28px; padding: 30px; color: #fff; background: var(--green-900); border: 1px solid #244b46; }
.historical-salary-import-card > div:first-child { display: flex; gap: 22px; align-items: flex-start; }
.historical-salary-import-card .module-number { flex: 0 0 70px; display: grid; place-items: center; min-height: 70px; color: var(--green-900); background: #d9b56b; font-size: 32px; }
.historical-salary-import-card h2 { margin: 0 0 8px; font-size: 28px; }
.historical-salary-import-card p { margin: 0 0 13px; color: #c7d8d4; line-height: 1.7; }
.historical-salary-import-card a { color: #f0cf88; font-weight: 800; }
.historical-salary-import-actions { display: grid; gap: 14px; }
.historical-salary-import-form { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: end; }
.historical-salary-delete-form { display: flex; justify-content: flex-end; }
.historical-salary-delete-form .danger-button { min-height: 44px; border-color: #e3aaa3; background: transparent; color: #ffd5d0; }
.historical-salary-delete-form .danger-button:not(:disabled):hover { background: #742f2a; color: #fff; }
.historical-salary-import-card label { color: #fff; font-weight: 800; }
.historical-salary-import-card input[type=file] { margin-top: 8px; color: var(--ink); background: #fff; }
.historical-salary-import-card select { box-sizing: border-box; width: 100%; min-height: 52px; margin-top: 8px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; font-weight: 800; }
.historical-salary-import-card .toolbar-button { min-height: 52px; background: #d9b56b; color: var(--green-900); }
.historical-salary-record-heading { align-items: center; }
.historical-salary-heading-tools { display: flex; align-items: stretch; gap: 14px; }
.historical-salary-selected-delete { display: flex; align-items: end; margin: 0; }
.historical-salary-selected-list { min-height: 44px; align-self: end; white-space: nowrap; }
.historical-salary-selected-delete .danger-button { min-height: 44px; white-space: nowrap; }
.historical-salary-search { display: grid; align-content: center; gap: 5px; min-width: 280px; color: var(--muted); font-size: 13px; font-weight: 800; }
.historical-salary-search input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; }
.historical-salary-search input:focus { border-color: var(--green-700); outline: 2px solid rgba(21,93,83,.14); }
.historical-salary-selection-summary { display: grid; grid-template-columns: repeat(2,minmax(150px,190px)); gap: 14px; }
.historical-salary-record-form { margin: 0; }
.historical-salary-selection-summary > .danger-button { grid-column: 1 / -1; min-height: 42px; }
.historical-salary-selection-summary article { padding: 13px 18px; background: #f4f7f5; border: 1px solid var(--line); border-top: 3px solid var(--green-700); }
.historical-salary-selection-summary small { display: block; color: var(--muted); font-weight: 700; }
.historical-salary-selection-summary strong { display: block; margin-top: 4px; color: var(--green-900); font-size: 22px; font-variant-numeric: tabular-nums; }
.historical-salary-select-cell { width: 72px; text-align: center !important; }
.historical-salary-select-cell label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.historical-salary-select-cell input { width: 18px; height: 18px; accent-color: var(--green-700); cursor: pointer; }
.historical-salary-type { display: inline-block; min-width: 48px; padding: 4px 9px; border-radius: 999px; text-align: center; font-weight: 900; }
.historical-salary-type.is-salary { color: #0f5b50; background: #dceee8; }
.historical-salary-type.is-bonus { color: #75500c; background: #f7e5b9; }
.historical-selected-detail-toolbar { position: sticky; z-index: 20; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px; background: var(--paper); border: 1px solid var(--line); }
.historical-selected-detail-card { margin-bottom: 24px; }
@media print { .historical-selected-detail-toolbar { display: none !important; } .historical-selected-detail-card { break-after: page; margin: 0; border: 0; } .historical-selected-detail-card:last-child { break-after: auto; } }
.payroll-table td:not(:first-child), .payroll-table th:not(:first-child) { text-align: right; }
.payroll-setting-dialog { width: min(820px,calc(100% - 28px)); }
.payroll-setting-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.payroll-setting-grid label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.payroll-setting-grid input, .payroll-setting-form select { width: 100%; min-height: 44px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; }
.salary-allowance-fieldset { margin: 18px 0 0; padding: 16px; border: 1px solid var(--line); }
.salary-allowance-fieldset legend { padding: 0 8px; color: var(--ink); font-weight: 800; }
.salary-allowance-list { display: grid; gap: 10px; margin-bottom: 12px; }
.salary-allowance-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(120px,.55fr) auto; gap: 10px; }
.salary-allowance-row input { width: 100%; min-height: 44px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; }
.salary-slip-card { padding: 26px; }
.salary-slip-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 19px; border-bottom: 2px solid var(--ink); }
.salary-slip-heading h2 { margin: 0; font-size: 25px; }
.salary-slip-heading p { margin: 6px 0 0; color: var(--muted); }
.salary-slip-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin: 22px 0; }
.salary-slip-summary article { padding: 18px; background: #fafbf9; border: 1px solid var(--line); }
.salary-slip-summary small { display: block; color: var(--muted); font-weight: 700; }
.salary-slip-summary strong { display: block; margin-top: 7px; font-size: 27px; }
.salary-slip-summary .salary-slip-net { color: #fff; background: var(--green-900); border-color: var(--green-900); }
.salary-slip-summary .salary-slip-net small { color: #c9d8d3; }
.salary-slip-details { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.salary-slip-details section { border: 1px solid var(--line); }
.salary-slip-details h3 { margin: 0; padding: 13px 15px; background: var(--mint); font-size: 16px; }
.salary-slip-details section > div { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 11px 15px; border-top: 1px solid #e0e7e4; }
.salary-slip-details .total { background: #fafbf9; font-weight: 900; }
.salary-slip-source { margin-top: 16px; padding: 14px 16px; color: var(--muted); background: #f7f8f5; border-left: 4px solid #87a99f; line-height: 1.7; }
.salary-slip-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.salary-slip-month-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.salary-slip-month-nav strong { min-width: 78px; text-align: center; }
.salary-document-main { width: min(1080px,calc(100% - 28px)); margin: 28px auto 60px; }
.salary-document-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.salary-document { position: relative; isolation: isolate; padding: 42px 48px 48px; overflow: hidden; background: var(--paper); border: 1px solid #d1dcd8; box-shadow: 0 18px 52px rgba(16,47,44,.07); }
.salary-document > * { position: relative; z-index: 1; }
.salary-document-heading { text-align: center; }
.salary-document-heading p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .25em; }
.salary-document-heading h1 { margin: 8px 0 0; font-family: "Noto Serif TC","PMingLiU",serif; font-size: 32px; letter-spacing: .14em; }
.salary-document-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 34px 0 26px; }
.salary-document-meta > div { display: grid; grid-template-columns: 88px 1fr; row-gap: 9px; }
.salary-document-meta > div:last-child { justify-self: end; min-width: 260px; }
.salary-document-meta span { color: var(--muted); }
.salary-document-meta strong { font-weight: 900; }
.salary-document-status { display: inline-flex; width: max-content; padding: 5px 11px; color: #12634f; background: #dff1e9; border-radius: 999px; font-size: 12px; }
.salary-document-tables { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
.salary-document-table { width: 100%; height: auto; border-collapse: collapse; table-layout: fixed; }
.salary-document-table:first-child { border-right: 0; }
.salary-document-table th,.salary-document-table td { height: 42px; padding: 7px 12px; border: 1px solid #30413d; }
.salary-document-table th { font-family: "Noto Serif TC","PMingLiU",serif; font-size: 19px; text-align: center; background: #f7f8f5; }
.salary-document-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.salary-document-total td { font-weight: 900; background: #f4f6f4; }
.salary-document-net td { font-size: 18px; font-weight: 900; background: #edf3f0; }
.salary-document-net td:first-child { text-align: center; }
.salary-document-notice { margin: 22px 0 0; padding: 14px 16px; color: var(--muted); background: #f6f8f5; border-left: 4px solid #89aaa1; font-size: 13px; line-height: 1.7; }
.salary-document-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 22px; color: var(--muted); font-size: 12px; }
@media print { .salary-slip-page .topbar,.salary-slip-page .back-link,.salary-slip-page .page-header,.salary-slip-page .salary-slip-actions,.salary-slip-page .salary-document-toolbar,.salary-slip-page .dashboard-footer { display: none !important; } .salary-slip-main { width: 100%; margin: 0; padding: 0; } .salary-slip-card,.salary-document { border: 0; box-shadow: none; } }
@media (max-width: 700px) {
  .payroll-page-header { align-items: stretch; flex-direction: column; }
  .payroll-period-form { display: grid; grid-template-columns: 1fr auto; }
  .payroll-view-tabs a { min-width: 0; flex: 1; padding: 12px 7px; }
  .payroll-flow { grid-template-columns: 1fr; }
  .payroll-flow span { border-right: 0; border-bottom: 1px solid var(--line); }
  .payroll-flow span:last-child { border-bottom: 0; }
  .payroll-summary { grid-template-columns: repeat(2,1fr); }
  .payroll-summary article { padding: 14px; }
  .payroll-summary strong { font-size: 20px; }
  .payroll-record-heading { align-items: stretch; flex-direction: column; }
  .payroll-actions { align-items: stretch; flex-direction: column; }
  .payroll-actions form { display: grid; grid-template-columns: 1fr; }
  .historical-payroll-banner { align-items: flex-start; flex-direction: column; }
  .historical-payroll-grid { grid-template-columns: 1fr; }
  .historical-payroll-grid .form-span-2 { grid-column: auto; }
  .historical-salary-import-card { grid-template-columns: 1fr; padding: 20px; }
  .historical-salary-import-form { grid-template-columns: 1fr; }
  .historical-salary-delete-form { justify-content: stretch; }
  .historical-salary-delete-form .danger-button { width: 100%; }
  .historical-salary-record-heading { align-items: stretch; flex-direction: column; }
  .historical-salary-heading-tools { flex-direction: column; }
  .historical-salary-search { min-width: 0; }
  .historical-salary-selection-summary { grid-template-columns: repeat(2,1fr); }
  .historical-salary-selection-summary article { padding: 11px 13px; }
  .historical-salary-selection-summary strong { font-size: 18px; }
  .payroll-setting-grid, .salary-slip-details { grid-template-columns: 1fr; }
  .salary-allowance-row { grid-template-columns: 1fr; }
  .salary-slip-card { padding: 17px; }
  .salary-slip-summary { grid-template-columns: 1fr; }
  .salary-slip-summary article { display: flex; align-items: center; justify-content: space-between; }
  .salary-slip-summary strong { margin-top: 0; font-size: 22px; }
  .salary-slip-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .salary-document-main { width: calc(100% - 16px); margin-top: 14px; }
  .salary-document-toolbar { align-items: flex-start; gap: 12px; }
  .salary-document { padding: 25px 14px 28px; }
  .salary-document::before { content: attr(data-watermark); position: absolute; top: 50%; left: 50%; z-index: 0; color: rgba(16,47,44,.075); font-family: "Noto Serif TC","PMingLiU",serif; font-size: clamp(42px,15vw,76px); font-weight: 900; letter-spacing: .08em; white-space: nowrap; pointer-events: none; transform: translate(-50%,-50%) rotate(-28deg); }
  .salary-document-heading h1 { font-size: 26px; }
  .salary-document-meta { grid-template-columns: 1fr; margin: 24px 0 20px; }
  .salary-document-meta > div:last-child { justify-self: stretch; min-width: 0; }
  .salary-document-tables { grid-template-columns: 1fr; gap: 18px; }
  .salary-document-table:first-child { border-right: 1px solid #30413d; }
  .salary-document-table th,.salary-document-table td { padding: 7px 8px; font-size: 14px; }
  .salary-document-spacer { display: none; }
  .salary-document-footer { flex-direction: column; gap: 5px; }
}
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.home-main { padding-top: 17px; }
.welcome h1 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(34px, 5vw, 56px); font-weight: 600; letter-spacing: .05em; }
.welcome > div:first-child > p:last-child { margin: 14px 0 0; color: var(--muted); }
.date-card { min-width: 220px; padding: 18px 22px; text-align: right; background: #e4ece8; border-left: 3px solid var(--green-500); }
.date-card span, .date-card strong { display: block; }
.date-card span { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.date-card strong { margin-top: 5px; font-size: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.summary-card { padding: 24px; background: var(--paper); border: 1px solid var(--line); }
.summary-card > span { display: block; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; margin: 12px 0 6px; color: var(--green-900); font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.summary-card small { color: #97a19d; font-size: 11px; }
.modules { margin-top: 64px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid #ccd7d2; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 28px; font-weight: 600; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.staff-punch-buttons { display: none; }
.smart-punch-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 22px; padding: 18px 22px; color: #fff; background: var(--green-900); box-shadow: 0 14px 34px rgba(16,47,44,.16); }
.smart-punch-clock span,.smart-punch-clock strong { display: block; }
.smart-punch-clock span { opacity: .72; font-size: 11px; }
.smart-punch-clock strong { margin-top: 5px; font-size: 15px; }
.smart-punch-panel .mobile-punch-date,.smart-punch-panel .mobile-punch-time { display: none; }
.smart-punch-actions { display: grid; grid-template-columns: repeat(4, 72px); gap: 10px; }
.smart-punch-actions button { width: 72px; height: 72px; padding: 7px; color: var(--green-900); background: #fff; border: 2px solid #c9d9d5; border-radius: 50%; font: 800 13px/1.3 "Noto Sans TC","Microsoft JhengHei",sans-serif; cursor: pointer; }
.smart-punch-actions button.is-active { box-shadow: 0 5px 12px rgba(0,0,0,.2),inset 0 1px 0 #fff; }
.smart-punch-actions button:disabled { color: #82938f; background: #d7dfdc; border-color: #bdcbc7; cursor: default; opacity: .58; }
.punch-choice-list { display: grid; gap: 10px; margin: 18px 0; }
.punch-choice-list label { display: flex; align-items: center; gap: 9px; padding: 13px; background: #f4f7f5; border: 1px solid var(--line); }
.punch-choice-list input { width: auto; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 22px; }

@media (min-width: 701px) {
  .staff-quick-buttons { display: flex; }
  .staff-punch-buttons { display: grid; grid-template-columns: repeat(4, 56px); gap: 8px; margin-left: auto; }
  .staff-punch-buttons button { display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; width: 56px; height: 56px; padding: 5px; color: var(--green-900); background: #f8faf8; border: 1px solid #9bb8b0; border-radius: 50%; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; line-height: 1.05; cursor: pointer; }
  .staff-punch-buttons button span,
  .staff-punch-buttons button strong { display: block; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .staff-punch-buttons button strong { font-size: 11px; }
  .staff-punch-buttons button.is-punched { color: #fff; background: #050505; border-color: #050505; }
  .staff-punch-buttons button:disabled { cursor: default; opacity: 1; }
}
.module-card { position: relative; min-height: 250px; padding: 26px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(16,47,44,.08); }
.module-number { color: var(--gold); font-family: Georgia, serif; font-size: 13px; }
.module-card h3 { margin: 26px 0 12px; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 22px; font-weight: 600; }
.module-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.module-card button { position: absolute; left: 26px; bottom: 24px; padding: 0; color: #8b9691; background: transparent; border: 0; font-size: 12px; }
.module-card button::after { content: " →"; }
.module-card-link { display: block; color: inherit; text-decoration: none; }
.quick-create-card h3 { margin-bottom: 6px; }
.quick-create-actions { display: grid; gap: 10px; margin-top: 18px; }
.quick-create-button { display: grid; min-height: 52px; padding: 10px 16px; place-items: center; color: #fff; background: var(--green-900); border-radius: 4px; text-decoration: none; font-size: 18px; font-weight: 700; transition: background .2s, transform .2s; }
.quick-create-button:hover { background: var(--green-700); transform: translateY(-1px); }
.quick-create-button:focus-visible { outline: 3px solid rgba(28,105,94,.3); outline-offset: 3px; }
.quick-create-main { min-height: calc(100vh - 142px); }
.quick-create-panel { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 22px; max-width: 760px; margin-top: 28px; padding: 30px; background: var(--paper); border: 1px solid var(--line); }
.quick-create-panel-single { grid-template-columns: minmax(220px, 1fr); max-width: 430px; }
.quick-create-button-large { min-height: 104px; font-size: 24px; }
.people-main { min-height: calc(100vh - 142px); }
.people-management-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); max-width: 920px; }
.module-action { position: absolute; left: 26px; bottom: 24px; color: var(--green-700); font-size: 12px; font-weight: 700; }
.system-management-section { margin-top: 46px; }
.system-management-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.danger-button { padding: 10px 16px; border: 1px solid #a84b44; background: #fff; color: #8b2f2a; font: inherit; font-weight: 700; cursor: pointer; }
.danger-button:hover { background: #fff1ef; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.simulation-status-panel { max-width: 920px; }
.simulation-details { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
.simulation-actions { justify-content: flex-start; align-items: center; }
.simulation-actions form { margin: 0; }
.simulation-clock-dialog input[type="datetime-local"] { width: 100%; }
.system-management-card { display: grid; grid-template-columns: 58px 1fr; gap: 20px; align-items: start; padding: 26px; color: inherit; background: var(--green-900); border: 1px solid var(--green-900); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.system-management-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(16,47,44,.16); }
.system-management-card.system-management-card-active { background: #8b2f2a; border-color: #8b2f2a; }
.system-management-card.system-management-card-active:hover { box-shadow: 0 14px 32px rgba(139,47,42,.24); }
.system-management-card.system-management-card-active .system-card-icon { color: #6f211d; background: #f0c39d; }
.system-management-card.system-management-card-active p { color: #f1d9d5; }
.system-management-card.system-management-card-active strong { color: #ffe0a3; }
.system-card-icon { display: grid; place-items: center; width: 58px; height: 58px; color: var(--green-900); background: var(--gold); font-family: "Noto Serif TC", serif; font-size: 24px; font-weight: 700; }
.system-management-card h3 { margin: 0; color: #fff; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 22px; }
.system-management-card p { margin: 9px 0 18px; color: #b9cbc6; font-size: 13px; line-height: 1.7; }
.system-management-card strong { color: #e8c98e; font-size: 12px; }
.system-account-main { display: grid; gap: 24px; }
.system-account-editor { overflow: visible; }
.system-account-form { padding: 24px; }
.system-account-form .dialog-actions { margin-top: 22px; }
.system-account-table { min-width: 780px; }
.system-account-table td small { display: block; margin-top: 5px; color: var(--muted); }
.system-account-table .row-actions form { display: inline; margin: 0; }
.system-permissions-disabled { opacity: .58; }
.system-permissions-disabled::after { content: "管理員自動取得全部權限"; display: block; margin-top: 10px; color: var(--green-800); font-size: 12px; font-weight: 800; }
@media (max-width: 1280px) {
  .system-management-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .system-management-card { grid-template-columns: 48px 1fr; gap: 14px; padding: 20px; }
  .system-card-icon { width: 48px; height: 48px; font-size: 21px; }
  .system-management-card h3 { font-size: 19px; }
}
.maintenance-page { min-height: 100vh; margin: 0; background: var(--paper); }
.maintenance-layout { display: grid; place-items: center; min-height: 100vh; padding: 28px; }
.maintenance-card { width: min(100%, 620px); padding: clamp(38px, 7vw, 72px); border: 1px solid var(--line); background: var(--cream); text-align: center; box-shadow: 0 22px 58px rgba(16,47,44,.12); }
.maintenance-card .brand-mark { width: 72px; height: 72px; margin: 0 auto 28px; }
.maintenance-card h1 { margin: 10px 0 18px; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(42px, 8vw, 68px); }
.maintenance-card > p:not(.eyebrow) { margin: 0 auto 32px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.maintenance-card .maintenance-countdown { margin-top: -8px; margin-bottom: 0; font-size: 16px; }
.maintenance-card .maintenance-countdown strong { color: var(--teal); font-variant-numeric: tabular-nums; }
.maintenance-status-panel { margin-bottom: 28px; }
.maintenance-toggle-form { margin-top: 24px; }
.maintenance-history { margin-top: 28px; }
.version-main { min-height: calc(100svh - 130px); }
.version-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.version-summary article { padding: 21px 23px; background: var(--paper); border: 1px solid var(--line); }
.version-summary span, .version-summary strong { display: block; }.version-summary span { color: var(--muted); font-size: 12px; }.version-summary strong { margin-top: 8px; color: var(--green-900); font-size: 22px; }
.version-policy { margin-top: 24px; background: var(--paper); border: 1px solid var(--line); }
.version-policy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 24px; }
.version-policy-grid article { padding: 20px; background: #f2f6f3; border-left: 3px solid var(--green-500); }
.version-policy-grid span, .version-policy-grid strong { display: block; }.version-policy-grid span { color: var(--muted); font-size: 12px; }.version-policy-grid strong { margin-top: 7px; color: var(--green-900); font-size: 21px; }
.version-policy-grid p { margin: 10px 0 0; color: #52625d; font-size: 12px; line-height: 1.7; }
.release-rules { margin: 0 24px 24px; padding: 18px 20px; color: #42514d; background: #e7efeb; border-left: 3px solid var(--green-700); }
.release-rules > strong { color: var(--green-900); }.release-rules ul { margin: 10px 0 0; padding-left: 20px; }.release-rules li { margin: 6px 0; line-height: 1.6; }
.release-panel { margin-top: 24px; background: var(--paper); border: 1px solid var(--line); }
.release-list { padding: 8px 28px 28px; }
.release-entry { position: relative; padding: 24px 0 24px 28px; border-bottom: 1px solid var(--line); }
.release-entry:last-child { border-bottom: 0; }.release-entry::before { content: ""; position: absolute; left: 1px; top: 30px; width: 9px; height: 9px; background: #9aaca6; border-radius: 50%; box-shadow: 0 0 0 5px #edf2ef; }.release-current::before { background: var(--gold); box-shadow: 0 0 0 5px #f5ead4; }
.release-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }.release-version { color: var(--green-900); font-size: 20px; font-weight: 800; }.release-meta time { margin-left: auto; color: var(--muted); font-size: 12px; }.release-current-badge { padding: 4px 8px; color: #735014; background: #f5e5c7; border-radius: 999px; font-size: 10px; font-weight: 800; }
.release-type-badge { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }.release-type-major { color: #7b2621; background: #ffe3df; }.release-type-minor { color: #175e52; background: #dcefe9; }.release-type-patch { color: #4f5d59; background: #e7ece9; }
.release-entry ul { margin: 13px 0 0; padding-left: 20px; color: #42514d; }.release-entry li { margin: 7px 0; line-height: 1.65; }.release-empty { margin: 0; padding: 36px; color: var(--muted); text-align: center; }
.dashboard-footer { display: flex; justify-content: space-between; padding: 20px clamp(22px, 5vw, 72px); color: #81908b; background: #e7ece9; border-top: 1px solid #d6dfdb; font-size: 11px; }

.account-main { min-height: calc(100svh - 130px); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.page-header .eyebrow { margin: 26px 0 8px; }
.page-header h1 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(34px, 5vw, 52px); font-weight: 600; }
.page-header > div > p:last-child { margin: 12px 0 0; color: var(--muted); }
.back-link { color: var(--green-700); text-decoration: none; font-size: 13px; font-weight: 700; }
.toolbar-button { min-height: 46px; padding: 0 20px; color: #fff; background: var(--green-900); border: 0; border-radius: 2px; cursor: pointer; font-weight: 700; }
.toolbar-button:hover { background: var(--green-700); }
.toolbar-link { display: grid; place-items: center; text-decoration: none; }
.notice { margin: 24px 0 0; padding: 13px 16px; border-left: 3px solid; font-size: 13px; }
.notice-success { color: #185b43; background: #e4f4ec; border-color: #3d8c6a; }
.notice-error { color: #8b1e1e; background: #fff0ed; border-color: #c43d32; }
.account-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.account-stats article { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); }
.account-stats span { color: var(--muted); font-size: 13px; }
.account-stats strong { color: var(--green-900); font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.data-panel { margin-top: 24px; background: var(--paper); border: 1px solid var(--line); }
.data-panel-heading { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.data-panel-heading h2 { margin: 0; font-size: 20px; }
.data-panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.expense-record-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.expense-record-tools { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; margin-left: auto; }
.expense-record-search { display: grid; gap: 6px; width: min(360px, 38vw); margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.expense-record-search input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; font: inherit; font-size: 13px; }
.expense-record-search input:focus { border-color: var(--green-700); outline: 2px solid rgba(35,103,93,.12); outline-offset: 0; }
.expense-record-summary { box-sizing: border-box; display: grid; min-width: 280px; min-height: 44px; padding: 0 14px; align-content: center; color: var(--green-900); background: var(--mint); border: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap; }
.expense-select-cell { box-sizing: border-box; width: 54px; text-align: center !important; }
.expense-select-cell input { width: 20px; height: 20px; margin: 0; accent-color: var(--green-700); cursor: pointer; }
.expense-record-table tr[hidden] { display: none; }
.expense-payment-open { display: block; min-height: 34px; margin-top: 8px; padding: 0 10px; white-space: nowrap; }
.expense-payment-dialog { width: min(560px,calc(100% - 24px)); }
.expense-payment-dialog > form:not(.dialog-close-form) > label { display: grid; gap: 8px; font-weight: 700; }
.expense-payment-dialog input[type="date"] { box-sizing: border-box; width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); font: inherit; }
@media (max-width: 760px) {
  .expense-record-heading { align-items: stretch; flex-direction: column; }
  .expense-record-tools { align-items: stretch; flex-direction: column; width: 100%; margin-left: 0; }
  .expense-record-search { width: 100%; }
  .expense-record-summary { width: 100%; min-width: 0; white-space: normal; }
}
.personal-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.personal-record-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.personal-duty-type-summary { display: flex; align-items: stretch; gap: 8px; }
.personal-duty-type-summary > span { display: grid; grid-template-columns: max-content max-content; align-items: center; justify-content: center; column-gap: 7px; min-width: 96px; min-height: 40px; padding: 0.5px 8px; background: #eef4f1; border: 1px solid var(--line); }
.personal-duty-type-summary small { color: var(--muted); font-size: 0; line-height: 1; text-align: center; }
.personal-duty-type-summary > span:first-child small::after { content: "假\A日"; white-space: pre; }
.personal-duty-type-summary > span:nth-child(2) small::after { content: "平\A日"; white-space: pre; }
.personal-duty-type-summary small::after { font-size: 14px; line-height: 1.05; }
.personal-duty-type-summary strong { align-self: center; justify-self: start; color: var(--green-900); font-size: 14px; line-height: 1.35; white-space: nowrap; }
.personal-month-filter { position: relative; display: flex; align-items: center; margin: 0; }
.personal-month-filter > button { box-sizing: border-box; min-height: 40px; white-space: nowrap; }
.personal-month-filter.has-value > [data-month-picker-open] { padding-right: 38px; }
.personal-month-clear { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); border-radius: 50%; text-decoration: none; transform: translateY(-50%); font-size: 22px; line-height: 1; }
.personal-month-clear:hover { color: var(--ink); background: #e4ece8; }
.personal-month-dialog { box-sizing: border-box; width: min(420px, calc(100% - 24px)); padding: 22px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 70px rgba(5,28,25,.28); }
.personal-month-dialog::backdrop { background: rgba(4,23,21,.58); }
.personal-month-dialog-head { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 10px; }
.personal-month-dialog-head strong { text-align: center; font-size: 18px; }
.personal-month-dialog-head button { min-width: 0; padding: 8px; font-size: 22px; }
.personal-month-dialog > p { margin: 16px 0 10px; color: var(--muted); font-size: 12px; text-align: center; }
.personal-month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.personal-month-grid button { min-height: 42px; color: var(--ink); background: #f4f7f5; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font: inherit; }
.personal-month-grid button.is-start { color: #fff; background: var(--green-700); border-color: var(--green-700); }
.personal-month-dialog > [data-month-cancel] { width: 100%; margin-top: 14px; }
.account-table-wrap { overflow-x: auto; }
.account-table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 13px; }
.account-table th { padding: 13px 16px; color: #53615d; background: #f0f4f1; text-align: left; white-space: nowrap; }
.account-table td { padding: 16px; border-top: 1px solid #e4e9e6; vertical-align: top; }
.account-table td strong, .account-table td small { display: block; }
.account-table td small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.empty-cell { padding: 42px !important; color: var(--muted); text-align: center; }
.badge { display: inline-block; min-width: 48px; padding: 4px 8px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 700; }
.account-table td > .badge { margin-left: -8px; }
.badge-on { color: #1b694e; background: #def1e8; }.badge-off { color: #6f7774; background: #e7e9e8; }.badge-warn { color: #8b5615; background: #fff0ce; }
.account-status-form { margin: 0; }
.account-status-button { border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.account-status-button:hover { border-color: currentColor; }
.account-create-status { text-decoration: none; }
.connection-state { display: inline-flex; align-items: center; justify-content: center; padding: 5px; white-space: nowrap; }
.connection-state i { width: 10px; height: 10px; border-radius: 50%; }
.connection-online { color: #176b4a; }.connection-online i { background: #38a875; box-shadow: 0 0 0 4px rgba(56,168,117,.14); }
.connection-offline { color: #7a8581; }.connection-offline i { background: #aeb7b3; box-shadow: 0 0 0 4px rgba(148,160,155,.13); }
.connection-detail-button { width: 40px; height: 40px; padding: 0; background: #f2f5f3; border: 1px solid transparent; border-radius: 50%; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.connection-detail-button i { width: 14px; height: 14px; }
.connection-detail-button:hover, .connection-detail-button:focus-visible { background: #e8efeb; border-color: #9eb5ae; outline: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { margin: 0; }
.row-actions button { padding: 5px 8px; color: var(--green-700); background: #fff; border: 1px solid #bfcfc9; cursor: pointer; font-size: 11px; }
.leave-main { min-height: calc(100svh - 130px); }
.leave-form-panel { margin-top: 24px; background: var(--paper); border: 1px solid var(--line); }
.leave-form { padding: 4px 24px 24px; }
.leave-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.leave-form-grid label { margin-top: 18px; }
.leave-form-grid input, .leave-form-grid select, .leave-form-grid textarea, .leave-review-form input { width: 100%; margin-top: 8px; padding: 0 12px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; outline: none; }
.leave-form-grid input, .leave-form-grid select { height: 46px; }
.leave-form-grid textarea { min-height: 94px; padding-top: 11px; resize: vertical; }
.leave-form-grid input[type="file"] { height: auto; padding: 11px 12px; }
.leave-form-grid input:focus, .leave-form-grid select:focus, .leave-form-grid textarea:focus, .leave-review-form input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61,140,127,.13); }
.leave-form-grid input[readonly] { background: #eef2ef; font-weight: 700; }
.employee-identity-line { display: flex; align-items: baseline; gap: clamp(28px,8vw,90px); margin-top: 18px; padding: 0; border: 0; }
.employee-identity-line span { display: inline-flex; align-items: baseline; gap: 10px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.employee-identity-line strong { color: var(--ink); font-size: 17px; font-weight: 900; }
.leave-form-grid small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.leave-wide { grid-column: 1 / -1; }
.leave-date-range-field { margin-top: 18px; }
.leave-field-label { display: block; color: #42514d; font-size: 13px; font-weight: 700; }
.leave-date-range-trigger { width: 100%; height: 46px; margin-top: 8px; padding: 0 12px; color: #747d7b; background: #fbfcf9; border: 1px solid #cad4d0; cursor: pointer; text-align: left; }
.leave-date-range-trigger.has-value { color: var(--ink); font-weight: 700; }
.leave-date-range-trigger:focus-visible { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61,140,127,.13); outline: 0; }
.account-dialog.leave-date-dialog { box-sizing: border-box; width: min(520px, calc(100% - 20px)); max-height: calc(100svh - 20px); padding: 18px; overflow-y: auto; }
.leave-date-dialog .dialog-heading { padding-right: 34px; }
.leave-date-dialog .dialog-heading h2 { font-size: 24px; }
.leave-date-dialog .dialog-heading > p:last-child { margin-top: 5px; font-size: 12px; }
.leave-date-dialog .dialog-close-form button { width: 36px; height: 36px; font-size: 23px; }
.attendance-date-range-dialog { position: relative; padding-top: 68px; }
.attendance-date-range-dialog .dialog-close-form { position: absolute; top: 14px; right: 14px; height: 36px; margin: 0; }
.attendance-date-range-dialog .leave-calendar-toolbar { margin-top: 0; }
.leave-calendar-toolbar { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; margin-top: 12px; }
.leave-calendar-toolbar strong { text-align: center; font-size: 17px; }
.leave-calendar-toolbar button { width: 36px; height: 34px; color: var(--green-700); background: #f3f6f3; border: 1px solid var(--line); cursor: pointer; font-weight: 800; }
.leave-calendar-weekdays, .leave-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.leave-calendar-weekdays { margin-top: 8px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; }
.leave-calendar-grid { margin-top: 4px; }
.leave-calendar-grid button, .leave-calendar-blank { min-height: 34px; }
.leave-calendar-grid button { position: relative; color: var(--ink); background: #fbfcf9; border: 1px solid transparent; cursor: pointer; font-size: 13px; }
.leave-calendar-grid button:hover { border-color: var(--green-500); }
.leave-calendar-grid button.is-today { border-color: var(--gold); }
.leave-calendar-grid button.is-range { color: var(--green-900); background: #dff0ea; }
.leave-calendar-grid button.is-start, .leave-calendar-grid button.is-end { color: #fff; background: var(--green-900); font-weight: 800; }
.leave-calendar-grid button.is-holiday { color: #a04a43; background: #fff5f1; }
.leave-calendar-grid button.is-holiday::after { content: "休"; position: absolute; right: 3px; bottom: 2px; color: #bf6e65; font-size: 8px; }
.leave-calendar-grid button.is-holiday.is-start, .leave-calendar-grid button.is-holiday.is-end { color: #fff; background: var(--green-900); }
.leave-calendar-grid button.is-unavailable { color: #b7bfbc; background: #f3f4f3; cursor: not-allowed; }
.leave-range-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; padding: 8px; background: #eef3f0; }
.leave-range-summary span, .leave-range-summary strong { display: block; }
.leave-range-summary span { color: var(--muted); font-size: 10px; }
.leave-range-summary strong { margin-top: 5px; color: var(--ink); font-size: 12px; }
.leave-range-message { min-height: 20px; margin: 8px 0 0; color: #a1372f; font-size: 12px; }
.leave-range-message:empty { display: none; }
.leave-date-dialog .dialog-actions { margin-top: 8px; }
.leave-date-dialog .dialog-actions button { box-sizing: border-box; height: 36px; min-height: 36px; padding: 0 12px; }
.leave-record-panel { margin-top: 24px; }
.leave-table { min-width: 1180px; }
.leave-table .leave-reason { max-width: 260px; line-height: 1.55; overflow-wrap: anywhere; }
.overtime-table { min-width: 1180px; }
.overtime-table .overtime-reason { max-width: 300px; line-height: 1.55; overflow-wrap: anywhere; }
.table-link { color: var(--green-700); font-weight: 700; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.leave-status-pending { color: #8b5615; background: #fff0ce; }
.leave-status-approved { color: #1b694e; background: #def1e8; }
.leave-status-rejected { color: #8b1e1e; background: #ffe3df; }
.leave-review-form { min-width: 210px; }
.leave-review-form input { height: 34px; margin: 0 0 8px; font-size: 11px; }
.leave-review-form > div { display: flex; gap: 6px; }
.leave-review-form button { min-height: 32px; padding: 0 12px; border: 1px solid; cursor: pointer; font-size: 11px; font-weight: 700; }
.review-approve { color: #176447; background: #e6f5ed; border-color: #96c9b4 !important; }
.review-reject { color: #8b2d27; background: #fff0ed; border-color: #dfaaa5 !important; }
.approval-center-card { border-color: #9abbb0; background: linear-gradient(145deg, #fff 0%, #eef6f2 100%); }
.approval-center-table { min-width: 1160px; }
.approval-center-table tr[hidden] { display: none; }
.approval-center-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.approval-center-tools { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; margin-left: auto; }
.approval-center-search, .approval-bulk-note { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.approval-center-search { width: min(290px, 24vw); }
.approval-bulk-note { width: min(250px, 21vw); }
.approval-center-search input, .approval-bulk-note input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: inherit; font-size: 12px; }
.approval-center-search input:focus, .approval-bulk-note input:focus { border-color: var(--green-700); outline: 2px solid rgba(35,103,93,.12); }
#approval-selection-summary { display: grid; min-height: 42px; padding: 0 12px; align-content: center; color: var(--green-900); background: var(--mint); border: 1px solid var(--line); font-size: 12px; font-weight: 700; white-space: nowrap; }
.approval-bulk-actions { display: flex; gap: 6px; }
.approval-bulk-actions button { min-height: 42px; padding: 0 13px; border: 0; cursor: pointer; font-weight: 700; white-space: nowrap; }
.approval-bulk-actions button:disabled { cursor: not-allowed; opacity: .42; }
.approval-select-cell { box-sizing: border-box; width: 52px; text-align: center !important; }
.approval-select-cell input { width: 20px; height: 20px; margin: 0; accent-color: var(--green-700); cursor: pointer; }
.approval-center-table .approval-reason { max-width: 280px; line-height: 1.55; overflow-wrap: anywhere; }
.approval-type { display: inline-flex; min-width: 44px; justify-content: center; }
.approval-type-leave { color: #2f5e79; background: #e2f0f8; }
.approval-type-leave-cancellation { color: #8b5415; background: #fff0ce; }
.approval-type-overtime { color: #7a4e17; background: #fff0ce; }
.approval-type-expense { color: #6f2f70; background: #f4e4f4; }
@media (max-width: 1100px) {
  .approval-center-heading { align-items: stretch; flex-direction: column; }
  .approval-center-tools { flex-wrap: wrap; justify-content: flex-start; width: 100%; margin-left: 0; }
  .approval-center-search, .approval-bulk-note { flex: 1 1 260px; width: auto; }
}
@media (max-width: 620px) {
  .approval-center-tools { align-items: stretch; flex-direction: column; }
  .approval-center-search, .approval-bulk-note { flex-basis: auto; width: 100%; }
  #approval-selection-summary { width: 100%; }
  .approval-bulk-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .approval-bulk-actions button { width: 100%; }
}
.expense-items { display: grid; gap: 16px; margin-top: 20px; }
.expense-attachment-name { display: block; margin-top: 9px; color: var(--green-800); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.expense-attachment-preview { display: flex; gap: 14px; min-height: 78px; margin-top: 12px; padding: 12px; align-items: center; background: #eef4f1; border: 1px solid var(--line); }
.expense-attachment-preview[hidden] { display: none; }
.expense-attachment-preview img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.expense-attachment-preview > div { display: flex; min-width: 0; flex: 1; gap: 12px; align-items: center; justify-content: space-between; }
.expense-attachment-preview strong { min-width: 0; overflow-wrap: anywhere; }
.expense-item { margin: 0; padding: 6px 18px 18px; border: 1px solid var(--line); }
.expense-item legend { padding: 0 8px; color: var(--green-900); font-weight: 700; }
.expense-item .expense-remove { margin-top: 14px; }
.expense-item-actions { justify-content: space-between; }
.expense-item-actions strong { font-size: 18px; }
.expense-item-actions #expense-add-item { width: auto; min-width: 0; padding: 8px 12px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.expense-total-display { display: grid; gap: 2px; line-height: 1.2; }
.expense-total-display > span { display: block; white-space: nowrap; }
.leave-status-cancelled { color: #53615e; background: #e7ecea; }
.leave-cancel-dialog textarea { box-sizing: border-box; width: 100%; min-height: 130px; margin-top: 8px; padding: 12px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; font: inherit; resize: vertical; }
.leave-cancel-dialog textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61,140,127,.13); outline: none; }
.leave-cancel-dialog .primary-button { width: auto; min-width: 150px; height: 46px; margin-top: 0; padding: 0 20px; }
.personal-leave-cancel-button { box-sizing: border-box; width: auto; min-width: 48px; height: 30px; min-height: 30px; padding: 0 8px; font-size: 12px; line-height: 1; white-space: nowrap; }
.personal-leave-action-form { margin: 0; }
.personal-leave-reason-button { display: inline-grid; place-items: center; width: 15px; min-width: 15px; height: 15px; min-height: 15px; padding: 0; color: transparent; background: #102f2c; border: 1px solid #08211f; border-radius: 50%; box-shadow: 0 1px 2px rgba(8,33,31,.3); cursor: pointer; font-size: 0; line-height: 1; vertical-align: middle; }
.personal-leave-reason-button:hover,
.personal-leave-reason-button:focus-visible { background: #1f655b; border-color: #102f2c; outline: none; }
.personal-leave-reason-dialog { width: min(480px, calc(100% - 28px)); }
.personal-leave-reason-dialog > [data-leave-reason-content] { min-height: 80px; margin: 22px 0; padding: 16px; background: #f4f7f5; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.personal-leave-status-filter { display: none; }
.personal-leave-table tr[data-leave-record-row][hidden] { display: none !important; }
.leave-cancel-date-fieldset { margin: 20px 0 8px; padding: 14px; border: 1px solid #cad4d0; }
.leave-cancel-date-fieldset legend { padding: 0 6px; font-weight: 700; }
.leave-cancel-select-all { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #dce4e1; font-weight: 700; }
.leave-cancel-date-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.leave-cancel-date-option { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; background: #f0f6f3; border: 1px solid #d5e2dd; }
.leave-cancel-date-option input,.leave-cancel-select-all input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-700); }
.leave-cancel-summary { margin: 10px 0 16px; color: var(--green-700); font-weight: 700; overflow-wrap: anywhere; }
.leave-cancel-reason { display: block; font-weight: 700; }
.approval-policy { font-size: 18px !important; }
.item-master-table { min-width: 1320px; }
.item-master-table .item-specification { max-width: 300px; line-height: 1.55; overflow-wrap: anywhere; }
.customer-part-table { min-width: 1120px; }
.customer-part-table td:nth-child(3) { max-width: 280px; overflow-wrap: anywhere; }
.customer-part-filters input { width: 260px; }
.customer-page-heading { align-items: flex-end; }
.customer-list-heading, .customer-subheading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.customer-search { display: flex; align-items: center; gap: 8px; }
.customer-search input { box-sizing: border-box; width: min(360px, 60vw); min-height: 44px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; font: inherit; }
.customer-master-table { min-width: 980px; }
.customer-detail { margin-top: 24px; }
.customer-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; padding: 24px; }
.customer-subheading { margin-bottom: 12px; }
.customer-subheading h3 { margin: 0; font-size: 18px; }
.customer-info-card { display: grid; gap: 5px; margin-bottom: 9px; padding: 15px; background: #f2f5f2; border-left: 3px solid var(--green-700); }
.customer-info-card span, .customer-info-card small { color: var(--muted); }
.customer-info-card p { margin: 0; }
.customer-dialog-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; padding: 34px; }
.customer-dialog-form .dialog-heading, .customer-dialog-form .dialog-actions, .customer-wide-field { grid-column: 1 / -1; }
.customer-dialog-form label { margin: 0; color: #38504b; font-weight: 700; }
.customer-dialog-form input, .customer-dialog-form select, .customer-dialog-form textarea { box-sizing: border-box; width: 100%; margin-top: 7px; padding: 11px 12px; color: var(--ink); background: #fbfcf9; border: 1px solid var(--line); border-radius: 0; font: inherit; }
.customer-dialog-form input, .customer-dialog-form select { min-height: 46px; }
.customer-dialog-form label:has([name="customer_source"]), .customer-dialog-form label:has([name="email"]) { display: none; }
.customer-check { display: flex; align-items: center; gap: 8px; }
.customer-check input { width: 20px; min-height: 20px; margin: 0; }
.item-name-cell { display: flex; min-width: 260px; align-items: center; gap: 12px; }
.item-name-cell > span:last-child { min-width: 0; }
.item-thumbnail { width: 50px; height: 50px; flex: 0 0 50px; object-fit: cover; background: #e8efec; border: 1px solid #cfdbd6; border-radius: 6px; }
.item-thumbnail-empty { display: grid; place-items: center; color: #789089; font-weight: 700; }
.item-row-actions { min-width: 150px; flex-wrap: wrap; }
.item-master-filters input { width: 260px; }
.item-dialog { width: min(820px, calc(100% - 28px)); }
.item-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 24px; }
.item-form-grid label { color: var(--muted); font-size: 12px; font-weight: 700; }
.item-form-grid input, .item-form-grid select, .item-form-grid textarea { width: 100%; margin-top: 7px; padding: 10px 12px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; font: inherit; }
.item-form-grid textarea { resize: vertical; }
.item-form-grid .form-span-2 { grid-column: 1 / -1; }
.item-form-grid .checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 44px; padding-top: 20px; }
.item-form-grid .checkbox-field input { width: 18px; height: 18px; margin: 0; }
.item-photo-field { color: var(--muted); font-size: 12px; font-weight: 700; }
.item-photo-label { display: block; }
.item-photo-control { display: flex; align-items: center; gap: 16px; margin-top: 8px; padding: 14px; background: #eef3f0; border: 1px solid #d2ddd8; }
.item-photo-placeholder, .item-photo-preview { display: grid; width: 112px; height: 112px; flex: 0 0 112px; place-items: center; object-fit: cover; color: #789089; background: #fff; border: 1px dashed #aebfba; }
.item-photo-preview { border-style: solid; }
.item-photo-preview[hidden], .item-photo-placeholder[hidden] { display: none; }
.item-photo-upload-column { min-width: 0; flex: 1; }
.item-photo-file-row { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 12px; padding: 5px 6px 5px 8px; background: #fff; border: 1px solid #c5d2ce; }
.item-photo-choose-button { min-height: 36px; flex: 0 0 auto; padding: 0 14px; color: var(--ink); background: #f5f7f6; border: 1px solid #aebdb8; cursor: pointer; font-weight: 700; }
.item-photo-filename { min-width: 0; flex: 1; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.item-photo-control small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.item-photo-remove-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; margin-left: auto; padding: 0; color: #7b302a; background: #fff; border: 1px solid #d8aaa5; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1; }
.item-photo-remove-button:hover { color: #fff; background: #9a3b33; border-color: #9a3b33; }
.item-photo-remove-button[hidden] { display: none; }
.price-setting-section { margin-top: 4px; padding: 18px; background: #f0f4f2; border: 1px solid #d2ddd8; }
.price-setting-heading h3 { margin: 0; color: var(--green-900); font-size: 17px; }
.price-setting-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; font-weight: 500; }
.price-setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-top: 15px; }
.price-history-dialog { width: min(980px, calc(100% - 28px)); }
.price-history-table-wrap { margin-top: 24px; }
.price-history-table { min-width: 820px; }
@media (max-width: 700px) { .item-form-grid { grid-template-columns: 1fr; } .item-form-grid .form-span-2 { grid-column: auto; } .item-master-filters { width: 100%; flex-wrap: wrap; } .item-master-filters input, .item-master-filters select { width: 100%; } .item-photo-control { align-items: flex-start; flex-direction: column; } .item-photo-upload-column { width: 100%; } .price-setting-grid { grid-template-columns: 1fr; } }
.people-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.people-filters { display: flex; gap: 8px; }
.people-filters input, .people-filters select { height: 40px; padding: 0 10px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; }
.people-filters input { width: 220px; }
.people-table { min-width: 1180px; }
.people-table td { vertical-align: middle; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: auto; }
.person-cell .employee-thumb { flex: 0 0 auto; }
.people-row-actions { min-width: 176px; }
.people-row-actions a { padding: 5px 8px; color: var(--green-700); background: #fff; border: 1px solid #bfcfc9; text-decoration: none; font-size: 11px; }
.annual-leave-table { min-width: 1180px; }
.annual-leave-table td:nth-child(3) { min-width: 210px; }
.annual-leave-filters input { width: 240px; }
.annual-leave-negative { color: #a43b32; }
.annual-adjustment-history { margin-top: 18px; }
.people-link-note { margin: 18px 0 0; padding: 13px 16px; color: #4b5f59; background: #e7efeb; border-left: 3px solid var(--green-700); font-size: 12px; }
.people-link-note strong { color: var(--green-900); }
.people-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 24px; }
.employee-full-detail-dialog { width: min(1060px, calc(100% - 28px)); height: min(900px, calc(100svh - 30px)); max-height: calc(100svh - 30px); overflow: hidden; }
.employee-detail-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.employee-detail-tabs button { min-height: 52px; padding: 10px 12px; color: var(--green-900); background: #fbfaf6; border: 1px solid var(--line); font-weight: 800; cursor: pointer; }
.employee-detail-tabs button.active { color: #fff; background: var(--green-900); border-color: var(--green-900); }
.employee-detail-panel { display: none; padding-top: 4px; }
.employee-detail-panel.active { display: block; }
.employee-detail-scroll { height: calc(100% - 190px); margin-top: 8px; padding-right: 8px; overflow-y: auto; overscroll-behavior: contain; }
.employee-detail-photo-wrap { margin-top: 20px; }
.employee-detail-photo-wrap img { display: block; width: 112px; height: 112px; object-fit: cover; background: #eef3f0; border: 1px solid var(--line); border-radius: 50%; }
.employee-detail-empty { margin: 24px 0 0; padding: 28px; color: var(--muted); background: #f1f5f2; border: 1px solid var(--line); text-align: center; }
.employee-insurance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.employee-insurance-summary article { display: grid; gap: 8px; padding: 22px; background: #f1f5f2; border: 1px solid var(--line); }
.employee-insurance-summary h3 { margin: 0; color: var(--green-900); }
.employee-insurance-summary strong { font-size: 22px; }
.employee-insurance-summary span { color: var(--muted); font-size: 12px; }
.employee-dependent-list { display: grid; gap: 10px; margin-top: 24px; }
.employee-dependent-list article { display: grid; grid-template-columns: minmax(160px, .7fr) 2fr; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); }
.employee-dependent-list h3 { margin: 0 0 6px; }
.employee-dependent-list span { color: var(--muted); font-size: 12px; }
.employee-dependent-list dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.employee-dependent-list dl div { min-width: 0; }
.employee-dependent-list dt { color: var(--muted); font-size: 11px; }
.employee-dependent-list dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.employee-summary-dialog[open] { grid-template-rows: auto minmax(0, 1fr); }
.employee-summary-scroll { margin-top: 22px; padding-right: 8px; }
.employee-summary-profile { display: flex; align-items: center; gap: 24px; padding: 22px; background: #e8f0ed; border: 1px solid var(--line); }
.employee-summary-profile .employee-detail-photo-wrap { flex: 0 0 auto; margin: 0; }
.employee-summary-profile .employee-detail-photo-wrap img, .employee-detail-photo-fallback { width: 112px; height: 112px; border-radius: 0; }
.employee-detail-photo-fallback { display: grid; flex: 0 0 auto; place-items: center; color: #dceae5; background: var(--green-900); font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 48px; }
.employee-detail-photo-fallback[hidden] { display: none; }
.employee-summary-profile h3 { margin: 0; color: var(--ink); font-size: 24px; }
.employee-summary-profile p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.employee-summary-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.employee-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.employee-summary-card { min-width: 0; padding: 22px; background: #fbfaf6; border: 1px solid var(--line); }
.employee-summary-card-wide { grid-column: 1 / -1; }
.employee-summary-card > h3 { margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 18px; }
.employee-summary-card .people-detail-grid { margin-top: 8px; gap: 0 18px; }
.employee-summary-card .employee-contact-details-single { grid-template-columns: 1fr; }
.employee-summary-card .employee-details { border-top: 0; }
.employee-summary-card .employee-details div { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
.employee-summary-card .employee-insurance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.employee-summary-card .employee-insurance-summary article { padding: 15px; }
.employee-summary-card .employee-insurance-summary strong { font-size: 18px; }
.employee-dependent-table-wrap { margin-top: 16px; overflow-x: auto; }
.employee-dependent-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.employee-dependent-table th, .employee-dependent-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.employee-dependent-table th { color: var(--muted); background: #e8f0ed; font-size: 12px; }
.employee-dependent-table td { font-weight: 700; }
.account-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100svh - 30px); padding: 34px; color: var(--ink); background: var(--paper); border: 0; box-shadow: 0 28px 90px rgba(5,28,25,.35); overflow-y: auto; }
.account-dialog::backdrop { background: rgba(4,23,21,.64); backdrop-filter: blur(2px); }
.account-dialog:focus { outline: none; }
.small-dialog { width: min(480px, calc(100% - 28px)); }
.dialog-close-form { position: sticky; top: 0; z-index: 30; display: flex; justify-content: flex-end; height: 0; margin: 0 -18px 0 0; pointer-events: none; }
.dialog-close-form button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--muted); background: rgba(251,250,246,.96); border: 0; border-radius: 50%; box-shadow: 0 2px 10px rgba(5,28,25,.12); cursor: pointer; font-size: 28px; line-height: 1; pointer-events: auto; }
.dialog-heading { padding-right: 40px; }
.dialog-heading .eyebrow { margin-bottom: 8px; }
.dialog-heading h2 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 28px; }
.dialog-heading > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.create-account-dialog { width: min(1100px, calc(100% - 28px)); }
.account-linked-employee { margin-top: 22px; }
.account-linked-employee label { display: block; }
.account-linked-employee input[readonly] { background: #f0f4f1; font-weight: 700; cursor: not-allowed; }
.account-create-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.account-dialog label { margin-top: 18px; }
.account-dialog input:not([type="checkbox"]), .account-dialog select { width: 100%; height: 46px; margin-top: 8px; padding: 0 12px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; outline: none; }
.account-dialog input:focus, .account-dialog select:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(61,140,127,.13); }
.account-dialog fieldset { margin: 24px 0 0; padding: 16px; border: 1px solid var(--line); }
.account-dialog legend { padding: 0 6px; color: #42514d; font-size: 13px; font-weight: 700; }
.account-card-permissions[hidden] { display: none !important; }
.account-card-permissions > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.account-maintenance-option > label { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 15px 16px; background: #f2f6f4; border: 1px solid #d7e1dd; cursor: pointer; }
.account-maintenance-option input, .account-card-permission-grid input { flex: 0 0 auto; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--green-700); }
.account-maintenance-option strong, .account-card-permission-grid strong { display: block; }
.account-maintenance-option small, .account-card-permission-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.account-card-permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.account-card-permission-grid > label { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; min-height: 82px; margin: 0; padding: 14px; background: #fff; border: 1px solid var(--line); cursor: pointer; }
.account-card-permission-grid > label:has(input:checked) { background: #edf5f1; border-color: #6e9e91; box-shadow: inset 3px 0 var(--green-700); }
.account-card-permission-item { min-width: 0; background: #fff; border: 1px solid var(--line); }
.account-card-permission-item:has(> .account-card-parent input:checked) { background: #edf5f1; border-color: #6e9e91; box-shadow: inset 3px 0 var(--green-700); }
.account-card-parent { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; min-height: 54px; margin: 0; padding: 14px; cursor: pointer; }
.account-card-permission-item details { border-top: 1px solid var(--line); }
.account-card-permission-item summary { padding: 10px 14px; color: var(--green-800); cursor: pointer; font-size: 12px; font-weight: 800; }
.account-card-detail-list { display: grid; gap: 7px; padding: 0 14px 14px; }
.account-card-detail-list label { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; margin: 0; padding: 8px 10px; background: rgba(255,255,255,.72); border: 1px solid #d6dfdc; cursor: pointer; font-size: 12px; }
.account-card-detail-list label:has(input:checked) { color: var(--green-900); background: #fff; border-color: #6e9e91; font-weight: 800; }
.account-card-permission-grid input:disabled { cursor: default; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkbox-grid label { margin: 0; padding: 9px; background: #f3f6f3; font-weight: 500; }
.checkbox-grid label:has(input:disabled) { opacity: .48; }
.checkbox-grid label:has(input:checked:disabled) { opacity: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.site-message-dialog { width:min(480px,calc(100% - 28px)); }
.site-message-dialog-text { margin:24px 0 0; color:var(--ink); font-size:18px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.site-message-dialog-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.site-message-dialog-actions.is-alert { grid-template-columns:minmax(0,1fr); }
.site-message-dialog-actions button { box-sizing:border-box; width:100%; min-height:52px; }
.secondary-button { min-height: 46px; padding: 0 20px; color: var(--green-900); background: transparent; border: 1px solid #afc0ba; cursor: pointer; font-weight: 700; }
.detail-dialog { width: min(1100px, calc(100% - 28px)); }
.detail-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: min(760px, calc(100svh - 30px)); overflow: hidden; }
.employee-full-detail-dialog[open] { height: calc(100svh - 30px); max-height: calc(100svh - 30px); }
.employee-full-detail-dialog .employee-detail-scroll { height: auto; min-height: 0; }
.detail-dialog .dialog-close-form { position: absolute; top: 16px; right: 16px; height: auto; margin: 0; }
.employee-details { margin: 0; border-top: 1px solid var(--line); }
.employee-details div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.employee-details dt { color: var(--muted); font-size: 12px; }
.employee-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.login-status-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 28px; margin-top: 24px; border: 0; }
.login-status-details div { display: block; min-height: 0; padding: 4px 0; border: 0; }
.login-status-details dt, .login-status-details dd { min-height: 0; font-size: 14px; line-height: 1.4; }
.login-status-details dd { margin-top: 4px; }
.login-status-details .connection-state { margin-top: -4px; }
.detail-dialog .login-history-section { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.login-history-section { margin-top: 38px; }
.login-history-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 14px; }
.login-history-heading .eyebrow { margin-bottom: 6px; }
.login-history-heading h3 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 24px; }
.login-history-heading > span, .login-history-controls span { color: var(--muted); font-size: 11px; }
.login-history-controls { display: flex; align-items: center; gap: 9px; }
.login-history-controls button { min-height: 32px; padding: 0 13px; color: var(--green-700); background: #fbfcf9; border: 1px solid #b9cbc5; cursor: pointer; font-size: 12px; font-weight: 700; }
.login-history-controls button:disabled { color: var(--muted); cursor: default; opacity: .72; }
.login-history-table-wrap { min-height: 0; overflow: auto; border: 1px solid var(--line); scrollbar-gutter: stable; }
.login-history-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.login-history-table thead { position: sticky; top: 0; z-index: 1; }
.login-history-table th { padding: 11px 12px; color: #53615d; background: #eef3f0; text-align: left; white-space: nowrap; }
.login-history-table td { max-width: 260px; padding: 2px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.history-success { color: #19704e; font-weight: 800; }.history-failure { color: #a1372f; font-weight: 800; }
.history-empty { margin: 0; padding: 30px; color: var(--muted); text-align: center; font-size: 13px; }
.employee-table { min-width: 980px; }
.employee-thumb { display: grid; place-items: center; width: 52px; height: 52px; object-fit: cover; color: #fff; background: var(--green-700); border-radius: 50%; font-weight: 800; }
.employee-thumb-empty { font-family: "Noto Serif TC", serif; font-size: 20px; }
.employee-dialog { width: min(1120px, calc(100% - 28px)); }
.employee-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.employee-form-grid .wide-field, .employee-form-grid .checkbox-line { grid-column: 1 / -1; }
.employee-form-grid label small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.employee-form-grid .checkbox-line { display: flex; align-items: center; gap: 8px; padding: 10px; background: #f2f5f3; }
.employee-form-grid .checkbox-line input { width: auto; height: auto; margin: 0; }
.employee-dialog label { color: #40524e; font-size: 13px; font-weight: 700; }
.employee-dialog input:not([type="checkbox"]):not([type="file"]), .employee-dialog select { height: 42px; margin-top: 6px; padding: 0 11px; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 13px; font-weight: 400; }
.employee-dialog input::placeholder { color: #747d7b; opacity: 1; font-weight: 400; }
.employee-dialog input[type="date"], .employee-dialog select.placeholder-value { color: #747d7b; }
.employee-dialog input[type="date"].has-value, .employee-dialog select:not(.placeholder-value) { color: var(--ink); }
.employee-form-grid-new { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 16px; margin-top: 18px; }
.employee-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; margin-top: 13px; }
.employee-address-grid { display: grid; grid-template-columns: 1fr; gap: 13px; margin-top: 13px; }
.employee-employment-grid, .employee-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; margin-top: 13px; }
#employee-termination-field[hidden] { display: none !important; }
.employee-account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-form-grid-new label, .employee-contact-grid label, .employee-address-grid label, .employee-employment-grid label, .employee-account-grid label { margin-top: 0; }
.employee-field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.employee-field-label-row > label { margin: 0; }
.employee-same-address { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--green-700); font-size: 12px; cursor: pointer; }
.employee-same-address input { width: 16px; height: 16px; margin: 0; accent-color: var(--green-900); }
.employee-photo-field { margin-top: 13px; color: var(--muted); font-size: 13px; font-weight: 700; }
.employee-related-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 16px; width: calc(50% - 8px); margin: 13px 0 0 auto; }
.employee-related-actions[hidden] { display: none !important; }
.employee-related-actions .secondary-button { display: flex; align-items: center; justify-content: center; min-height: 42px; text-decoration: none; }
.employee-related-dialog { width: min(1120px,calc(100% - 28px)); height: min(900px,calc(100svh - 28px)); padding: 24px; overflow: hidden; }
.employee-related-dialog[open] { display: flex; flex-direction: column; }
.employee-related-heading { flex: 0 0 auto; padding-right: 54px; }
.employee-related-heading .eyebrow { margin: 0 0 5px; }
.employee-related-heading h2 { margin: 0 0 12px; font-size: 27px; }
.employee-related-dialog iframe { flex: 1 1 auto; width: 100%; min-height: 0; border: 1px solid var(--line); background: var(--cream); }
.embedded-module-page { min-height: 0 !important; }
.embedded-module-page .topbar, .embedded-module-page .dashboard-footer, .embedded-module-page .back-link, .embedded-module-page .payroll-view-tabs { display: none !important; }
.embedded-module-page .dashboard-main { width: 100%; max-width: none; min-height: 0; padding: 18px; }
.embedded-module-page .page-header { margin-top: 0; }
.embedded-module-page .insurance-header-actions a { display: none; }
.employee-maintenance-main { max-width: 1180px; }
#employee-maintenance-title:focus { outline: none; }
.employee-maintenance-mode-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.employee-maintenance-mode-tabs button { display: grid; width: 100%; min-height: 58px; place-items: center; color: var(--ink); background: var(--paper); border: 1px solid var(--line); cursor: pointer; font-size: 18px; font-weight: 900; }
.employee-maintenance-mode-tabs button.active { color: #fff; background: var(--green-900); border-color: var(--green-900); }
.employee-maintenance-switcher { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; padding: 18px; background: #eef5f2; border-left: 5px solid var(--green-700); }
.employee-maintenance-switcher label { display: grid; gap: 8px; font-weight: 800; }
.employee-maintenance-switcher select { width: 100%; min-height: 50px; }
.employee-maintenance-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 20px 0 12px; }
.employee-maintenance-tabs.employee-maintenance-tabs-five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.employee-maintenance-tabs button { display: grid; width: 100%; min-height: 52px; place-items: center; border: 1px solid var(--line); color: var(--ink); background: var(--cream); cursor: pointer; font-weight: 900; }
.employee-maintenance-tabs button.active { color: #fff; background: var(--green-900); border-color: var(--green-900); }
.employee-maintenance-subtabs { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.employee-maintenance-subtabs[hidden] { display: none !important; }
.employee-maintenance-subtabs button { min-width: 150px; padding: 11px 18px; border: 1px solid var(--line); color: var(--ink); background: var(--cream); cursor: pointer; text-align: center; font-weight: 800; }
.employee-maintenance-subtabs button.active { color: #fff; background: var(--green-700); border-color: var(--green-700); }
.employee-maintenance-frame { display: block; width: 100%; height: auto; min-height: 320px; overflow: hidden; border: 1px solid var(--line); background: var(--cream); }
.employee-maintenance-frame-stack { position: relative; width: 100%; height: auto; min-height: 320px; overflow: visible; background: var(--cream); border: 1px solid var(--line); }
.employee-maintenance-frame-stack .employee-maintenance-frame { width: 100%; height: auto; min-height: 320px; overflow: hidden; border: 0; }
.employee-maintenance-frame-stack .employee-maintenance-frame[hidden] { display: none; }
.embedded-direct-editor .dashboard-main, .embedded-direct-editor .dashboard-footer { visibility: hidden; }
.embedded-direct-editor dialog[open] { visibility: visible; }
.embedded-inline-editor .dashboard-main > :not(dialog) { display: none !important; }
.embedded-inline-basic .dashboard-main, .embedded-inline-insurance .dashboard-main, .embedded-inline-account .dashboard-main { display: none !important; }
.embedded-inline-editor { background: var(--paper); }
.embedded-inline-editor .dashboard-main { padding: 0 !important; background: var(--paper); }
.embedded-inline-editor label:has(> select[name="employee_id"]) { display: none !important; }
.embedded-inline-editor dialog.direct-entry-dialog[open] { position: relative; inset: auto; display: block; width: 100%; max-width: none; min-height: 0; max-height: none; margin: 0; padding: 28px; overflow: visible; border: 0; box-shadow: none; }
.embedded-inline-editor dialog.direct-entry-dialog::backdrop { background: transparent; }
.embedded-inline-editor dialog.direct-entry-dialog[open] > .dialog-close-form { display: none !important; }
.embedded-inline-editor .employee-related-actions { display: none !important; }
.embedded-inline-editor .payroll-setting-form, .embedded-inline-editor .insurance-form { width: 100%; }
.embedded-inline-editor .embedded-salary-history { margin: 20px 28px 28px; }
.embedded-inline-editor .embedded-salary-history .salary-history-scroll { overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.embedded-inline-editor .embedded-insurance-history { margin: 20px 28px 28px; }
.embedded-inline-editor .embedded-insurance-history .insurance-history-scroll { overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.embedded-inline-editor .embedded-dependent-list { margin: 20px 28px 28px; }
.embedded-dependent-list td:last-child { min-width: 210px; }
.embedded-dependent-list .dependent-delete-button { margin-left: 8px; }
.insurance-actual-amounts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.insurance-actual-amounts[hidden] { display: none !important; }
.embedded-employee-editor .topbar, .embedded-employee-editor > main, .embedded-employee-editor > footer { display: none !important; }
.embedded-employee-editor dialog#employee-dialog[open] { width: min(1080px,calc(100% - 12px)); max-height: calc(100svh - 12px); }
.embedded-module-page .dependent-filters { display: none !important; }
.embedded-module-page .dialog-heading:has(.maintenance-selected-employee), .embedded-module-page .page-header:has(.maintenance-selected-employee) { position: relative; min-height: 112px; padding-right: min(38vw,360px); }
.maintenance-selected-employee { position: absolute; top: 0; right: 0; display: grid; min-width: 280px; gap: 7px; padding: 17px 20px; border-left: 4px solid var(--green-700); background: #edf5f2; text-align: left; }
.maintenance-selected-employee span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.maintenance-selected-employee strong { color: var(--green-900); font-size: 24px; font-weight: 900; line-height: 1.3; }
.health-insured-column { display: grid; align-content: start; gap: 10px; }
.health-insured-column[hidden] { display: none !important; }
.health-insured-column label { margin: 0; }
.embedded-module-page .dialog-heading:has(.health-dependent-trigger) { min-height: 180px; }
.maintenance-selected-employee .health-dependent-trigger { position: absolute; top: calc(100% + 10px); left: 0; width: 100%; min-height: 46px; font-size: 16px; }
.employee-dependent-modal { width: min(1180px,calc(100% - 28px)); max-width: none; max-height: 92svh; margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); background: var(--cream); box-shadow: var(--shadow); }
.employee-dependent-modal::backdrop { background: rgba(11,36,34,.58); }
.employee-dependent-modal > header { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.employee-dependent-modal > header .eyebrow { margin-bottom: 4px; }
.employee-dependent-modal > header h2 { margin: 0; }
.employee-dependent-modal .employee-maintenance-frame { min-height: 520px; border: 0; }
.employee-photo-control { margin-top: 6px; }
.employee-photo-placeholder { color: #c7d4cf; background: var(--green-900); border-style: solid; font-family: "Noto Serif TC", serif; font-size: 38px; }
.employee-photo-preview { background: var(--green-900); }
.employee-photo-placeholder[hidden], .employee-photo-preview[hidden] { display: none !important; }
.employee-photo-file { display: none; }
.employee-photo-copy small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.employee-photo-copy small.success { color: #19704e; font-weight: 700; }
.employee-photo-copy .checkbox-line { display: flex; align-items: center; gap: 7px; margin: 0; padding: 7px 9px; background: #fff; }
.employee-photo-copy .checkbox-line input { width: auto; height: auto; margin: 0; }
.employee-account-heading { margin-top: 24px; }
.employee-account-heading .eyebrow { margin: 0 0 6px; }
.employee-account-heading h3 { margin: 0; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 25px; line-height: 1.3; }
.employee-account-heading > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.insurance-history { margin-top: 24px; }
.insurance-table { min-width: 920px; }
.insurance-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.insurance-form .dialog-heading, .insurance-form .dialog-actions { grid-column: 1 / -1; }
.insurance-form label { color: #40524e; font-size: 13px; font-weight: 700; }
.insurance-form label[hidden] { display: none !important; }
.insurance-form [data-pension-rate-field][hidden] { display: none !important; }
.insurance-form input, .insurance-form select { box-sizing: border-box; width: 100%; height: 42px; margin-top: 6px; padding: 0 11px; color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; background: #fbfcf9; border: 1px solid #cad4d0; font-size: 16px; }
.insurance-form label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.insurance-grade-preview { grid-column: 1 / -1; display: grid; gap: 5px; padding: 14px 16px; border: 1px solid #b8cbc6; background: #edf5f2; color: #40524e; font-size: 13px; }
.insurance-grade-preview.is-underinsured { border-color: #c43d32; background: #fff0ed; color: #8b2f2a; }
.insurance-grade-preview.is-underinsured strong { color: #7d211c; }
.insurance-grade-preview strong { color: var(--ink); }
.insurance-grade-preview span { display: block; }
.insurance-grade-preview.has-current-summary { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 28px; }
.insurance-legal-summary, .insurance-current-summary { display: grid; align-content: start; gap: 5px; min-width: 0; }
.insurance-current-summary { padding-left: 28px; border-left: 1px solid currentColor; }
.insurance-grade-preview.is-underinsured .insurance-current-summary { border-left-color: #d9a19b; }
.insurance-header-actions { display: flex; align-items: center; gap: 10px; }
.insurance-header-actions .secondary-button { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.submission-filters { display: flex; align-items: flex-end; gap: 8px; margin-top: 24px; padding: 16px; background: var(--paper); border: 1px solid var(--line); }
.submission-filters label { display: flex; flex-direction: column; justify-content: flex-end; margin: 0; color: #40524e; font-size: 12px; font-weight: 700; }
.submission-filters input, .submission-filters select { display: block; box-sizing: border-box; height: 42px; margin: 6px 0 0; padding: 0 10px; color: var(--ink); background: #fbfcf9; border: 1px solid #cad4d0; }
.submission-filters .secondary-button { display: inline-flex; align-self: flex-end; align-items: center; justify-content: center; box-sizing: border-box; width: 90px; height: 42px; min-height: 42px; margin: 0; padding: 0 12px; line-height: 1; text-decoration: none; }
.dependent-filters select[name="employee_id"] { width: 220px; }
.dependent-filters select[name="status"] { width: 150px; }
.submission-record-filters input[type="date"] { width: 180px; }
.submission-record-filters select { width: 150px; }
.submission-table { min-width: 1180px; }
.submission-status-draft { color: #6f7774; background: #e7e9e8; }
.submission-status-submitted { color: #235a77; background: #dceef7; }
.submission-status-accepted { color: #1b694e; background: #def1e8; }
.submission-status-rejected { color: #8b3b30; background: #f6ded9; }
.submission-dialog { width: min(820px, calc(100% - 28px)); }
.submission-create-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.submission-employee-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; max-height: 330px; overflow: auto; }
.submission-employee-grid label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; background: #f3f6f4; }
.submission-employee-grid input, .submission-select-all input { width: 17px !important; height: 17px !important; margin: 0 !important; }
.submission-employee-grid small { display: block; margin-top: 3px; color: var(--muted); }
.submission-select-all { display: flex; align-items: center; gap: 8px; margin: 0 0 12px !important; }
.dependent-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
.dependent-table { min-width: 1250px; }
.personal-record-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); margin-top: 28px; background: var(--paper); border: 1px solid var(--line); }
.personal-record-tabs a { display: grid; box-sizing: border-box; grid-template-rows: auto 1fr; gap: 1px; min-width: 0; min-height: 0; height: 34px; padding: 2px 4px; overflow: hidden; color: var(--ink); border-right: 1px solid var(--line); text-decoration: none; }
.personal-record-tabs a:last-child { border-right: 0; }
.personal-record-tabs a span { color: #d8a449; font-size: 12px; font-weight: 800; }
.personal-record-tabs a strong { align-self: end; max-width: 100%; overflow: hidden; font-family: "Noto Serif TC","PMingLiU",serif; font-size: 16px; line-height: 1.1; white-space: nowrap; }
.personal-record-tabs a.active { color: #fff; background: var(--green-900); }
.personal-record-tabs a.active span { color: #fff; }
.personal-profile-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin-top: 28px; padding: 1px; background: var(--line); }
.personal-profile-grid article { min-height: 110px; padding: 22px; background: var(--paper); }
.personal-profile-grid span { display: block; color: var(--muted); font-size: 12px; }
.personal-profile-grid strong { display: block; margin-top: 14px; overflow-wrap: anywhere; font-size: 17px; }
.personal-leave-summary { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); background: var(--paper); }
.personal-profile-grid .personal-leave-summary article { border: 0; border-radius: 0; }
.personal-leave-summary small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.account-dialog .insurance-form { gap: 18px; }
.account-dialog .insurance-form label { margin-top: 0; }
.account-dialog .insurance-form input:not([type="checkbox"]), .account-dialog .insurance-form select { height: 46px; margin-top: 6px; }

@media (max-width: 960px) {
  .login-layout { grid-template-columns: 38% 1fr; }
  .brand-copy { padding-left: 0; }
  .brand-panel::after { display: none; }
  .summary-grid, .module-grid { grid-template-columns: repeat(2, 1fr); }
  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .staff-profile { grid-template-columns: repeat(2, 1fr); }
  .version-summary { grid-template-columns: 1fr 1fr; }
  .version-policy-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html, body.dashboard-page { background-color: #f1f4f1; }
  body.dashboard-page { overflow-x: clip; overflow-anchor: none; }
  body.dashboard-page dialog { overflow-anchor: none; }
  .embedded-module-page .dialog-heading:has(.maintenance-selected-employee), .embedded-module-page .page-header:has(.maintenance-selected-employee) { min-height: 0; padding-right: 0; }
  .maintenance-selected-employee { position: static; min-width: 0; margin-top: 16px; }
  .embedded-module-page .dialog-heading:has(.health-dependent-trigger) { min-height: 0; }
  .maintenance-selected-employee:has(.health-dependent-trigger) { position: relative; }
  .maintenance-selected-employee .health-dependent-trigger { position: static; width: 100%; margin-top: 6px; }
  .expense-item-actions { display: grid; grid-template-columns: max-content max-content; align-items: center; justify-content: center; gap: 12px; width: 100%; }
  .account-card-permission-grid { grid-template-columns: 1fr; }
  .simulation-details { grid-template-columns: 1fr 1fr; }
  .simulation-actions { align-items: stretch; flex-direction: column; }
  .simulation-actions > *, .simulation-actions form button { width: 100%; }
  .customer-page-heading, .customer-list-heading { align-items: stretch; flex-direction: column; }
  .customer-search input { width: 100%; }
  .customer-detail-grid, .customer-dialog-form { grid-template-columns: 1fr; }
  .customer-dialog-form { padding: 24px 18px; }
  .customer-dialog-form .dialog-heading, .customer-dialog-form .dialog-actions, .customer-wide-field { grid-column: auto; }
  .form-application-grid, .employee-center-grid { gap: 10px; }
  .login-layout { display: block; }
  .brand-panel { display: none; }
  .login-panel { min-height: 100svh; padding: 28px 20px; }
  .login-card { padding: 34px 26px; }
  .mobile-brand { display: flex; gap: 16px; margin-bottom: 42px; color: var(--green-900); }
  .mobile-brand > span { font-size: 32px; }
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; min-height: 68px; }
  .dashboard-brand > span { justify-content: center; }
  .dashboard-brand > span > strong { font-size: 21px; }
  .dashboard-brand small { display: none; }
  .header-breadcrumb { display: none; }
  .mobile-topbar-greeting { position: relative; left: -8px; display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: #fff; text-align: center; white-space: nowrap; }
  .mobile-topbar-greeting strong { max-width: 100%; overflow: hidden; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: clamp(13px, 3.7vw, 17px); font-weight: 600; line-height: 1.15; text-overflow: ellipsis; }
  .mobile-topbar-greeting small { margin-top: 12px; color: #abc0bb; font-size: 11px; font-weight: 500; line-height: 1; }
  .topbar-actions { justify-self: end; }
  .staff-hero { display: none !important; }
  .status-pill { display: none; }
  .dashboard-main { width: min(100% - 30px, 1320px); padding-top: 42px; }
  .staff-main { padding-top: 0; }
  .staff-announcement { z-index: 4; height: 200px; margin-top: 14px; padding: 12px; overflow: visible; background: linear-gradient(145deg,#edf5f1,#e1ece7); border: 1px solid rgba(16,47,44,.16); border-left: 4px solid var(--green-700); border-radius: 16px; box-shadow: 0 10px 26px rgba(16,47,44,.10); }
  .staff-announcement-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 0; }
  .staff-announcement-heading > h2 { display: none; }
  .mobile-announcement-toggle { display: grid; flex: 1 1 auto; grid-template-columns: max-content minmax(0,1fr); align-items: center; min-width: 0; height: 44px; padding: 0 10px; overflow: hidden; color: #fff; background: var(--green-700); border: 1px solid #86aa9b; border-radius: 12px; box-shadow: 0 0 0 3px rgba(134,170,155,.18),0 0 14px rgba(16,47,44,.12); cursor: pointer; text-align: left; }
  .mobile-announcement-toggle strong { align-self: center; display: flex; align-items: center; height: 28px; padding-right: 10px; border-right: 1px solid currentColor; white-space: nowrap; }
  .mobile-announcement-label { padding: 0; border: 0; }
  .mobile-announcement-toggle.is-unread { animation: mobile-announcement-frame-blink 1s step-end infinite; will-change: color,background-color; }
  .mobile-announcement-toggle .mobile-announcement-ticker-viewport { min-width: 0; margin-left: 12px; padding-left: 0; overflow: hidden; border-left: 0; text-align: left; white-space: nowrap; }
  .mobile-announcement-toggle [data-announcement-ticker] { display: inline-block; min-width: max-content; padding-left: 100%; white-space: nowrap; animation: mobile-announcement-marquee 10s linear infinite; }
  .staff-quick-buttons button,
  .staff-quick-buttons button:first-child {
    color: var(--green-900);
    background: linear-gradient(145deg,#f7faf9 0%,#ccd5d2 48%,#eef2f1 100%);
    border: 1px solid #aab6b2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9),inset 0 -1px 0 rgba(16,47,44,.18),0 4px 10px rgba(16,47,44,.16);
  }
  .staff-announcement-list-wrap { position: absolute; top: 64px; left: 12px; z-index: 6; width: calc(100% - 124px); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(16,47,44,.18); }
  .staff-announcement-list-wrap[hidden] { display: none; }
  .staff-announcement-list-head { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 3px 8px 3px 10px; border-bottom: 1px solid var(--line); }
  .staff-announcement-list-head button { width: 30px; height: 30px; padding: 0; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 22px; line-height: 1; }
  .staff-announcement-list { position: static; width: 100%; max-height: 146px; margin: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border: 0; box-shadow: none; scrollbar-gutter: auto; }
  .staff-announcement-item { min-height: 36px; padding: 7px 8px; }
  @keyframes mobile-announcement-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
  @keyframes mobile-announcement-frame-blink {
    50% {
      color: var(--green-900);
      background-color: #dcefe6;
    }
  }
  .welcome { display: block; }
  .staff-hero, .staff-announcement { display: block; }
  .staff-date-card { margin-top: 24px; text-align: left; }
  .staff-announcement-content { margin-top: 14px; }
  .staff-profile { grid-template-columns: 1fr 1fr; }
  .version-summary { grid-template-columns: 1fr; }
  .version-policy-grid { grid-template-columns: 1fr; padding: 18px; }
  .release-rules { margin: 0 18px 18px; }
  .release-meta time { width: 100%; margin-left: 0; }
  .system-management-grid { grid-template-columns: 1fr; }
  .date-card { margin-top: 26px; text-align: left; }
  .summary-grid, .module-grid { grid-template-columns: 1fr; }
  .summary-grid { gap: 10px; margin-top: 28px; }
  .summary-card { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 18px 20px; }
  .summary-card strong { grid-row: 1 / 3; grid-column: 2; margin: 0; }
  .modules { margin-top: 20px; }
  .section-heading > span { display: none; }
  .section-heading { align-items: flex-end; gap: 10px; }
  .staff-punch-buttons { display: grid; grid-template-columns: repeat(4, 42px); gap: 5px; margin-left: auto; }
  .staff-punch-buttons button { display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; width: 42px; height: 42px; padding: 3px; color: var(--green-900); background: #f8faf8; border: 1px solid #9bb8b0; border-radius: 50%; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; line-height: 1.05; cursor: pointer; }
  .staff-punch-buttons button span, .staff-punch-buttons button strong { display: block; font-size: 8px; font-weight: 800; white-space: nowrap; }
  .staff-punch-buttons button strong { font-size: 9px; }
  .staff-punch-buttons button.is-punched { color: #fff; background: #050505; border-color: #050505; }
  .staff-punch-buttons button:disabled { cursor: default; opacity: 1; }
  .module-grid { gap: 10px; }
  .form-application-grid { gap: 10px; }
  .module-card { min-height: 140px; padding: 16px; }
  .module-card .module-number { position: absolute; top: 6px; left: 6px; }
  .module-card h3 { margin: 14px 0 8px; font-size: 20px; }
  .module-card p { font-size: 12px; line-height: 1.5; }
  .module-card .module-action, .module-card button { left: 16px; bottom: 12px; }
  .quick-create-panel { grid-template-columns: 1fr; padding: 20px; }
  .people-management-grid { grid-template-columns: 1fr; }
  .dashboard-footer { display: block; padding-top: 3px; padding-bottom: 3px; text-align: center; font-size: 10px; }
  .dashboard-footer span { display: block; margin: 1px; }
  .page-header { display: block; }
  .page-header .toolbar-button { width: 100%; margin-top: 24px; }
  .people-panel-heading { display: block; }
  .people-filters { display: grid; margin-top: 16px; }
  .people-filters input { width: 100%; }
  .people-detail-grid { grid-template-columns: 1fr; }
  .employee-detail-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-insurance-summary { grid-template-columns: 1fr; }
  .employee-dependent-list article { grid-template-columns: 1fr; }
  .employee-dependent-list dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-full-detail-dialog[open] { height: calc(100svh - 18px); max-height: calc(100svh - 18px); padding: 24px 18px; }
  .employee-detail-scroll { height: calc(100% - 210px); padding-right: 4px; }
  .employee-summary-dialog[open] { grid-template-rows: auto minmax(0, 1fr); }
  .employee-summary-scroll { height: auto; margin-top: 18px; }
  .employee-summary-profile { align-items: flex-start; gap: 15px; padding: 16px; }
  .employee-summary-profile .employee-detail-photo-wrap img, .employee-detail-photo-fallback { width: 78px; height: 78px; }
  .employee-detail-photo-fallback { font-size: 34px; }
  .employee-summary-profile h3 { font-size: 19px; }
  .employee-summary-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .employee-summary-card-wide { grid-column: auto; }
  .employee-summary-card { padding: 17px; }
  .employee-summary-card .employee-insurance-summary { grid-template-columns: 1fr; }
  .account-stats { gap: 8px; }
  .account-stats article { padding: 15px; }
  .form-grid, .account-create-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .leave-form-grid { grid-template-columns: 1fr; }
  .leave-wide { grid-column: auto; }
  .leave-form { padding: 2px 18px 20px; }
  .account-dialog.leave-date-dialog { width: calc(100vw - 32px); max-width: 480px; padding: 18px 12px; overflow-x: hidden; }
  .leave-date-dialog .leave-calendar-weekdays, .leave-date-dialog .leave-calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; }
  .leave-date-dialog .leave-calendar-grid button, .leave-date-dialog .leave-calendar-blank { min-width: 0; padding: 0; }
  .leave-date-dialog .dialog-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .leave-date-dialog .dialog-actions button { width: 100%; min-width: 0; padding: 0 5px; font-size: 12px; white-space: nowrap; }
  .leave-range-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .leave-calendar-grid button, .leave-calendar-blank { min-height: 44px; }
  .account-dialog { padding: 28px 20px; }
  .employee-form-grid { grid-template-columns: 1fr; }
  .employee-form-grid .wide-field, .employee-form-grid .checkbox-line { grid-column: auto; }
  .employee-form-grid-new, .employee-contact-grid, .employee-employment-grid, .employee-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-details div { grid-template-columns: 110px 1fr; }
  .login-status-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-dialog[open] {
    display: block;
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
    overflow-y: auto;
  }
  .detail-dialog .login-history-section { display: block; min-height: auto; }
  .detail-dialog .login-history-table-wrap { min-height: 220px; max-height: 52svh; overflow: auto; }
  .personal-record-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; overflow: hidden; }
  .personal-record-tabs a { box-sizing: border-box; gap: 1px; min-width: 0; min-height: 0; height: 34px; padding: 2px 4px; border-right: 1px solid var(--line); border-bottom: 0; overflow: hidden; }
  .personal-record-tabs a:last-child { border-right: 0; }
  .personal-record-tabs a span { font-size: 12px; }
  .personal-record-tabs a strong { max-width: 100%; overflow: hidden; font-size: clamp(13px, 2.35vw, 16px); letter-spacing: -.04em; line-height: 1.1; text-overflow: clip; white-space: nowrap; }
}
@media (max-width: 430px) {
  .employee-form-grid-new, .employee-contact-grid, .employee-employment-grid, .employee-account-grid { grid-template-columns: 1fr; }
  .employee-related-actions { width: 100%; }
  .employee-related-dialog { width: calc(100% - 12px); height: calc(100svh - 12px); padding: 18px 10px 10px; }
  .employee-related-heading h2 { font-size: 22px; }
  .embedded-module-page .dashboard-main { padding: 12px 8px; }
  .embedded-module-page .dialog-heading:has(.maintenance-selected-employee), .embedded-module-page .page-header:has(.maintenance-selected-employee) { min-height: 0; padding-right: 0; }
  .maintenance-selected-employee { position: static; min-width: 0; margin-top: 16px; }
  .employee-maintenance-switcher, .employee-maintenance-tabs { grid-template-columns: 1fr; }
  .employee-maintenance-subtabs { display: grid; grid-template-columns: 1fr; }
  .employee-maintenance-subtabs button { min-width: 0; }
  .employee-maintenance-frame { min-height: 320px; }
  .employee-photo-control { align-items: flex-start; flex-direction: column; }
  .employee-photo-copy { width: 100%; }
  .insurance-form { grid-template-columns: 1fr; }
  .insurance-actual-amounts { grid-template-columns: 1fr; }
  .insurance-grade-preview.has-current-summary { grid-template-columns: 1fr; row-gap: 14px; }
  .insurance-current-summary { padding-top: 14px; padding-left: 0; border-top: 1px solid currentColor; border-left: 0; }
  .insurance-form .dialog-heading, .insurance-form .dialog-actions { grid-column: auto; }
  .insurance-header-actions, .submission-filters { align-items: stretch; flex-direction: column; }
  .submission-filters label, .dependent-filters select[name="employee_id"], .dependent-filters select[name="status"], .submission-record-filters input[type="date"], .submission-record-filters select, .submission-filters .secondary-button { width: 100%; }
  .submission-create-grid, .submission-employee-grid { grid-template-columns: 1fr; }
  .personal-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personal-profile-grid article { min-height: 72px; padding: 12px; }
  .personal-profile-grid strong { margin-top: 7px; font-size: 15px; }
  .login-status-details { grid-template-columns: 1fr; }
  .login-status-details div { min-height: 0; }
}
@media (max-width: 1100px), (max-device-width: 1400px), (hover: none) and (pointer: coarse) {
  .personal-center-main, .forms-main, .part-lookup-main, .duty-main { position: relative; padding-top: 18px; }
  .personal-center-main .back-link, .forms-main .back-link, .part-lookup-main .back-link, .duty-main .back-link { position: absolute; top: 22px; right: 0; display: block; width: max-content; margin-left: auto; line-height: 1.2; text-align: right; }
  .personal-center-main .page-header .eyebrow,
  .personal-center-main .page-header > div > p:last-child,
  .forms-main .page-header .eyebrow,
  .forms-main .page-header > div > p:last-child,
  .duty-main .page-header .eyebrow,
  .duty-main .page-header > div > p:last-child { display: none; }
  .personal-center-main .page-header h1, .forms-main .page-header h1, .part-lookup-main .page-header h1, .duty-main .page-header h1 { margin-top: 0; line-height: 1.2; }
  .staff-announcement-dialog { overflow-y: auto; }
  .announcement-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 14px; }
  .announcement-detail dl div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; min-width: 0; min-height: 34px; }
  .announcement-detail dt, .announcement-detail dd { min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
  .announcement-detail-content { box-sizing: border-box; width: 100%; min-height: 180px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .staff-announcement-heading { display: flex; align-items: center; justify-content: space-between; }
  .staff-quick-buttons { display: flex; }
  .staff-duty-dialog { padding: 14px 8px; overflow-y: hidden; }
  .staff-duty-calendar-heading { padding-top: 22px; }
  .staff-duty-calendar-heading > span { top: 0; left: 6px; }
  .staff-duty-month-row { gap: 5px; }
  .staff-duty-calendar-heading h2 { font-size: 24px; }
  .staff-duty-month-nav { width: 34px; height: 34px; font-size: 20px; }
  .staff-duty-weekdays strong { padding: 7px 1px; font-size: 9px; }
  .staff-duty-blank,.staff-duty-day { height: clamp(72px, calc((100svh - 190px) / 6), 96px); min-height: 0; padding: 4px; }
  .staff-duty-day.is-mine { box-shadow:inset 0 0 0 1.5px #74aa9c; }
  .staff-duty-day > strong { font-size: 15px; }
  .staff-duty-day > div { gap: 2px; margin-top: 6px; }
  .staff-duty-day > div span { padding: 2px 3px; font-size: 8px; }
  .staff-module-grid > :nth-child(1) { order: 1; }
  .staff-module-grid .staff-forms-card { order: 2; }
  .staff-module-grid .staff-announcement-card { order: 3; }
  .staff-module-grid .staff-part-lookup-card { order: 4; }
  .module-number[data-mobile-number] { font-size: 0; }
  .module-number[data-mobile-number]::after { content: attr(data-mobile-number); font-size: 13px; }
  .part-lookup-main { display: flex; flex-direction: column; height: calc(100svh - 96px); padding-bottom: 0; overflow: hidden; }
  .part-lookup-main .page-header { flex: 0 0 auto; margin-bottom: 0; }
  .part-lookup-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; max-height: none; margin-top: 12px; overflow: hidden; }
  .part-lookup-panel .data-panel-heading { position: static; display: flex; flex: 0 0 80px; align-items: center; height: 80px; padding: 15px 24px; background: var(--mint); }
  .part-lookup-panel .data-panel-heading h2 { display: none; }
  .part-lookup-panel .account-table-wrap { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .part-lookup-search { width: 100%; }
  .part-lookup-table { width: 100%; min-width: 0; table-layout: fixed; }
  .part-lookup-table thead { display: none; }
  .part-lookup-table,.part-lookup-table tbody { display: block; }
  .part-lookup-table tr[data-part-row] { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 14px; row-gap: 8px; height: 65px; padding: 10px; overflow: hidden; border: 1px solid var(--ink); }
  .part-lookup-table tr[data-part-row] + tr[data-part-row] { margin-top: -1px; }
  .part-lookup-table tr[data-part-row] td { width: auto; padding: 0; border-top: 0; border-bottom: 0; overflow-wrap: anywhere; word-break: break-word; }
  .part-lookup-table tr[data-part-row] td:first-child { position: relative; grid-column: 1; grid-row: 1 / 3; overflow: hidden; }
  .part-lookup-table tr[data-part-row] td:first-child::after { content: "CiChen"; position: absolute; top: 50%; left: 50%; color: rgba(16,47,44,.32); font-size: 21px; font-weight: 800; pointer-events: none; transform: translate(-50%,-50%) rotate(-24deg); white-space: nowrap; }
  .part-lookup-table tr[data-part-row] td:nth-child(2) { align-self: end; grid-column: 2; grid-row: 1; line-height: 1.2; }
  .part-lookup-table tr[data-part-row] td:nth-child(3) { align-self: start; grid-column: 2; grid-row: 2; color: var(--muted); line-height: 1.2; }
  .part-lookup-table tr[data-part-row] td:nth-child(3) strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .part-lookup-number-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-bottom: 3px; border-bottom: 1px solid var(--ink); }
  .part-lookup-stock { display: inline-block; padding: 3px 10px 3px 7px; color: var(--green-700); background: #e3efeb; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
  .part-lookup-table tr[data-part-empty] td { display: block; width: 100%; }
  .part-lookup-thumbnail { width: 42px; height: 42px; }
  .personal-record-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, 1vw, 6px); width: 100%; overflow: visible; background: transparent; border: 0; }
  .personal-record-tabs a:nth-child(6) { grid-column: 1; grid-row: 2; }
  .personal-record-tabs a { box-sizing: border-box; grid-template-rows: auto 1fr; gap: 1px; min-width: 0; min-height: 0; height: clamp(50px, 7vw, 54px); padding: 6px 5px; overflow: hidden; border: 1px solid var(--line); border-radius: clamp(4px, .8vw, 6px); box-shadow: 0 2px 8px rgba(16,47,44,.08); }
  .personal-record-tabs a:last-child { border-right: 1px solid var(--line); }
  .personal-record-tabs a span { font-size: 12px; line-height: 1; }
  .personal-record-tabs a strong { align-self: end; max-width: 100%; overflow: hidden; font-size: clamp(13px, 2.35vw, 16px); letter-spacing: -.04em; line-height: 1.1; text-overflow: clip; white-space: nowrap; }
  .personal-record-heading { align-items: flex-start; flex-direction: row; gap: 8px; }
  .personal-record-heading > div { min-width: 0; }
  .personal-month-filter { flex: 0 0 148px; flex-direction: column; align-items: stretch; gap: 5px; width: 148px; min-width: 148px; transform: translateX(4px); }
  .personal-month-filter > button {
    width: 148px;
    max-width: none;
    min-height: 30px;
    height: 30px;
    padding-top: 3px;
    padding-left: 4px;
    padding-bottom: 3px;
    overflow: visible;
    font-size: 12px;
  }
  .personal-month-clear { right: 3px; width: 24px; height: 24px; font-size: 18px; }
  .personal-month-filter > .personal-month-clear { top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.staff-leave-panel { margin-top: 34px; scroll-margin-top: 24px; }
.staff-leave-panel[hidden] { display: none; }
.staff-leave-panel input[readonly] { background: #f1f5f2; color: var(--ink); cursor: not-allowed; }
.staff-leave-dialog { width: min(1180px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; }
.form-application-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); gap: 18px; margin-top: 28px; }
.form-application-card { width: 100%; }
.form-application-card button { inset: 0; z-index: 2; display: flex; width: 100%; height: 100%; padding: 26px; align-items: flex-end; justify-content: flex-start; color: var(--teal); font-weight: 700; text-align: left; cursor: pointer; }
.form-application-card:has(button:focus-visible) { outline: 3px solid rgba(11,105,88,.35); outline-offset: 3px; }

/* Company rules and system manual */
.rules-main { width: min(1080px, calc(100% - 48px)); }
.manual-section { margin-top: 30px; }
.manual-book, .manual-chapter { background: var(--paper); border: 1px solid var(--line); }
.manual-book > summary, .manual-chapter > summary { display: flex; align-items: center; cursor: pointer; list-style: none; }
.manual-book > summary::-webkit-details-marker, .manual-chapter > summary::-webkit-details-marker { display: none; }
.manual-book > summary { gap: 18px; min-height: 96px; padding: 22px 26px; }
.manual-book > summary > span:nth-child(2) { flex: 1; }
.manual-book > summary strong, .manual-book > summary small { display: block; }
.manual-book > summary strong { color: var(--green-900); font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 25px; }
.manual-book > summary small { margin-top: 6px; color: var(--muted); font-size: 13px; }
.manual-book-icon { display: grid; width: 48px; height: 48px; place-items: center; background: var(--green-900); color: white; font-size: 0; }
.manual-book-icon::before { content: ""; width: 20px; height: 25px; border: 2px solid currentColor; border-radius: 1px; box-shadow: inset 5px 0 0 rgba(255,255,255,.16); }
.manual-book > summary > i, .manual-chapter > summary > i { width: 12px; height: 12px; border-right: 2px solid var(--green-700); border-bottom: 2px solid var(--green-700); transform: rotate(45deg); transition: transform .16s ease; }
.manual-book[open] > summary > i, .manual-chapter[open] > summary > i { transform: rotate(225deg); }
.manual-chapter-list { padding: 0 26px 26px; }
.manual-chapter { border-width: 1px 0 0; }
.manual-chapter > summary { gap: 18px; min-height: 70px; padding: 14px 6px; }
.manual-chapter > summary span { color: #8b9793; font: 600 13px Georgia, serif; letter-spacing: .08em; }
.manual-chapter > summary strong { flex: 1; color: var(--ink); font-size: 17px; }
.manual-chapter > div { padding: 0 42px 22px; }
.manual-content { display: grid; gap: 10px; }
.manual-subsection { background: #f3f6f4; border-left: 3px solid var(--green-700); }
.manual-subsection > summary { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 12px 16px; cursor: pointer; list-style: none; }
.manual-subsection > summary::-webkit-details-marker { display: none; }
.manual-subsection > summary strong { flex: 1; color: var(--green-900); font-size: 15px; }
.manual-subsection > summary small { color: var(--muted); font-size: 11px; }
.manual-subsection > summary i { width: 9px; height: 9px; border-right: 2px solid var(--green-700); border-bottom: 2px solid var(--green-700); transform: rotate(45deg); }
.manual-subsection[open] > summary i { transform: rotate(225deg); }
.manual-subsection > div { padding: 2px 18px 18px; }
.manual-content ol, .manual-content ul { margin: 0; padding-left: 21px; color: var(--muted); line-height: 1.75; }
.manual-content li + li { margin-top: 9px; }
.manual-content li strong, .manual-content li span { display: block; }
.manual-content li strong { color: var(--ink); font-size: 13px; }
.manual-content li span { margin-top: 2px; }
.manual-image-button { display: grid; width: min(100%,520px); margin: 18px 0 0; padding: 0; overflow: hidden; background: white; border: 1px solid var(--line); color: var(--green-700); cursor: zoom-in; text-align: left; }
.manual-image-button img { display: block; width: 100%; height: auto; }
.manual-image-button span { padding: 10px 13px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.manual-image-dialog { width: min(920px,calc(100% - 32px)); max-width: none; padding: 0; background: var(--paper); border: 1px solid var(--line); }
.manual-image-dialog::backdrop { background: rgba(7,31,28,.72); }
.manual-image-dialog form { position: absolute; top: 10px; right: 10px; z-index: 2; }
.manual-image-dialog form button { display: grid; width: 42px; height: 42px; place-items: center; background: white; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 28px; cursor: pointer; }
.manual-image-dialog figure { margin: 0; padding: 26px; }
.manual-image-dialog img { display: block; width: 100%; max-height: 72vh; object-fit: contain; }
.manual-image-dialog figcaption { margin-top: 14px; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .rules-main { width: min(100% - 24px, 1080px); }
  .rules-main .back-link { position: absolute; top: 22px; right: 0; }
  .rules-main .page-header .eyebrow, .rules-main .page-header > div > p:last-child { display: none; }
  .manual-section { margin-top: 22px; }
  .manual-book > summary { min-height: 82px; padding: 17px 16px; }
  .manual-book-icon { width: 42px; height: 42px; }
  .manual-book > summary strong { font-size: 20px; }
  .manual-book > summary small { font-size: 11px; }
  .manual-chapter-list { padding: 0 16px 16px; }
  .manual-chapter > summary { gap: 12px; min-height: 62px; padding: 12px 2px; }
  .manual-chapter > summary strong { font-size: 15px; }
  .manual-chapter > div { padding: 0 30px 16px; }
  .manual-subsection > summary { padding: 11px 12px; }
  .manual-subsection > summary small { display: none; }
  .manual-subsection > div { padding: 2px 13px 15px; }
  .manual-image-dialog figure { padding: 16px; }
}

.duty-main { min-height: calc(100svh - 130px); }
.duty-heading { align-items: center; }
.duty-period-state { flex: 0 0 auto; padding: 9px 13px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 800; }
.duty-period-state.is-open { color: #176349; background: #e6f5ed; border-color: #9fcdb9; }
.duty-period-state.is-locked { color: #7d3b35; background: #fff0ed; border-color: #e4b4ad; }
.duty-period-state.is-unavailable { color: #5e6865; background: #eef1ef; border-color: #cbd3d0; }
.duty-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; margin-top: 30px; }
.duty-calendar-card { padding: clamp(18px, 3vw, 30px); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 16px 42px rgba(16,47,44,.07); }
.duty-calendar-toolbar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 14px; }
.duty-calendar-toolbar > a { display: grid; place-items: center; width: 46px; height: 42px; color: var(--green-700); background: #f1f5f2; border: 1px solid var(--line); text-decoration: none; font-size: 19px; font-weight: 800; }
.duty-calendar-toolbar > div { text-align: center; }
.duty-calendar-toolbar span, .duty-calendar-toolbar strong { display: block; }
.duty-calendar-toolbar span { color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.duty-toolbar-state { display: none !important; }
.duty-calendar-toolbar strong { margin-top: 3px; font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 23px; }
.duty-weekdays, .duty-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.duty-weekdays { margin-top: 24px; color: var(--muted); border: 1px solid var(--line); border-bottom: 0; background: #eef3f0; text-align: center; font-size: 11px; font-weight: 800; }
.duty-weekdays span { padding: 9px 3px; border-right: 1px solid var(--line); }
.duty-weekdays span:last-child { border-right: 0; }
.duty-calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.duty-calendar-blank, .duty-day { min-width: 0; min-height: 126px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.duty-calendar-blank { background: #f4f6f4; }
.duty-day { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 10px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; overflow: hidden; }
.duty-day:hover:not(:disabled) { z-index: 1; box-shadow: inset 0 0 0 2px var(--green-500); }
.duty-day:focus-visible { z-index: 2; outline: 3px solid rgba(61,140,127,.34); outline-offset: -3px; }
.duty-day:disabled { cursor: default; }
.duty-day > strong { font-family: Georgia, serif; font-size: 17px; font-weight: 600; }
.duty-day.is-holiday > strong { color: #bd443b; }
.duty-day.is-today::after { content: "今天"; position: absolute; top: 9px; right: 8px; padding: 2px 5px; color: #775213; background: #f5e4c4; font-size: 8px; font-weight: 800; }
.duty-day.is-mine { background: #eef7f3; }
.duty-holiday-name { min-height: 14px; color: #bd443b; font-size: 10px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.duty-day-names { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.duty-day-names em { max-width: 100%; padding: 3px 6px; color: #31514a; background: #e4ece8; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.duty-day-names em.is-me { color: #fff; background: var(--green-700); }
.duty-day-names small { color: #9aa5a1; font-size: 9px; }
.duty-calendar-message { min-height: 20px; margin: 14px 0 0; color: #176349; font-size: 12px; font-weight: 700; }
.duty-calendar-message.is-error { color: #a1372f; }
.duty-records-table { min-width: 1040px; }
.duty-status-draft { color: #775213; background: #f7e8ca; }
.duty-status-finalized { color: #176349; background: #dff1e8; }
.duty-sidebar { display: grid; gap: 12px; }
.duty-sidebar article, .duty-help { padding: 20px; background: var(--paper); border: 1px solid var(--line); }
.duty-sidebar article span, .duty-sidebar article strong, .duty-sidebar article small { display: block; }
.duty-sidebar article span { color: var(--muted); font-size: 11px; }
.duty-sidebar article strong { margin-top: 8px; color: var(--green-900); font-size: 17px; overflow-wrap: anywhere; }
.duty-sidebar .duty-count-breakdown { display: grid; gap: 3px; }
.duty-sidebar .duty-count-breakdown b { display: block; font: inherit; }
.duty-sidebar article small { margin-top: 5px; color: #899590; font-size: 10px; }
.duty-help { color: var(--muted); }
.duty-help h2 { margin: 0; color: var(--green-900); font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 19px; }
.duty-help ol { margin: 13px 0 0; padding-left: 20px; font-size: 12px; line-height: 1.9; }
.attendance-record-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; background: var(--paper); border: 1px solid var(--line); }
.attendance-record-tab { min-height: 112px; padding: 22px 26px; color: var(--muted); background: transparent; border: 0; border-right: 1px solid var(--line); text-align: left; cursor: pointer; }
.attendance-record-tab:last-child { border-right: 0; }
.attendance-record-tab > span, .attendance-record-tab > strong, .attendance-record-tab > small { display: block; }
.attendance-record-tab > span { margin-bottom: 12px; color: var(--gold); font-size: 12px; font-weight: 800; line-height: 1; }
.attendance-record-tab > strong { color: var(--ink); font-family: "Noto Serif TC", "PMingLiU", serif; font-size: 25px; line-height: 1.3; }
.attendance-record-tab > small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.attendance-record-tab[aria-selected="true"] { color: #fff; background: var(--green-900); }
.attendance-record-tab[aria-selected="true"] > span, .attendance-record-tab[aria-selected="true"] > strong, .attendance-record-tab[aria-selected="true"] > small { color: #fff; }
.attendance-record-tab:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(61,140,127,.38); outline-offset: 3px; }
.attendance-record-panel { margin-top: 22px; }
.attendance-record-panel[hidden] { display: none; }
.attendance-record-panel .account-stats { margin-top: 0; }
.attendance-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.attendance-filter-bar { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; margin-left: auto; }
.attendance-search-field { position: relative; display: block; margin: 0; }
.attendance-search-field input { box-sizing: border-box; width: min(320px, 32vw); height: 54px; padding: 11px 44px 11px 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; font: inherit; }
.attendance-search-field input::-webkit-search-cancel-button { display: none; }
.attendance-date-filter { position: relative; }
@media (min-width: 701px) {
  #attendance-date-range-dialog { padding-top: 72px; }
}
.attendance-date-filter > [data-filter-date-button] { box-sizing: border-box; width: 350px; height: 54px; padding: 11px 50px 11px 16px; overflow: hidden; color: var(--muted); background: #fff; border: 1px solid var(--line); font: 700 13px/1.4 "Noto Sans TC", "Microsoft JhengHei", sans-serif; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.attendance-date-filter > [data-filter-date-button].has-value { color: var(--ink); }
.attendance-filter-clear-button { position: absolute; z-index: 1; top: 50%; right: 7px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--muted); background: transparent; border: 0; font: 700 24px/1 "Noto Sans TC", "Microsoft JhengHei", sans-serif; transform: translateY(-50%); cursor: pointer; }
.attendance-filter-clear-button[hidden] { display: none; }
.attendance-search-field input:focus, .attendance-date-filter > [data-filter-date-button]:focus-visible { outline: 3px solid rgba(61,140,127,.28); outline-offset: 2px; }
.attendance-status-filter { box-sizing: border-box; min-width: 138px; height: 54px; padding: 11px 34px 11px 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; font: 700 13px/1.4 "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.punch-records-table { min-width: 880px; }
.punch-status-complete { color: #176349; background: #dff1e8; }
.punch-status-leave { color: #185f70; background: #dceff3; }
.punch-status-in-progress { color:#7b5608; background:#fff0c7; }
.punch-status-missing-in, .punch-status-missing-out, .punch-status-invalid { color: #91392f; background: #f7dfda; }
.announcement-editor, .announcement-list { margin-top: 24px; }
.announcement-form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px 22px; }
.announcement-form-grid label { margin: 0; }
.announcement-form-grid input:not([type="checkbox"]), .announcement-form-grid textarea { box-sizing: border-box; width: 100%; margin-top: 8px; padding: 12px 14px; color: var(--ink); background: #fbfcf9; border: 1px solid var(--line); border-radius: 0; font: inherit; }
.announcement-form-grid input:not([type="checkbox"]) { min-height: 48px; }
.announcement-form-grid textarea { resize: vertical; line-height: 1.7; }
.announcement-content-field { grid-column: 1 / -1; }
.announcement-options { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.announcement-options label { display: inline-flex; align-items: center; gap: 6px; }
.announcement-deadline-field { grid-column: 1 / -1; }
.announcement-deadline-field .leave-date-range-trigger { display: block; font: inherit; }
.announcement-expired-display { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.announcement-expired-display input, #announcement-expired { width: 18px; height: 18px; accent-color: var(--green-700); }
.announcement-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.announcement-actions form { margin: 0; }
.announcement-actions .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 13px; white-space: nowrap; }
@media (max-width: 960px) { .duty-layout { grid-template-columns: 1fr; } .duty-sidebar { grid-template-columns: repeat(3, 1fr); } .duty-help { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .personal-record-heading { align-items: flex-start; flex-direction: row; gap: 8px; }
  .personal-record-heading > div { min-width: 0; }
  .personal-duty-record-heading { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .personal-record-controls { box-sizing: border-box; flex: 0 0 148px; flex-direction: column; align-items: stretch; width: 148px; min-width: 148px; gap: 5px; }
  .personal-duty-record-heading .personal-month-filter { order: 1; }
  .personal-duty-record-heading .personal-duty-type-summary { order: 2; }
  .personal-duty-type-summary { box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: 148px; }
  .personal-duty-type-summary > span { min-width: 0; min-height: 42px; padding: 0.5px 5px; }
  .personal-duty-type-summary small { font-size: 0; }
  .personal-duty-type-summary small::after { font-size: 12px; }
  .personal-duty-type-summary strong { font-size: 12px; }
  .personal-month-filter { box-sizing: border-box; flex: none; width: 148px; min-width: 148px; transform: translateX(4px); }
  .personal-duty-record-heading .personal-month-filter { flex: none; transform: none; }
  .personal-month-filter > button {
    width: 148px;
    max-width: none;
    min-height: 30px;
    height: 30px;
    padding-top: 3px;
    padding-left: 4px;
    padding-bottom: 3px;
    overflow: visible;
    font-size: 12px;
  }
  .personal-month-clear { right: 3px; width: 24px; height: 24px; font-size: 18px; }
  .personal-month-filter > .personal-month-clear { top: 15px; }
  .personal-leave-status-filter { position: relative; display: block; width: 148px; }
  .personal-leave-status-filter select { box-sizing: border-box; width: 148px; height: 30px; padding: 3px 28px 3px 7px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); font: inherit; font-size: 12px; }
  .personal-leave-status-filter button { position: absolute; top: 50%; right: 3px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; color: var(--muted); background: var(--paper); border: 0; transform: translateY(-50%); font-size: 18px; cursor: pointer; }
  .personal-leave-status-filter button[hidden] { display: none; }
  .personal-month-dialog { padding: 18px; }
  .attendance-record-tabs { grid-template-columns: 1fr; }
  .personal-duty-table { min-width: 480px; font-size: 11px; }
  .personal-punch-table { min-width: 420px; font-size: 11px; }
  .personal-duty-table th { padding: 6px 7px; }
  .personal-duty-table td { padding: 7px; vertical-align: middle; }
  .personal-record-tabs ~ .data-panel .account-table:has(th:nth-child(5):last-child) { width: auto; min-width: 0; table-layout: auto; font-size: 11px; }
  .personal-record-tabs ~ .data-panel .account-table:has(th:nth-child(5):last-child) th { padding: 4px 2px; }
  .personal-record-tabs ~ .data-panel .account-table:has(th:nth-child(5):last-child) td { padding: 4px 2px; }
  .personal-leave-table td:nth-child(4) { overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
  .personal-leave-table th:nth-child(5), .personal-leave-table td:nth-child(5) { white-space: nowrap; }
  .form-application-grid.employee-center-grid, .form-application-grid { gap: 10px; }
  .attendance-record-tab { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--line); }
  .attendance-record-tab:last-child { border-bottom: 0; }
  .attendance-record-tab > small { display: none; }
  .attendance-panel-heading { display: block; }
  .attendance-filter-bar { display: grid; grid-template-columns: 1fr; margin: 16px 0 0; }
  .attendance-search-field input, .attendance-date-filter > [data-filter-date-button] { width: 100%; }
  .attendance-status-filter { width: 100%; }
  .punch-table-wrap { overflow: visible; }
  .punch-records-table { display: block; width: 100%; min-width: 0; background: transparent; }
  .punch-records-table thead { display: none; }
  .punch-records-table tbody { display: grid; gap: 10px; }
  .punch-records-table tbody tr[data-record-row] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 12px rgba(16,47,44,.06); }
  .punch-records-table tbody tr[data-record-row][hidden] { display: none; }
  .punch-records-table tbody tr[data-record-row] td { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid #e1e9e5; white-space: normal; }
  .punch-records-table tbody tr[data-record-row] td:nth-last-child(-n+2) { border-bottom: 0; }
  .punch-records-table tbody tr[data-record-row] td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; }
  .punch-records-table tbody tr[data-record-row] td:nth-child(1), .punch-records-table tbody tr[data-record-row] td:nth-child(2) { grid-column: 1 / -1; }
  .punch-records-table tbody tr[data-record-row] td strong { min-width: 0; overflow-wrap: anywhere; }
  .punch-empty-row { display: table-row; }
  .announcement-form-grid { grid-template-columns: 1fr; }
  .announcement-content-field { grid-column: auto; }
  .duty-heading > .duty-period-state { display: none; }
  .duty-calendar-toolbar .duty-toolbar-year { display: none; }
  .duty-calendar-toolbar .duty-toolbar-state { display: inline-block !important; width: max-content; margin: 0 auto 3px; padding: 4px 9px; letter-spacing: 0; }
  .duty-calendar-card { width: 100%; padding: 8px; overflow: hidden; }
  .duty-weekdays, .duty-calendar-grid { width: 100%; min-width: 0; }
  .duty-weekdays { font-size: 9px; }
  .duty-weekdays span { min-width: 0; padding: 7px 1px; }
  .duty-calendar-blank, .duty-day { min-width: 0; min-height: clamp(78px, 23vw, 104px); }
  .duty-day { gap: 4px; padding: 5px 4px; }
  .duty-day > strong { font-size: 14px; }
  .duty-day.is-today::after { top: 4px; right: 3px; padding: 1px 2px; font-size: 7px; }
  .duty-holiday-name { min-height: 11px; font-size: 8px; line-height: 1.2; }
  .duty-day-names { gap: 2px; }
  .duty-day-names em { padding: 2px 3px; font-size: 8px; }
  .duty-day-names small { font-size: 8px; }
  .duty-sidebar { grid-template-columns: 1fr; }
  .duty-help { grid-column: auto; }
  .account-table th { padding: 13px 16px; }
  .account-table th, .account-table td { vertical-align: middle; }
  .account-table td { padding: 16px; }
  .staff-page .personal-record-tabs ~ .data-panel .account-table { width: auto !important; min-width: 100% !important; table-layout: auto !important; }
  .staff-page .personal-record-tabs ~ .data-panel .account-table th { padding: 13px 4px !important; white-space: nowrap; }
  .staff-page .personal-record-tabs ~ .data-panel .account-table td { padding: 16px 4px !important; white-space: nowrap; }
  .staff-page .personal-record-tabs ~ .data-panel .personal-duty-table td { padding: 6px 4px !important; }
  .personal-date-line { display: block; }
  .personal-record-tabs ~ .data-panel .account-table th:first-child, .personal-record-tabs ~ .data-panel .account-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); box-shadow: 1px 0 0 var(--line); }
  .personal-record-tabs ~ .data-panel .account-table th:first-child { z-index: 2; background: #f0f4f1; }
  .personal-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    padding: 0;
    overflow: hidden;
    background: #f2f3f2;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .personal-profile-grid article {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 2px;
    min-width: 0;
    min-height: 68px;
    padding: 5px 11px;
    background: #f2f3f2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .personal-profile-grid article:nth-child(2n) { border-right: 0; }
  .personal-profile-grid article:nth-last-child(-n + 2) { border-bottom: 0; }
  .personal-profile-grid article:first-child { border-radius: 11px 0 0 0; }
  .personal-profile-grid article:nth-child(2) { border-radius: 0 11px 0 0; }
  .personal-profile-grid article:nth-last-child(2) { border-radius: 0 0 0 11px; }
  .personal-profile-grid article:last-child { border-radius: 0 0 11px 0; }
  .personal-profile-grid .personal-leave-summary { grid-template-columns: minmax(55px, 1fr) max-content minmax(55px, 1fr); background: #dedfdf; }
  .personal-profile-grid .personal-leave-summary article { min-height: 68px; padding: 5px 6px; background: #dedfdf; border: 0; border-radius: 0; }
  .personal-profile-grid .personal-leave-summary strong { min-height: 0; padding: 0; background: transparent; border: 0; border-radius: 0; }
  .personal-profile-grid .personal-leave-summary small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
  .personal-profile-grid .personal-leave-summary article:nth-child(2) strong,
  .personal-profile-grid .personal-leave-summary article:nth-child(2) small { white-space: nowrap; overflow-wrap: normal; }
  .personal-profile-grid .personal-leave-summary article:nth-child(2) strong { font-size: 12px; }
  .personal-profile-grid span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
  }
  .personal-profile-grid strong {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    margin-top: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 14px;
  }
}
.inventory-toolbar{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end}.inventory-toolbar .toolbar-button{white-space:nowrap}@media(max-width:760px){.inventory-toolbar{width:100%;justify-content:stretch}.inventory-toolbar .toolbar-button{flex:1 1 160px}}
.overtime-time-picker { position: relative; display: block; }
.overtime-time-picker > input[type="text"] { width: 100%; }
.overtime-time-native { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .overtime-time-picker > input[type="text"] { display: none; }
  .overtime-time-native { position: static; inset: auto; width: 100%; height: auto; opacity: 1; color: var(--ink); cursor: pointer; }
}
.modules > .section-heading { flex-wrap: nowrap; }
.staff-punch-buttons { display: flex !important; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.staff-punch-buttons button { display: grid; place-items: center; box-sizing: border-box; width: 56px; height: 56px; padding: 5px; color: var(--green-900); background: #fff; border: 2px solid #d4e1dd; border-radius: 50%; font-family: "Noto Sans TC","Microsoft JhengHei",sans-serif; cursor: pointer; box-shadow: 0 4px 9px rgba(16,47,44,.13); }
.staff-punch-buttons button strong { font-size: 10px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.staff-punch-buttons button.is-active { border-color: #8eada6; }
.staff-punch-buttons button[hidden] { display: none !important; }
.staff-punch-buttons button:disabled { color: #78908b; background: #cad8d4; border-color: #b7c9c4; cursor: default; opacity: .62; box-shadow: none; }
@media (max-width: 760px) {
  .staff-announcement { height: 200px; }
  .modules > .section-heading { align-items: center; gap: 8px; }
  .modules > .section-heading > div:first-child { flex: 0 0 auto; }
  .staff-punch-buttons { gap: 4px; }
  .staff-punch-buttons button { width: 56px; height: 56px; padding: 4px; }
  .staff-punch-buttons button strong { font-size: 10px; }
  .smart-punch-panel { position: absolute; right: 17px; bottom: 13px; z-index: 5; display: grid; grid-template-rows: 34px 1fr; gap: 7px; width: 176px; height: 194px; margin: 0; padding: 9px; color: #fff; background: #175c55; border: 2px solid #dbe8e4; border-radius: 22px; box-shadow: 0 11px 22px rgba(18,59,53,.24),0 3px 0 #789d96; }
  .smart-punch-clock { text-align: center; }
  .smart-punch-clock .desktop-punch-time,.smart-punch-clock strong { display: none; }
  .smart-punch-clock .mobile-punch-date,.smart-punch-clock .mobile-punch-time { display: block; margin: 0; opacity: 1; color: #d5e4e1; font-weight: 700; line-height: 1.25; }
  .smart-punch-clock .mobile-punch-date { font-size: 10px; }
  .smart-punch-clock .mobile-punch-time { color: #fff; font-size: 14px; letter-spacing: .06em; }
  .smart-punch-actions { display: grid; grid-template-columns: repeat(2, 70px); grid-template-rows: repeat(2, 70px); justify-content: center; gap: 7px; }
  .smart-punch-actions button { width: 70px; height: 70px; padding: 6px; color: #103c38; background: #fff; border: 3px solid #dbe8e4; font-size: 12px; box-shadow: 0 4px 7px rgba(3,31,28,.2); }
  .smart-punch-actions button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 4px rgba(3,31,28,.2); }
  .smart-punch-actions button:disabled { color: #82938f; background: #ccd7d3; border-color: #b9c8c4; box-shadow: none; }
}
.smart-punch-panel[hidden] { display: none !important; }
.smart-punch-panel:not(.is-ready) { visibility: hidden; }
.punch-choice-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.punch-choice-actions button { min-height: 64px; font-size: 18px; font-weight: 800; }
.prework-choice-dialog { width:min(780px,calc(100% - 28px)); }
.prework-choice-body { display:grid; grid-template-columns:minmax(0,1fr) 210px; align-items:stretch; gap:22px; margin-top:24px; }
.prework-choice-body .prework-reason-field { margin-top:0; }
.prework-reason-field .overtime-reason-heading > label { display:block; margin-top:0; }
.prework-reason-field textarea { height:150px; resize:none; }
.prework-choice-actions { display:grid; grid-template-columns:1fr; grid-template-rows:1fr 4fr; gap:12px; height:150px; margin:32px 0 0; }
.prework-choice-actions button { box-sizing:border-box; width:100%; min-height:0; padding:0 6px; overflow:hidden; font-size:15px; line-height:1; }
.prework-choice-actions button[aria-pressed="true"] { color:#fff; background:#17665d; border-color:#17665d; box-shadow:0 0 0 4px rgba(23,102,93,.14); }
.prework-focus-target:focus { outline:3px solid rgba(23,102,93,.24); outline-offset:3px; }
.prework-reason-field textarea:disabled { color:#7d8986; background:#eef1ef; cursor:not-allowed; }
.prework-confirm-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.prework-confirm-actions button { box-sizing:border-box; width:100%; min-width:0; min-height:54px; }
.punch-dialog-datetime { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:18px 0 4px; padding:12px 14px; color:#174c47; background:#edf4f2; border:1px solid #c8dad6; font-weight:800; }
.overtime-start-dialog { width:min(610px,calc(100% - 28px)); }
.overtime-start-heading { display:grid; grid-template-columns:minmax(190px,.8fr) minmax(280px,1.2fr); grid-template-areas:"eyebrow datetime" "title datetime" "helper datetime"; column-gap:26px; padding-right:0; }
.overtime-start-heading .eyebrow { grid-area:eyebrow; }
.overtime-start-heading h2 { grid-area:title; align-self:center; font-size:38px; line-height:1.15; }
.overtime-start-heading > p:last-of-type { grid-area:helper; align-self:end; }
.punch-dialog-datetime.overtime-start-datetime { grid-area:datetime; align-self:stretch; display:grid; grid-template-columns:1fr; place-content:center; gap:7px; min-height:178px; margin:0; padding:20px; color:#0f5f55; background:linear-gradient(135deg,#e3f4ef,#f8fcfa); border:1px solid #9bc8be; box-shadow:0 0 0 4px rgba(45,142,124,.08),inset 0 1px 0 #fff; font-size:22px; font-weight:900; line-height:1.25; text-align:center; }
.overtime-start-datetime span,.overtime-start-datetime time { white-space:nowrap; }
.overtime-start-datetime time { color:#0a3934; font-size:34px; letter-spacing:.07em; text-shadow:0 1px 0 #fff; }
.overtime-reason-field { display:block; margin-top:24px; color:#354b47; font-size:15px; font-weight:800; }
.overtime-reason-heading { margin-bottom:9px; }
.overtime-reason-heading > label { font-size:16px; }
.overtime-reason-input-wrap { position:relative; }
.overtime-oncall-option { position:absolute; top:14px; left:16px; z-index:2; display:flex; align-items:center; gap:8px; margin:0 !important; padding:7px 11px; background:#e9f2ef; border:1px solid #b9cec9; color:#154f48; cursor:pointer; }
.overtime-oncall-option input { width:20px; height:20px; margin:0; accent-color:#12695c; }
.overtime-oncall-option span { font-size:16px; font-weight:900; letter-spacing:.02em; }
.overtime-reason-field textarea { box-sizing:border-box; display:block; width:100%; min-height:150px; padding:68px 16px 15px; color:var(--ink); background:#fbfcf9; border:1px solid #b9c9c5; outline:none; font:500 19px/1.6 "Noto Sans TC","Microsoft JhengHei",sans-serif; resize:vertical; }
.overtime-reason-field textarea:focus { border-color:var(--green-500); box-shadow:0 0 0 4px rgba(61,140,127,.14); }
.overtime-end-reason-input textarea { padding-top:15px; }
.overtime-start-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.overtime-start-actions button { box-sizing:border-box; width:100%; min-width:0; min-height:54px; }
@media (max-width:600px) {
  .overtime-start-dialog { padding:22px 16px; }
  .overtime-start-heading { grid-template-columns:110px minmax(0,1fr); grid-template-areas:"eyebrow datetime" "title datetime" "helper datetime"; column-gap:10px; }
  .overtime-start-heading h2 { font-size:27px; white-space:nowrap; }
  .overtime-start-heading > p:last-of-type { font-size:11px; line-height:1.55; }
  .punch-dialog-datetime.overtime-start-datetime { width:auto; min-height:142px; padding:10px 8px; font-size:19px; }
  .overtime-start-datetime span { font-size:21px; letter-spacing:-.02em; }
  .overtime-start-datetime time { font-size:31px; letter-spacing:.03em; }
  .overtime-reason-field textarea { min-height:132px; font-size:18px; }
  .overtime-start-actions { gap:8px; }
  .overtime-start-actions button { min-height:50px; padding:0 8px; font-size:16px; }
  .prework-choice-dialog { padding:22px 16px; }
  .prework-choice-body { grid-template-columns:minmax(0,1fr) 102px; gap:8px; margin-top:18px; }
  .prework-reason-field textarea { height:132px; }
  .prework-choice-actions { height:132px; gap:8px; }
  .prework-choice-actions button { min-height:0; padding:0 3px; font-size:13px; line-height:1; }
  .prework-confirm-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .prework-confirm-actions button { min-height:50px; padding:0 8px; font-size:16px; }
  .prework-final-confirm-dialog .dialog-heading h2 { font-size:28px; }
}
.smart-punch-panel.is-active-state { background:#a42e2e; border-color:#f1d7d2; box-shadow:0 13px 22px rgba(111,24,24,.27),0 5px 0 #762121,0 0 0 1px #c98e88,inset 0 1px 0 rgba(255,255,255,.2); }
.smart-punch-panel > button .punch-progress-label { display:block; font-size:.58em; line-height:1.2; letter-spacing:.12em; }
@media (max-width: 760px) {
  .staff-announcement { height: 260px; }
  .smart-punch-panel { position: absolute; right: 24px; bottom: 20px; z-index: 5; display: block; width: 154px; height: 154px; margin: 0; padding: 0; color: #fff; background: #175c55; border: 5px solid #e5eeeb; border-radius: 50%; box-shadow: 0 13px 22px rgba(18,59,53,.26),0 5px 0 #789d96,0 0 0 1px #a9beb9,inset 0 1px 0 rgba(255,255,255,.21); }
  .smart-punch-panel > div { display:none; }
  .smart-punch-panel > div .desktop-punch-time,.smart-punch-panel > div strong { display: none; }
  .smart-punch-panel > div .mobile-punch-date,.smart-punch-panel > div .mobile-punch-time { display: block; margin: 0; opacity: 1; color: #d5e4e1; font-weight: 700; line-height: 1.4; }
  .smart-punch-panel > div .mobile-punch-date { font-size: 12px; }
  .smart-punch-panel > div .mobile-punch-time { color: #fff; font-size: 17px; letter-spacing: .06em; }
  .smart-punch-panel > button { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction:column; align-items: center; justify-content: center; gap:7px; width: 100%; min-width: 0; height: 100%; min-height: 0; padding: 0; color: #fff; background: transparent; border: 0; border-radius: 50%; font: 900 25px/1.2 "Noto Sans TC","Microsoft JhengHei",sans-serif; letter-spacing: .05em; }
  .smart-punch-panel > button:active { background: rgba(4,34,31,.18); }
  .smart-punch-panel > button:disabled { background: transparent; }
}

/* Punch records use cards on phones even when the browser reports a wide CSS viewport. */
.personal-record-tabs { grid-template-columns: repeat(7,minmax(0,1fr)); }
.personal-record-tabs a:nth-child(6),
.personal-record-tabs a:nth-child(7) { grid-column: auto; grid-row: auto; }
.personal-leave-table .personal-leave-cancel-button,
.personal-applications-table .personal-leave-cancel-button {
  width: auto;
  min-width: 40px;
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}
.personal-applications-table { min-width: 920px; }
.personal-application-content-line { display: block; white-space: nowrap; }
.personal-application-content-line + .personal-application-content-line { margin-top: 3px; }
.personal-salary-detail-button { box-sizing: border-box; min-height: 40px; white-space: nowrap; }
.personal-salary-record-heading { justify-content: flex-end; }
.personal-salary-record-heading > div:first-child { display: none; }
.personal-salary-record-heading .personal-record-controls { width: 100%; justify-content: flex-end; }
.personal-salary-record { cursor: pointer; }
.personal-salary-record:hover td,.personal-salary-record:focus td { background: #f2f7f4; }
.personal-salary-record.is-selected td { background: #e3eee9; }
.personal-salary-record:focus { outline: 2px solid var(--green-700); outline-offset: -2px; }
.personal-salary-detail-dialog { position: fixed; inset: 16px; z-index: 1000; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; width: auto; max-width: none; height: auto; max-height: none; margin: 0; overflow: hidden; color: var(--ink); background: var(--paper); border: 0; box-shadow: 0 0 0 100vmax rgba(4,23,21,.64),0 28px 90px rgba(5,28,25,.35); }
.personal-salary-detail-dialog[hidden] { display: none !important; }
html:has(.personal-salary-detail-dialog:not([hidden])) { scrollbar-width: none; }
html:has(.personal-salary-detail-dialog:not([hidden]))::-webkit-scrollbar { display: none; }
.personal-salary-detail-dialog > * { position: relative; z-index: 1; }
.personal-salary-print-button { position: absolute; top: 14px; right: 14px; z-index: 4 !important; }
.personal-salary-print-area { position: relative; isolation: isolate; overflow: hidden; }
.personal-salary-print-area > *:not(.personal-salary-watermark) { position: relative; z-index: 2; }
.personal-salary-watermark { position: absolute; inset: 0; z-index: 3 !important; display: grid; place-content: center; justify-items: center; color: rgba(16,47,44,.13); pointer-events: none; user-select: none; transform: rotate(-25deg); }
.personal-salary-watermark strong { font-family: "Noto Serif TC","PMingLiU",serif; font-size: clamp(52px,13vw,108px); letter-spacing: .08em; }
.personal-salary-document-heading { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 150px 0 0; text-align: center; }
.personal-salary-document-heading > img { width: 58px; height: 58px; object-fit: contain; }
.personal-salary-document-heading p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .24em; }
.personal-salary-document-heading h2 { margin: 5px 0 0; font-family: "Noto Serif TC","PMingLiU",serif; font-size: 25px; letter-spacing: .08em; }
.personal-salary-document-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 24px 0 16px; padding-bottom: 16px; border-bottom: 1px solid #30413d; }
.personal-pay-record-row { cursor: pointer; }
.personal-pay-record-row:hover,.personal-pay-record-row:focus { background: #edf5f2; outline: 2px solid rgba(21,93,83,.18); outline-offset: -2px; }
.personal-salary-document-meta > div { display: grid; grid-template-columns: 82px 1fr; align-items: center; row-gap: 9px; }
.personal-salary-document-meta span { color: var(--muted); }
.personal-salary-document-meta strong { font-weight: 900; }
.personal-salary-month-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 16px; }
.personal-salary-month-nav strong { text-align: center; font-variant-numeric: tabular-nums; }
.personal-salary-month-nav a { text-decoration: none; }
.personal-salary-month-nav .is-disabled { color: var(--muted); opacity: .45; cursor: default; }
.personal-salary-attendance { margin-top: 14px; background: #f4f7f5; border: 1px solid var(--line); }
.personal-salary-attendance h3 { margin: 0; padding: 9px 10px; border-bottom: 1px solid #dbe3df; font-size: 16px; text-align: center; }
.personal-salary-attendance dl { margin: 0; }
.personal-salary-attendance dl > div { display: grid; grid-template-columns: repeat(3,120px 54px); justify-content: center; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #dbe3df; }
.personal-salary-attendance dl > div:last-child { border-bottom: 0; }
.personal-salary-attendance dt,.personal-salary-attendance dd { margin: 0; }
.personal-salary-attendance dt:nth-of-type(n+2) { padding-left: 18px; border-left: 1px solid #d2ddd8; }
.personal-salary-attendance dd { box-sizing: border-box; min-width: 56px; padding-right: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.personal-salary-attendance + .personal-salary-detail-grid { margin-top: 8px !important; }
.personal-salary-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.personal-salary-detail-grid section { display: flex; flex-direction: column; padding: 14px; background: #f4f7f5; border: 1px solid var(--line); }
.personal-salary-detail-grid h3 { margin: 0 0 10px; font-size: 16px; }
.personal-salary-detail-grid dl { display: flex; flex: 1; flex-direction: column; margin: 0; }
.personal-salary-detail-grid dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; border-bottom: 1px solid #dbe3df; }
.personal-salary-detail-grid dl > div:last-child { border-bottom: 0; }
.personal-salary-detail-grid dt,.personal-salary-detail-grid dd { margin: 0; }
.personal-salary-detail-grid dd { font-variant-numeric: tabular-nums; }
.personal-salary-detail-grid .is-total { margin-top: auto; font-weight: 800; }
.personal-salary-detail-net { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 14px 16px; color: #fff; background: var(--green-900); }
.personal-salary-detail-net strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.personal-salary-notice { margin-top: 18px; padding: 10px 12px; color: var(--muted); background: #f6f8f5; border-left: 3px solid #89aaa1; font-size: 11px; }
.personal-salary-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.personal-salary-bottom-actions { display: flex; justify-content: center; margin-top: 14px; }
.personal-salary-bottom-actions .primary-button { min-width: 120px; }
.personal-bonus-document-main { width: min(1120px,calc(100% - 12px)); margin: 18px auto 50px; }
.personal-bonus-bottom-actions .primary-button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; }
@media (max-width: 700px) {
  .personal-record-controls:has(.personal-salary-detail-button) .personal-salary-detail-button { order: -1; width: 148px; min-height: 30px; padding: 3px 5px; font-size: 12px; }
  .personal-record-controls:has(.personal-salary-detail-button) .personal-month-filter { width: 148px; min-width: 148px; transform: none; }
  .personal-salary-detail-dialog { inset: 15px; width: auto; max-width: none; height: auto; max-height: none; margin: 0; padding: 10px 7px 1px; overflow: hidden; }
  .personal-salary-print-area { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding-bottom: 0; overflow: hidden; }
  .personal-salary-scroll-area { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .personal-salary-notice,.personal-salary-footer { flex: 0 0 auto; }
  .personal-salary-print-button { box-sizing: border-box; top: 7px; right: 7px; min-height: 25px; height: 25px; padding: 2px 7px; font-size: 10px; line-height: 1; }
  .personal-salary-document-heading { justify-content: flex-start; gap: 7px; min-height: 52px; padding: 0 102px 0 2px; text-align: left; }
  .personal-salary-document-heading > img { width: 38px; height: 38px; }
  .personal-salary-document-heading p { font-size: 7px; letter-spacing: .12em; }
  .personal-salary-document-heading h2 { margin-top: 2px; font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
  .personal-salary-document-meta { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin: 8px 0 8px; padding-bottom: 8px; }
  .personal-salary-document-meta > div { grid-template-columns: auto 1fr; column-gap: 4px; row-gap: 5px; font-size: 11px; }
  .personal-salary-document-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .personal-salary-document-meta .salary-document-status { padding: 3px 5px; font-size: 10px; }
  .personal-salary-watermark strong { font-size: 52px; }
  .personal-salary-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin-top: 8px; }
  .personal-salary-detail-grid section { min-width: 0; padding: 7px 5px; }
  .personal-salary-detail-grid section + section { border-left: 0; }
  .personal-salary-detail-grid h3 { margin-bottom: 6px; text-align: center; font-size: 13px; }
  .personal-salary-detail-grid dl > div { gap: 4px; padding: 4px 0; font-size: 11px; }
  .personal-salary-detail-grid dt { min-width: 0; overflow-wrap: anywhere; }
  .personal-salary-detail-grid dd { flex: 0 0 auto; white-space: nowrap; }
  .personal-salary-detail-net { margin-top: 0; margin-left: 50%; padding: 8px 7px; color: var(--green-900); background: #e3eee9; border: 1px solid #b8cec6; border-top: 0; font-size: 12px; }
  .personal-salary-detail-net strong { font-size: 16px; }
  .personal-salary-month-nav { gap: 5px; margin-top: 8px; }
  .personal-salary-month-nav .secondary-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 66px; min-height: 23px; height: 23px; padding: 0 8px; font-size: 12px; line-height: 1; }
  .personal-salary-attendance { margin-top: 8px; font-size: 10px; }
  .personal-salary-attendance h3 { padding: 6px 5px; font-size: 13px; }
  .personal-salary-attendance dl > div { grid-template-columns: repeat(3,70px 34px); justify-content: center; gap: 3px; padding: 6px 4px; }
  .personal-salary-attendance dd { align-self: center; min-width: 34px; padding-right: 5px; }
  .personal-salary-attendance dt:nth-of-type(n+2) { padding-left: 8px; }
  .personal-salary-notice { margin-top: 10px; padding: 7px; font-size: 9px; }
  .personal-salary-footer { margin-top: 10px; font-size: 8px; }
  .personal-salary-bottom-actions { position: static; z-index: 5; flex: 0 0 auto; margin-top: 0; background: var(--paper); }
  .personal-salary-bottom-actions .primary-button { width: 100%; height: 45px; margin: 0; }
}
@media print {
  .bonus-slip-page .topbar,.bonus-slip-page .salary-document-toolbar,.bonus-slip-page .personal-salary-print-button,.bonus-slip-page .personal-bonus-bottom-actions { display: none !important; }
  .bonus-slip-page #personal-bonus-detail-dialog { position: static; display: block; width: 100%; max-width: none; max-height: none; margin: 0; padding: 0; overflow: visible; border: 0; box-shadow: none; }
  .bonus-slip-page #personal-bonus-detail-dialog::backdrop { display: none !important; }
  .bonus-slip-page .personal-bonus-document-main { width: 100%; margin: 0; padding: 0; }
  .bonus-slip-page .personal-bonus-print-area { padding: 12mm 8mm 6mm; border: 0; box-shadow: none; break-inside: avoid-page; page-break-inside: avoid; }
  html,body:has(#personal-salary-detail-dialog:not([hidden])) { height: auto !important; min-height: 0 !important; background: #fff !important; }
  body:has(#personal-salary-detail-dialog:not([hidden])) > .topbar,
  body:has(#personal-salary-detail-dialog:not([hidden])) > .dashboard-footer,
  body:has(#personal-salary-detail-dialog:not([hidden])) > main > *:not(.data-panel),
  body:has(#personal-salary-detail-dialog:not([hidden])) > main > .data-panel > *:not(#personal-salary-detail-dialog) { display: none !important; }
  body:has(#personal-salary-detail-dialog:not([hidden])) > main { display: block !important; width: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
  body:has(#personal-salary-detail-dialog:not([hidden])) > main > .data-panel { display: contents !important; }
  #personal-salary-detail-dialog:not([hidden]) { position: static; display: block; width: 100%; max-width: none; max-height: none; margin: 0; padding: 0; overflow: visible; border: 0; box-shadow: none; break-after: avoid-page; page-break-after: avoid; }
  .personal-salary-print-area { overflow: visible; break-inside: avoid-page; page-break-inside: avoid; }
  .personal-salary-scroll-area { overflow: visible; font-size: 24px; }
  #personal-salary-detail-dialog::backdrop,.personal-salary-print-button,.personal-salary-month-nav,.personal-salary-bottom-actions { display: none !important; }
  .personal-salary-watermark { color: rgba(16,47,44,.16) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .personal-salary-print-area { padding: 12mm 8mm 6mm; color: #102f2c; background: #fff; }
  .personal-salary-document-heading { justify-content: center; padding: 0; text-align: center; }
  .personal-salary-document-heading > img { width: 88px; height: 88px; }
  .personal-salary-document-heading p { font-size: 15px; letter-spacing: .25em; }
  .personal-salary-document-heading h2 { margin-top: 5px; font-size: 37.5px; letter-spacing: .1em; }
  .personal-salary-document-meta { grid-template-columns: repeat(3,1fr); gap: 18px; margin: 24px 0 18px; padding-bottom: 18px; }
  .personal-salary-document-meta > div { grid-template-columns: 74px 1fr; row-gap: 8px; font-size: 18px; }
  .personal-salary-document-meta strong { overflow: visible; text-overflow: clip; }
  .personal-salary-attendance { margin-top: 0; font-size: 18px; border-color: #30413d; }
  .personal-salary-attendance h3 { padding: 8px 10px; border-bottom-color: #30413d; font-size: 22.5px; }
  .personal-salary-attendance dl > div { grid-template-columns: repeat(3,minmax(0,1fr) max-content); padding: 7px 10px; border-bottom-color: #30413d; }
  .personal-salary-attendance dt,.personal-salary-attendance dd { white-space: nowrap; }
  .personal-salary-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin-top: 18px; }
  .personal-salary-detail-grid section { padding: 0; background: transparent; border: 1px solid #30413d; }
  .personal-salary-detail-grid section + section { border-left: 0; }
  .personal-salary-detail-grid h3 { margin: 0; padding: 8px; border-bottom: 1px solid #30413d; font-size: 22.5px; text-align: center; }
  .personal-salary-detail-grid dl > div { min-height: 30px; padding: 6px 10px; border-bottom: 1px solid #30413d; font-size: 18px; }
  .personal-salary-detail-net { width: 50%; margin: 0 0 0 auto; padding: 9px 10px; color: #102f2c; background: #edf3f0; border: 1px solid #30413d; border-top: 0; font-size: 24px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .personal-salary-detail-net strong { font-size: 25.5px; }
  .personal-salary-notice { margin-top: 18px; padding: 10px 12px; font-size: 10px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .personal-salary-footer { margin-top: 16px; font-size: 9px; }
}
@media (max-width: 520px) {
  .personal-record-tabs { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .personal-record-tabs a:nth-child(6) { grid-column: 1; grid-row: 2; }
  .personal-record-tabs a:nth-child(7) { grid-column: 2; grid-row: 2; }
}

/* Punch records use cards on phones even when the browser reports a wide CSS viewport. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .punch-table-wrap { overflow: visible; }
  .punch-records-table { display: block; width: 100%; min-width: 0; background: transparent; }
  .punch-records-table thead { display: none; }
  .punch-records-table tbody { display: grid; gap: 10px; }
  .punch-records-table tbody tr[data-record-row] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 12px rgba(16,47,44,.06); }
  .punch-records-table tbody tr[data-record-row][hidden] { display: none; }
  .punch-records-table tbody tr[data-record-row] td { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid #e1e9e5; white-space: normal; }
  .punch-records-table tbody tr[data-record-row] td:nth-last-child(-n+2) { border-bottom: 0; }
  .punch-records-table tbody tr[data-record-row] td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; }
  .punch-records-table tbody tr[data-record-row] td:nth-child(1), .punch-records-table tbody tr[data-record-row] td:nth-child(2) { grid-column: 1 / -1; }
  .punch-records-table tbody tr[data-record-row] td strong { min-width: 0; overflow-wrap: anywhere; }
}

/* Standard page heading layout: category/title copy at upper left, return link at upper right. */
.dashboard-main:has(.page-header) {
  position: relative;
  padding-top: 17px;
}
.dashboard-main:has(.page-header) .page-header .eyebrow {
  display: block;
  margin: 0 0 8px;
}
.dashboard-main:has(.page-header) .page-header > div > p:last-child {
  display: block;
}
.dashboard-main:has(.page-header) > .back-link,
.dashboard-main:has(.page-header) .page-header .back-link {
  position: absolute;
  top: 17px;
  right: 0;
  z-index: 4;
  display: block;
  width: max-content;
  margin: 0;
  line-height: 1.2;
  text-align: right;
}
@media (max-width: 760px) {
  .home-main { padding-top: 12px; }
  .dashboard-main:has(.page-header) { padding-top: 12px; }
  .dashboard-main:has(.page-header) > .back-link,
  .dashboard-main:has(.page-header) .page-header .back-link {
    top: 12px;
    right: 0;
  }
}
.payroll-rule-history-panel .data-panel-heading > strong{color:#6c7d79;font-size:.92rem;white-space:nowrap}
.payroll-rule-version-list{display:grid;gap:18px;padding:22px}
.payroll-rule-version-card{border:1px solid #d6e0dd;background:#fffcf7;box-shadow:0 8px 22px rgba(16,47,44,.05)}
.payroll-rule-version-card.is-current{border-left:6px solid #17665d}
.payroll-rule-version-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 18px;border-bottom:1px solid #dfe6e4}
.payroll-rule-version-card>header h3{margin:5px 0 0;font-family:var(--serif);font-size:1.65rem;color:#102f2c}
.payroll-rule-version-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.payroll-rule-version-actions form{margin:0}
.payroll-rule-version-actions .danger-button{padding:8px 13px}
.payroll-rule-version-number{color:#c99132;font-size:.75rem;font-weight:800;letter-spacing:.18em}
.payroll-rule-version-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid #dfe6e4}
.payroll-rule-version-meta>span{display:grid;gap:6px;padding:18px 24px;border-right:1px solid #dfe6e4}
.payroll-rule-version-meta>span:last-child{border-right:0}
.payroll-rule-version-meta small,.payroll-rule-change-summary small,.payroll-rule-detail-grid small{color:#6a7c78;font-weight:700}
.payroll-rule-version-meta strong{font-size:1rem;color:#102f2c;overflow-wrap:anywhere}
.payroll-rule-change-summary{display:grid;grid-template-columns:105px 1fr;align-items:start;gap:16px;padding:18px 26px;background:#f1f6f4}
.payroll-rule-change-summary p{margin:0;color:#244b47;font-weight:700}
.payroll-rule-version-details{border-top:1px solid #dfe6e4}
.payroll-rule-version-details>summary{display:flex;align-items:center;justify-content:space-between;padding:17px 26px;cursor:pointer;color:#17665d;font-weight:800;list-style:none}
.payroll-rule-version-details>summary::-webkit-details-marker{display:none}
.payroll-rule-version-details>summary span{font-size:1.35rem;transition:transform .2s ease}
.payroll-rule-version-details[open]>summary span{transform:rotate(45deg)}
.payroll-rule-detail-section{padding:6px 26px 24px}
.payroll-rule-detail-section h4{margin:12px 0;color:#102f2c;font-size:1.05rem}
.payroll-rule-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.payroll-rule-detail-grid>div{display:grid;gap:5px;padding:14px 16px;border:1px solid #dce5e2;background:#fff}
.payroll-rule-detail-grid strong{color:#102f2c}
@media(max-width:800px){
 .payroll-rule-version-list{padding:12px}
 .payroll-rule-version-card>header{padding:18px}
 .payroll-rule-version-actions{align-items:flex-end;flex-direction:column}
 .payroll-rule-version-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
 .payroll-rule-version-meta>span:nth-child(2){border-right:0}
 .payroll-rule-version-meta>span:nth-child(-n+2){border-bottom:1px solid #dfe6e4}
 .payroll-rule-change-summary{grid-template-columns:1fr;padding:16px 18px;gap:6px}
 .payroll-rule-detail-section{padding:4px 18px 18px}
 .payroll-rule-detail-grid{grid-template-columns:1fr}
}

/* Personal salary toolbar: three equal controls in one row. */
.personal-salary-record-heading { display: block; padding: 12px 14px; }
.personal-salary-record-heading .personal-record-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: 1 1 100%;
  height: 44px;
}
.personal-salary-record-heading .personal-salary-detail-button { display: none !important; }
.personal-salary-table { width: 100%; min-width: 0; table-layout: auto; }
.personal-salary-table th,.personal-salary-table td { border-right: 0 !important; border-left: 0 !important; }
.personal-salary-table th:first-child,.personal-salary-table td:first-child { position: static !important; left: auto !important; box-shadow: none !important; }
.personal-salary-table td:first-child { background: transparent !important; }
.personal-salary-table th:first-child { background: #f0f4f1 !important; }
.personal-salary-record-heading .personal-salary-detail-button {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  color: #fff;
  background: var(--green-900);
  border: 1px solid #d9b56b;
  box-shadow: 0 2px 5px rgba(16,47,44,.15);
  font-weight: 800;
  text-decoration: none;
}
.personal-salary-record-heading .personal-salary-detail-button::after {
  content: "›";
  margin-left: auto;
  color: #f0cf88;
  font-size: 20px;
  line-height: 1;
}
.personal-salary-record-heading .personal-salary-detail-button:hover,
.personal-salary-record-heading .personal-salary-detail-button:focus-visible {
  color: #fff;
  background: var(--green-700);
  outline: 2px solid rgba(217,181,107,.35);
  outline-offset: 1px;
}
.personal-salary-record-heading .personal-month-filter {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 44px;
  min-width: 0;
  margin: 0;
  transform: none;
}
.personal-salary-record-heading .personal-month-filter > [data-month-picker-open] {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--green-900);
  background: #edf4f1;
  border-color: #afc5be;
  box-shadow: 0 1px 3px rgba(16,47,44,.08);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media(max-width:700px){
  .personal-salary-record-heading { padding: 8px; }
  .personal-record-controls:has(.personal-salary-detail-button) .personal-salary-detail-button,
  .personal-record-controls:has(.personal-salary-detail-button) .personal-month-filter {
    order: initial;
    width: 100%;
    min-width: 0;
    transform: none;
  }
  .personal-salary-record-heading .personal-salary-detail-button,
  .personal-salary-record-heading .personal-month-filter > [data-month-picker-open] {
    height: 40px;
    min-height: 40px;
    padding: 6px 8px;
    font-size: 12px;
  }
  .personal-salary-record-heading .personal-month-filter { height: 40px; }
}

/* Shared desktop month picker. Mobile devices retain their native month control. */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .global-month-native-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }
  .global-month-picker-trigger {
    min-width: 178px;
    min-height: 48px;
    padding: 11px 44px 11px 16px;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    font: 700 16px/1.35 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    text-align: left;
    cursor: pointer;
    position: relative;
  }
  .global-month-picker-trigger::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    translate: 0 -50%;
    color: var(--green-700);
  }
  .global-month-picker-trigger.has-value { color: var(--ink); }
}
.global-month-picker-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 24px 70px rgba(16,47,44,.25);
}
.global-month-picker-dialog::backdrop { background: rgba(9,35,32,.46); }
.global-month-picker-shell { padding: 24px; }
.global-month-picker-shell header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.global-month-picker-shell header strong {
  font-size: 24px;
  text-align: center;
}
.global-month-picker-arrow {
  width: 48px;
  height: 44px;
  color: var(--green-700);
  background: #f3f7f5;
  border: 1px solid var(--line);
  font-size: 28px;
  cursor: pointer;
}
.global-month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.global-month-picker-grid button {
  min-height: 58px;
  color: var(--ink);
  background: #f7faf8;
  border: 1px solid var(--line);
  font: 700 16px/1.2 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  cursor: pointer;
}
.global-month-picker-grid button:hover,
.global-month-picker-grid button:focus-visible { border-color: var(--green-700); background: #e7f1ee; }
.accounting-forms{display:grid;grid-template-columns:2fr 1fr;gap:24px;margin-bottom:24px}.accounting-forms>div{padding:20px}.accounting-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.accounting-form input,.accounting-form select,.inline-accounting-form input,.inline-accounting-form select{min-height:40px;padding:8px;border:1px solid var(--line);background:#fff}.inline-accounting-form{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.inline-accounting-form input,.inline-accounting-form select{max-width:150px}.accounting-main .account-table small{display:block;color:var(--muted);margin-top:4px}@media(max-width:760px){.accounting-forms{grid-template-columns:1fr}.accounting-form{grid-template-columns:1fr}.accounting-main .account-table-wrap{overflow-x:auto}.inline-accounting-form{min-width:260px}.accounting-main .account-stats{grid-template-columns:1fr 1fr}}
.accounting-guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:24px}.accounting-guide-grid .data-panel{padding:24px}.guide-step{display:inline-grid;place-items:center;width:42px;height:42px;margin-bottom:12px;color:#fff;background:var(--green-700);font-weight:800}.accounting-manual-main li{margin:.65em 0;line-height:1.7}.manual-warning{padding:24px;margin-bottom:24px;border-left:5px solid var(--green-700)}@media(max-width:760px){.accounting-guide-grid{grid-template-columns:1fr}}
.purchase-header-form{padding:24px;margin-bottom:24px}.purchase-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.purchase-field-grid label{display:grid;gap:6px;font-weight:700}.purchase-field-grid input,.purchase-field-grid select,.purchase-items-table input{box-sizing:border-box;width:100%;min-height:40px;padding:8px;border:1px solid var(--line);background:#fff}.purchase-items-table{min-width:1250px}.purchase-totals{display:flex;justify-content:flex-end;gap:28px;padding:20px 0}.purchase-totals span{display:grid;gap:5px;color:var(--muted)}.purchase-totals strong{color:var(--ink);font-size:18px}@media(max-width:760px){.purchase-field-grid{grid-template-columns:1fr}.purchase-totals{display:grid;grid-template-columns:1fr 1fr;justify-content:stretch}.purchase-totals span:last-child{grid-column:1/-1}}
.invoice-entry-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0}.invoice-entry-actions span{color:var(--muted);font-size:13px}.invoice-recognition-dialog{width:min(1180px,94vw);max-height:90vh;padding:0;border:1px solid var(--line);background:#fff;color:var(--ink);overflow:hidden}.invoice-recognition-dialog::backdrop{background:rgba(8,25,23,.55)}.invoice-recognition-dialog header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;color:#fff;background:var(--green-700);cursor:move;touch-action:none}.invoice-recognition-dialog header button{color:#fff;background:transparent;border:0;font-size:24px}.invoice-recognition-body{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);height:min(66vh,650px);background:#fff}.invoice-recognition-preview{display:grid;place-items:center;min-height:0;padding:16px;background:#edf2f0;overflow:hidden}.invoice-recognition-preview img,.invoice-recognition-preview iframe{display:block;max-width:100%;width:100%;height:100%;object-fit:contain;border:0}.invoice-recognition-result{min-width:0;margin:0;padding:20px;overflow:auto;overflow-wrap:anywhere;background:#fff;border-left:1px solid var(--line)}.invoice-recognition-dialog footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 18px;background:#fff;border-top:1px solid var(--line)}
.purchase-header-form{position:relative}.invoice-recognize-top{position:absolute;top:24px;right:24px;min-width:160px}@media(max-width:760px){.invoice-recognize-top{position:static;width:100%;margin:0 0 16px}}
.invoice-recognition-result{max-height:none;overflow:auto}.invoice-recognition-result dl{display:grid;grid-template-columns:120px 1fr;gap:6px 12px}.invoice-recognition-result dt{color:var(--muted)}.invoice-recognition-result dd{margin:0;font-weight:700;white-space:pre-wrap}.invoice-recognition-result pre{padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;background:#f2f5f4;border:1px solid var(--line);font:13px/1.55 ui-monospace,monospace}
@media(max-width:760px){.invoice-recognition-body{grid-template-columns:1fr;height:68vh;overflow:auto}.invoice-recognition-preview{height:38vh}.invoice-recognition-result{max-height:none;border-left:0;border-top:1px solid var(--line)}}
.global-month-picker-grid button.is-selected { color: #fff; background: var(--green-700); border-color: var(--green-700); }
.global-month-picker-shell footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.bonus-layout{display:grid;grid-template-columns:minmax(280px,.75fr) minmax(0,1.6fr);gap:24px;align-items:start}.bonus-batch-list{display:grid;gap:10px;padding:20px}.bonus-batch-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid var(--line,#cbd7d3);color:inherit;text-decoration:none}.bonus-batch-card span{display:grid;gap:5px}.bonus-batch-card small{color:var(--muted,#6e7d79)}.bonus-batch-card.active{background:#103a35;color:#fff}.bonus-batch-card.active small{color:#d9e7e3}.inline-form{display:inline}.personal-bonus-records{margin-top:28px}.personal-bonus-records h3{padding:0 24px}@media(max-width:900px){.bonus-layout{grid-template-columns:1fr}.bonus-main .page-header{align-items:flex-start}}
