/* 出勤紀錄表（kit.css 之上只加版面）：每天一列是主角；國定假日、休息日、例假用底色分，延長工時用暖橘，可能違法用紅 */
:root { --as-hol: #C8551E; --as-hol-soft: #FBE9DF; --as-off-soft: #EEF3F8; --as-bad: #B42318; --as-bad-soft: #FDECEA; }
.as-top { padding-bottom: 4px; }
.as-grid { max-width: 1180px; margin: 0 auto; }
.as-in { padding-top: 8px; }
.as-out { padding-top: 0; }
.as-form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s2) var(--s3); }
.as-form .field { margin: 0 0 var(--s3); }
.as-form select { width: 100%; box-sizing: border-box; min-height: 44px; font: inherit; }
.as-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.as-form fieldset { border: 0; padding: 0; min-width: 0; }
.as-form legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }

/* 時間輸入：用文字框＋數字鍵盤（打 0907 自動變 09:07）。原生 type=time 在 iOS 空格會顯示灰色的現在時間、像已經填了；桌機 Chrome 會多 AM/PM 撐爆四欄 */
.as-form input[data-time] { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 8px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.as-form input[aria-invalid="true"] { border-color: var(--as-bad); background: var(--as-bad-soft); }
.as-row4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.as-t { display: grid; gap: 4px; font-size: .9375rem; color: var(--ink-soft); }
.as-week { margin: 12px 0 0; }

/* 快速填 */
.as-quick { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.as-quick .btn { min-height: 48px; padding: 0 14px; }
.as-quick-h { font-size: .875rem; color: var(--ink-soft); margin: 8px 0 12px; }

/* 每天一列：日期｜上班｜下班｜⋯，下面一行小結；⋯ 打開休息、請假、備註 */
.as-days { display: grid; gap: 6px; }
.as-day { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 6px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.as-day.k-rest, .as-day.k-regular { background: var(--as-off-soft); }
.as-day.k-holiday { background: var(--as-hol-soft); border-color: #F0C4AC; }
.as-dl { display: grid; grid-template-columns: auto 1fr; column-gap: 4px; align-items: baseline; line-height: 1.2; }
.as-dl b { font: 700 1.0625rem/1.2 var(--font-body, inherit); font-variant-numeric: tabular-nums; }
.as-dl span { font-size: .875rem; color: var(--ink-soft); }
.as-dl em { grid-column: 1 / -1; font-style: normal; font-size: .875rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-day.k-holiday .as-dl em, .as-day.k-holiday .as-dl b { color: var(--as-hol); }
.as-tl { display: block; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.as-mb { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--accent); font: 700 1.125rem/1 var(--font-body, inherit); cursor: pointer; }
.as-mb[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.as-ds { grid-column: 1 / -1; margin: 0; font-size: .875rem; line-height: 1.4; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.as-ds:empty { display: none; }
.as-ds b { margin-left: 6px; font-weight: 700; }
.as-ds.warn b, .as-ds.warn { color: #8A3B12; }
.as-ds.bad, .as-ds.bad b { color: var(--as-bad); }
.as-extra { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding-top: 4px; }
.as-extra[hidden] { display: none; }
.as-extra label { display: grid; gap: 4px; font-size: .875rem; color: var(--ink-soft); }
.as-extra input { min-height: 44px; }
.as-extra .as-note { grid-column: 1 / -1; }

/* 結果 */
.as-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.as-actions .btn { flex: 1 1 220px; }
.as-msg { min-height: 1.4em; margin: 8px 0 0; font-size: .9375rem; color: var(--accent); font-weight: 700; }
.as-disclaim { font-size: .875rem; color: var(--ink-soft); line-height: 1.7; margin-top: 12px; }
.as-facts dt { font-size: 14px; }
.as-h3 { margin: 20px 0 8px; font: 700 1.0625rem/1.4 var(--font-head); }
.as-h3 small { display: block; font: 400 .875rem/1.5 var(--font-body, inherit); color: var(--ink-soft); }
.as-iss { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.as-iss li { padding: 10px 12px 10px 14px; border-radius: 10px; border-left: 4px solid var(--line-strong); background: #F7FAFC; font-size: .9375rem; line-height: 1.6; }
.as-iss li.bad { border-left-color: var(--as-bad); background: var(--as-bad-soft); }
.as-iss li.warn { border-left-color: var(--as-hol); background: var(--as-hol-soft); }
.as-law { display: block; font-size: .875rem; margin-top: 2px; }
.as-ok { font-size: .9375rem; color: var(--ink-soft); }
.as-note-s { font-size: .875rem; color: var(--ink-soft); line-height: 1.6; margin: 10px 0 0; }

/* 範本那張表：寬，放在可以左右捲的框裡（不撐開整頁） */
.as-tw { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.as-tw:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.as-table { border-collapse: collapse; min-width: 980px; width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
.as-table th, .as-table td { border: 1px solid var(--line); padding: 6px 6px; text-align: center; white-space: nowrap; }
.as-table thead th { background: #F2F6FA; font-weight: 700; position: sticky; top: 0; }
.as-table td:first-child { text-align: left; position: sticky; left: 0; background: inherit; }
.as-table tbody tr { background: #fff; }
.as-table tr.k-rest, .as-table tr.k-regular { background: var(--as-off-soft); }
.as-table tr.k-holiday { background: var(--as-hol-soft); }
.as-table tr.bad td { color: var(--as-bad); font-weight: 700; }
.as-table td.ot { color: #8A3B12; font-weight: 700; }
.as-table tr.tot td { font-weight: 700; background: #F2F6FA; }

/* 付費：員工名冊（每月一組，每位員工一列） */
.as-pro { margin-top: var(--s3); background: var(--accent-soft); border-radius: var(--radius); padding: var(--s3); }
.as-pro h2 { font: 900 1.15rem var(--font-head); margin: 0 0 6px; }
.as-pro-lede, .as-pro-empty { font-size: .9375rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 10px; }
.as-pro-msg { min-height: 1.4em; margin: 8px 0 0; font-size: .9375rem; font-weight: 700; color: var(--accent); }
.as-months, .as-people { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.as-months > li { background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; }
.as-months .t { margin: 0 0 6px; font-weight: 800; }
.as-months .t small { margin-left: 8px; font-weight: 400; color: var(--ink-soft); font-size: .875rem; }
.as-months .b, .as-people li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.as-people li { border-top: 1px solid var(--line); padding-top: 8px; }
.as-people li > span:first-child { font-weight: 700; min-width: 5em; }
.as-people .v { font-size: .9375rem; font-variant-numeric: tabular-nums; margin-right: auto; color: var(--ink-soft); }
.as-pro .btn { min-height: 44px; padding: 0 12px; font-size: .9375rem; }

@media (min-width: 640px) {
  .as-row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .as-day { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 44px minmax(0, 1.6fr); }
  .as-ds { grid-column: auto; }
  .as-extra { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .as-extra .as-note { grid-column: auto; }
}
@media (min-width: 960px) {
  .as-day { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .as-ds { grid-column: 1 / -1; }
  .as-out { position: sticky; top: 16px; }
}
@media print {
  .as-in, .as-actions, .as-msg { display: none !important; }
  .as-tw { overflow: visible; border: 0; }
  .as-table { min-width: 0; font-size: 8pt; }
}
