/* PeopleOps 藏青金。色票見 docs/superpowers/plans/2026-11-07-phase6b-visual.md「本計畫做的決定」。 */
:root {
  --navy: #14213D;
  --navy-hover: #24365C;
  --brass: #B08D57;
  --brass-light: #D9BE8C;
  --brass-soft: #F1E9DA;
  --brass-ink: #7A5C2B;
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #F1F1EC;
  --border: #E4E4DF;
  --border-strong: #C9CBD3;
  --ink: #1B2433;
  --ink-2: #4E5A6E;
  --ink-3: #5E677C;
  --ok: #2F6B4F; --ok-soft: #E3EEE8;
  --warn: #8A5A00; --warn-soft: #FBF0D6;
  --danger: #A3302A; --danger-soft: #F8E1DE;
  --info: #2E4A7A; --info-soft: #E5ECF6;
  --radius: 5px;
  --radius-lg: 10px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: var(--navy); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--navy-hover); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { color: var(--navy); line-height: 1.3; font-weight: 600; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
p { margin: .5rem 0; }
.muted, .meta { color: var(--ink-3); }
.meta { font-size: .9rem; }
.empty { color: var(--ink-3); }
p.empty { padding: 1rem 0; }
td.empty { padding: 1rem .8rem; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.notes { min-width: 11rem; }

/* 頂列與導覽 */
.topbar { background: var(--navy); color: #E8EAF0; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 76rem; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: 0 1.25rem; min-height: 3.25rem; }
.brand { color: #fff; font-weight: 600; text-decoration: none; letter-spacing: .01em; }
.brand:hover { color: var(--brass-light); }
.site-nav { display: flex; align-items: center; flex: 1; gap: 1rem; }
.site-nav nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.site-nav nav a { color: #C9CEDA; text-decoration: none; padding: .9rem .6rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.site-nav nav a:hover { color: #fff; }
.site-nav nav a[aria-current="page"] { color: var(--brass-light); border-bottom-color: var(--brass); }
.whoami { display: flex; align-items: center; gap: .75rem; color: #C9CEDA; font-size: .9rem; white-space: nowrap; }
.whoami form { margin: 0; }
.btn-quiet { background: transparent; color: #E8EAF0; border: 1px solid #3A4A6B; }
.btn-quiet:hover { background: var(--navy-hover); }
.nav-toggle { display: none; margin-left: auto; background: transparent; color: #fff; border: 1px solid #3A4A6B; }
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--navy-hover); color: #fff; }

/* 版面 */
main { max-width: 76rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.page-head h1 { margin: 0; }
.page-head .page-actions { margin-left: auto; }
.page-head .meta { flex-basis: 100%; margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions form { margin: 0; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.25rem 1rem; margin: 1.25rem 0; }
.section > h2:first-child { margin-top: 0; }
.danger-zone { border-color: #E9C3BF; }
.danger-zone > h2 { color: var(--danger); }

/* 按鈕：預設次要；.btn-primary 主要；.btn-danger 危險 */
button, .button { font: inherit; font-size: .9rem; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 2.25rem; padding: .45rem .9rem; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--surface-2); color: var(--ink); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: #DDA9A4; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
form.inline { display: inline; }

/* 表單 */
form > div, fieldset { margin: 0 0 1rem; }
fieldset { border: 0; padding: 0; }
label, legend { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: .3rem; font-weight: 500; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  font: inherit; width: 100%; max-width: 28rem; min-height: 2.5rem; padding: .45rem .65rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
textarea { min-height: 5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--brass); }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); vertical-align: middle; }
/* 開關列：整列可點；膠囊多選 */
.switch-row { display: flex; align-items: center; gap: .85rem; min-height: 3rem; padding: .6rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; max-width: 36rem; position: relative; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 2.5rem; height: 1.4rem; border-radius: .7rem; background: var(--border-strong); position: relative; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: left .15s; }
.switch-row input:checked + .switch { background: var(--navy); }
.switch-row input:checked + .switch::after { left: 1.3rem; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--brass); outline-offset: 2px; }
.switch-row:has(input:checked) { border-color: var(--navy); background: #F4F6FA; }
.switch-text { display: flex; flex-direction: column; gap: .1rem; }
.switch-label { font-weight: 600; color: var(--ink); }
.switch-text .helptext { margin: 0; }
.switch-state { margin-left: auto; font-size: .85rem; color: var(--ink-3); }
.switch-state .yes, .switch-row input:checked ~ .switch-state .no { display: none; }
.switch-row input:checked ~ .switch-state .yes { display: inline; color: var(--navy); font-weight: 600; }
fieldset.chip-set { border: 0; padding: 0; margin: 0 0 1rem; }
.chip-set { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-set legend { width: 100%; margin-bottom: .4rem; }
.chip-option { position: relative; margin: 0; }
.chip-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-option span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1.1rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); cursor: pointer; color: var(--ink); }
.chip-option input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-option input:checked + span::before { content: "✓ "; }
.chip-option input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.helptext { font-size: .85rem; color: var(--ink-3); margin-top: .3rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 14rem)); gap: 0 1rem; margin: 0 0 1rem; }
.field-row > div { margin: 0; }
.time-range { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2, #F7F8FA); }
.time-range > .meta { margin: 0 0 .5rem; }
.timeline { display: flex; flex-wrap: wrap; }
.tl-hour { flex: 0 0 auto; min-width: 3.4rem; min-height: 2.75rem; margin: 0 -1px -1px 0; padding: 0; border: 1px solid var(--border-strong); border-radius: 0; background: var(--surface); color: var(--ink); font-size: .85rem; font-variant-numeric: tabular-nums; }
.tl-hour:first-child { border-radius: 8px 0 0 8px; }
.tl-hour:last-child { border-radius: 0 8px 8px 0; }
.tl-hour[disabled] { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.tl-hour.taken { background: repeating-linear-gradient(135deg, var(--danger-soft) 0 6px, var(--surface-2) 6px 12px); color: var(--danger); }
.tl-hour.in { background: var(--navy); border-color: var(--navy); color: #fff; position: relative; z-index: 1; }
.tl-hour:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; position: relative; z-index: 2; }
.presets { display: flex; gap: .5rem; margin: .6rem 0 0; }
.presets[hidden], [data-leaves][hidden], .days-hint[hidden] { display: none; }
.days-hint { margin: -.5rem 0 1rem; }
.days-hint.warning { color: var(--danger); font-weight: 600; }
.time-range .hours-preview { margin: .5rem 0 0; }
.js [data-time-row][hidden], .js [data-span-row][hidden] { display: none; }
.errorlist { list-style: none; margin: .35rem 0 0; padding: 0; color: var(--danger); font-size: .88rem; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
form > button[type=submit], form > .form-actions { margin-top: .25rem; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .75rem 0 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table-wrap > table { margin: 0; }
th, td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); color: var(--ink-2); font-weight: 500; font-size: .85rem; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td { background: #FAFAF7; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total th, tr.total td { border-top: 2px solid var(--navy); font-weight: 600; background: var(--surface); }
tr.off td { background: var(--surface-2); color: var(--ink-3); }
tr.short-row td { background: var(--warn-soft); }
td.short, div.short { color: var(--danger); font-weight: 600; }
td .actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* 提醒與狀態 */
.alert { border-radius: var(--radius); padding: .7rem 1rem; margin: .75rem 0; border: 1px solid; background: var(--warn-soft); border-color: #EBD49B; color: var(--warn); }
.alert-info { background: var(--info-soft); border-color: #C3D2EA; color: var(--info); }
.alert-warn { background: var(--warn-soft); border-color: #EBD49B; color: var(--warn); }
.alert-error { background: var(--danger-soft); border-color: #E9C3BF; color: var(--danger); }
.alert-success { background: var(--ok-soft); border-color: #BFD9CB; color: var(--ok); }
ul.alert { padding-left: 2rem; }
.messages { margin-bottom: 1rem; }
.pill { display: inline-block; font-size: .78rem; line-height: 1.5; padding: .1rem .55rem; border-radius: 4px; white-space: nowrap; font-weight: 500; }
.pill-neutral { background: #ECEDEF; color: var(--ink-2); }
.pill-brass { background: var(--brass-soft); color: var(--brass-ink); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* 班表子選單與月曆頁首 */
.subnav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); margin: -.5rem 0 1.25rem; }
.subnav a { padding: .55rem .85rem; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--navy); }
.subnav a[aria-current="page"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--brass); }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.filter-tabs a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .35rem .9rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; }
.filter-tabs a[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-tabs .count { font-size: .8rem; color: var(--ink-3); }
.filter-tabs a[aria-current="true"] .count { color: #D9DEE8; }
.cal-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.cal-head-status { justify-self: start; display: flex; flex-wrap: wrap; gap: .35rem; }
.cal-head-actions { justify-self: end; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cal-head-actions form { margin: 0; }
.month-switch { display: flex; align-items: center; gap: .5rem; }
.month-switch h1 { min-width: 8.5em; text-align: center; margin: 0; font-size: 1.45rem; }
.month-switch .button { min-width: 2.5rem; }
.stats-head .month-switch h1 { min-width: 5em; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + .25rem); z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(20, 33, 61, .12); min-width: 9rem; padding: .25rem 0; }
.menu-list a { display: block; padding: .5rem .9rem; text-decoration: none; color: var(--ink); }
.menu-list a:hover { background: var(--surface-2); }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .82rem; color: var(--ink-3); margin: 0 0 .75rem; }
.cal-legend .chip { display: inline-block; }
.legend-box { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; border: 1px solid var(--border); background: var(--surface); vertical-align: middle; }
.legend-box.off { background: var(--surface-2); }
.legend-box.short { background: #FFFBF0; border-color: #E2C36F; }
.my-holiday { font-size: .65rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .field-row { grid-template-columns: 1fr; }
  .subnav { flex-wrap: wrap; gap: 0 .1rem; }
  .subnav a { white-space: nowrap; min-height: 2.75rem; display: inline-flex; align-items: center; padding: .4rem .7rem; }
  .cal-head { grid-template-columns: 1fr; }
  .month-switch { order: -1; justify-content: center; }
  .month-switch h1 { min-width: 7.5em; font-size: 1.2rem; }
  .cal-head-status, .cal-head-actions { justify-self: stretch; }
}
@media (max-width: 380px) {
  .month-switch { gap: .3rem; }
  .month-switch h1 { min-width: 6.6em; font-size: 1.05rem; }
  .month-switch .button { min-width: 2.25rem; padding-left: .5rem; padding-right: .5rem; }
}
.preview-banner { background: var(--brass-soft); color: var(--brass-ink); border: 1px solid #E2CFA8; border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
/* 月曆 */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.cal-wd { text-align: center; font-size: .8rem; color: var(--ink-3); padding: .25rem 0; }
.cal-pad { min-height: 6rem; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 6rem; padding: .35rem .45rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day.off { background: var(--surface-2); }
.cal-day.short { border-color: #E2C36F; background: #FFFBF0; }
.cal-day.today { outline: 2px solid var(--brass); outline-offset: -1px; }
.cal-num { font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--navy); }
.cal-holiday { font-size: .75rem; color: var(--danger); font-weight: 600; }
.cal-short { font-size: .75rem; color: var(--warn); font-weight: 600; }
.chip { display: block; font-size: .75rem; border-radius: 4px; padding: .05rem .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-1 { background: var(--info-soft); color: var(--info); }
.chip-2 { background: var(--brass-soft); color: var(--brass-ink); }
.chip-leave { background: var(--danger-soft); color: var(--danger); }
.cal-wdname { display: none; }
@media (max-width: 640px) {
  .admin-cal { grid-template-columns: 1fr; }
  .admin-cal .cal-wd, .admin-cal .cal-pad { display: none; }
  .admin-cal .cal-day { min-height: 2.75rem; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; padding: .45rem .6rem; }
  .admin-cal .cal-num { min-width: 4.5rem; }
  .admin-cal .cal-wdname { display: inline; margin-left: .35rem; color: var(--ink-3); font-weight: 400; }
  .admin-cal .chip { display: inline-block; font-size: .8rem; padding: .05rem .4rem; }
  .admin-cal .cal-day.off { padding: .3rem .6rem; }
  .cal { gap: .2rem; }
  .cal-day, .cal-pad { min-height: 4.25rem; padding: .2rem; }
  .chip { font-size: .68rem; padding: 0 .2rem; }
}
.next-shift { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.next-shift .meta { color: var(--brass-light); flex-basis: 100%; }
.next-shift strong { font-size: 1.25rem; }
.my-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.my-summary div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; text-align: center; color: var(--ink-2); }
.my-summary b { display: block; font-size: 1.4rem; color: var(--navy); }
.my-cal details.cal-day { min-height: 4.5rem; cursor: pointer; }
.my-cal summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.my-cal summary::-webkit-details-marker { display: none; }
.my-tag { display: inline-block; min-width: 1.6rem; text-align: center; border-radius: 4px; font-size: .8rem; font-weight: 600; padding: .05rem .3rem; }
.my-tag.shift-1 { background: var(--info-soft); color: var(--info); }
.my-tag.shift-2 { background: var(--brass-soft); color: var(--brass-ink); }
.my-tag.leave { background: var(--danger-soft); color: var(--danger); }
.my-detail { font-size: .75rem; color: var(--ink-2); margin-top: .3rem; text-align: center; }
/* 薪資批次頁 */
.next-run-head { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.next-run-head h2 { margin: 0 0 .25rem; }
.next-run-head form { margin: 0; }
.next-run .checklist { margin-bottom: .75rem; }
details.other-month > summary, details.year > summary { cursor: pointer; color: var(--navy); font-weight: 600; padding: .4rem 0; }
details.other-month > summary { font-weight: 500; font-size: .92rem; }
.inline-fields { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: .5rem; }
.inline-fields > div { margin: 0; }
.inline-fields input, .inline-fields select { width: 9rem; }
details.year { margin: 1rem 0; }
details.year > summary { font-size: 1.1rem; }
/* 需求人數週表 */
table.week-grid th[scope="row"] { white-space: nowrap; }
table.week-grid th[scope="row"] .meta { display: block; font-weight: 400; font-size: .78rem; }
th.c, td.c { text-align: center; }
.cell-link { display: block; text-decoration: none; padding: .35rem 0; border-radius: var(--radius); color: var(--ink); }
.cell-link:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  table.week-grid th, table.week-grid td { padding: .45rem .2rem; font-size: .85rem; }
  table.week-grid th[scope="row"] { padding-left: .5rem; }
  table.week-grid .pill { font-size: .62rem; padding: 0 .2rem; }
}

/* 假期統計 */
td.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
td.over { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* 員工視角 */
summary.btn-quiet { display: inline-flex; align-items: center; min-height: 2.25rem; padding: .45rem .9rem; border-radius: var(--radius); border: 1px solid #3A4A6B; color: #E8EAF0; cursor: pointer; list-style: none; font-size: .9rem; }
summary.btn-quiet::-webkit-details-marker { display: none; }
.preview-bar { position: sticky; top: 3.25rem; z-index: 19; display: flex; gap: 1rem; align-items: center; justify-content: center; background: var(--brass-soft); color: var(--brass-ink); padding: .5rem 1rem; border-bottom: 1px solid #E2CFA8; }
.preview-bar form { margin: 0; }
.preview-bar .btn-quiet { color: var(--brass-ink); border-color: #D9BE8C; }
body.previewing main button[type="submit"]:not(.preview-keep) { opacity: .45; pointer-events: none; }
.preview-menu .menu-list form { margin: 0; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; color: var(--ink); min-height: 2.5rem; justify-content: flex-start; }
.menu-item:hover { background: var(--surface-2); }

/* 確認對話框 */
dialog.confirm { border: 0; border-radius: var(--radius-lg); padding: 1.25rem 1.25rem 1rem; width: min(26rem, calc(100vw - 2rem)); box-shadow: 0 12px 36px rgba(20, 33, 61, .28); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(20, 33, 61, .45); }
dialog.confirm h2 { margin: 0 0 .5rem; font-size: 1.1rem; display: flex; gap: .6rem; align-items: center; }
.confirm-icon { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; background: var(--info-soft); color: var(--info); }
.confirm-icon::before { content: "i"; }
dialog.confirm.danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
dialog.confirm.danger .confirm-icon::before { content: "!"; }
.confirm-body { color: var(--ink-2); margin: 0 0 1.1rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.confirm-ok.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (max-width: 640px) { .confirm-actions > button { flex: 1; } }
/* 儀表板 */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem; }
.dash .section { margin: 0; }
.figure { font-size: 2rem; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li > span:first-child { flex-shrink: 0; white-space: nowrap; }
.checklist .mark-ok { color: var(--ok); font-weight: 600; }
.checklist .mark-todo { color: var(--warn); font-weight: 600; }

/* 登入 */
.login { max-width: 24rem; margin: 3rem auto; }
.login .section { padding: 1.75rem; }
.login h1 { margin-bottom: 1rem; }
.login .sso { width: 100%; min-height: 2.75rem; }
.login .or { text-align: center; color: var(--ink-3); font-size: .85rem; margin: 1.25rem 0 1rem; }

/* 手機 */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); flex-direction: column; align-items: stretch; padding: .5rem 1.25rem 1rem; gap: .5rem; border-top: 1px solid #2A3A5C; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: flex; }
  .no-js .nav-toggle { display: none; }
  .no-js .site-nav { position: static; display: flex; flex-basis: 100%; padding: 0 0 1rem; border-top: 0; }
  .no-js .brand { padding: .9rem 0 .25rem; }
  .no-js .topbar-inner { flex-wrap: wrap; }
  .no-js main table { display: block; overflow-x: auto; }
  .site-nav nav { flex-direction: column; gap: 0; }
  .site-nav nav a { padding: .75rem 0; border-bottom: 1px solid #22314F; }
  .site-nav nav a[aria-current="page"] { border-bottom-color: var(--brass); }
  .whoami { justify-content: space-between; padding-top: .5rem; }
  .topbar-inner { position: relative; }
  main { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.35rem; }
  button, .button { min-height: 2.75rem; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { max-width: none; font-size: 16px; }
  .page-actions { width: 100%; }
}
@media (max-width: 640px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  .table-wrap:has(> table.cards) { border: 0; background: transparent; overflow: visible; }
  table.cards tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: .75rem; padding: .5rem .9rem; }
  table.cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem 0; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--ink-3); text-align: left; flex-shrink: 0; }
  table.cards td:first-child { font-weight: 600; font-size: 1rem; text-align: left; }
  table.cards td:first-child::before { content: none; }
  table.cards td[data-label=""]::before { content: none; }
  table.cards td.num { white-space: normal; }
  table.cards tbody tr:hover td { background: transparent; }
  table.cards td.hide-sm { display: none; }
  table.runs tr { padding: .35rem .9rem; margin-bottom: .5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 錯誤頁 */
.error-page { max-width: 36rem; margin: 2rem auto; }
.error-page .actions { margin-top: 1.25rem; }
.my-stats .period { display: block; white-space: nowrap; font-size: .8rem; }
.my-stats td { white-space: nowrap; }
/* 麵包屑：子頁面頂部告訴你在哪、怎麼回上一層 */
.crumbs { color: var(--ink-3); font-size: .9rem; margin: 0 0 .5rem; }
.crumbs a { color: var(--ink-2); }
/* 手機點擊目標：卡片標題連結撐高、月曆整格可點、員工班表日期整格可點 */
.cal-day { position: relative; }
a.cal-num::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 640px) {
  table.cards td:first-child a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .my-cal summary { min-height: 2.75rem; }
}

/* 薪資單（templates/payroll/_payslip.html），版面同 PDF：白底表頭加細色條、應發／應扣雙欄、實領框 */
.payslip-sheet { background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--navy); border-radius: var(--radius-lg); overflow: hidden; margin: 1rem 0 1.5rem; font-size: 1.05rem; }
.ps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; color: var(--navy); margin: 0 1.25rem; padding: 1.25rem 0 .9rem; border-bottom: 1.5px solid var(--brass); }
.ps-company { font-size: 1.6rem; letter-spacing: .08em; }
.ps-title { text-align: right; font-size: 1.15rem; }
.ps-title small { display: block; color: var(--ink-3); font-size: .95rem; }
.ps-info { display: grid; grid-template-columns: 1fr 1fr 2fr 1fr; gap: .5rem 1rem; background: var(--bg); margin: 1.25rem; padding: .75rem 1rem; }
.ps-info dt { color: var(--ink-3); font-size: .9rem; }
.ps-info dd { font-size: 1.05rem; }
.ps-info dd { margin: 0; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 0 1.25rem; }
.ps-col h2, .ps-panel h3 { margin: .5rem 0 .25rem; padding-bottom: .25rem; }
.ps-col h2 { font-size: 1.2rem; border-bottom: 1.5px solid var(--navy); }
.ps-panel h3 { font-size: 1.05rem; font-weight: 500; border-bottom: 1px solid var(--border); }
.payslip-sheet table { width: 100%; margin: 0; font-size: 1rem; }
.payslip-sheet .table-wrap { border: 0; border-radius: 0; margin: 0; background: none; overflow: visible; }  /* app.js 會把表格包進 .table-wrap */
.payslip-sheet tbody tr:hover td { background: none; }
.payslip-sheet td { border: 0; padding: .2rem 0; }
.ps-sub { color: var(--ink-3); font-size: .9rem; margin: .5rem 0 0; }
.ps-total, .ps-annual { display: flex; justify-content: space-between; margin: .5rem 0 0; padding-top: .4rem; border-top: 1px solid var(--border); }
.ps-total { color: var(--navy); font-weight: 600; }
.ps-col { display: flex; flex-direction: column; }
.ps-col > .ps-total { margin-top: auto; }  /* 兩欄列數不同時，合計仍對齊在底部 */
.ps-net { display: flex; justify-content: space-between; align-items: center; margin: 1.25rem; padding: .75rem 1rem; border: 1.5px solid var(--brass); color: var(--navy); }
.ps-net .num { font-size: 1.9rem; font-weight: 700; }
.ps-panel { font-size: 1rem; }
.ps-panel td:first-child, .ps-annual span:first-child { color: var(--ink-3); }
.ps-panel ul { list-style: none; margin: .25rem 0 0; padding: 0; }
.payslip-sheet > .ps-panel { margin: 1rem 1.25rem 1.25rem; }
.payslip-sheet > .ps-cols:last-of-type { margin-bottom: 1.25rem; }
@media (max-width: 640px) {
  .ps-info { grid-template-columns: 1fr 1fr; margin: 1rem; }
  .ps-info .ps-wide { grid-column: 1 / -1; }
  .ps-cols { grid-template-columns: 1fr; gap: .5rem; margin: 0 1rem; }
  .ps-net { margin: 1rem; }
  .ps-net .num { font-size: 1.5rem; }
  .ps-head { margin: 0 1rem; }
  .ps-company { font-size: 1.35rem; }
  .payslip-sheet > .ps-panel { margin: 1rem; }
}
