/* 打卡記錄頁(2026-08-17)。跟設計交接嘅色票同尺寸。
 *
 * **點解自己一個 css 檔、唔改 style.css**:style.css 係首頁嘅版面骨架,
 * 呢版係獨立一版(同 itops 一樣),兩邊唔應該互相影響。
 * 而且首頁嗰邊有另一手同時做緊嘢,唔好無端端郁佢張枱。
 *
 * ⚠️ **冇「下班打卡」同「工時」兩欄** —— 唔係漏,係冇數據(見 api/attendance.js 開頭)。
 * 所以表格由設計稿嘅五欄變三欄。
 */

.att-body {
  margin: 0;
  background: #f6f7f8;
  color: #1f2328;
  font-family: "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
}

.att-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── 攔路牌(未登入 / 攞唔到嘢)──────────────────────────── */
.att-gate {
  max-width: 460px;
  margin: 80px auto;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
.att-gate p { margin: 0 0 14px; font-size: 14px; color: #57606a; }

/* ── 頁頭 ──────────────────────────────────────────────── */
.att-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.att-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.att-sub { margin: 4px 0 0; font-size: 13px; color: #8b949e; }
.att-head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.att-btn,
.att-stepper {
  background: #fff;
  border: 1px solid #eceef0;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  color: #57606a;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .12s ease;
}
.att-btn:hover, .att-stepper:hover { border-color: #e2e5e8; }

.att-stepper { display: flex; align-items: center; gap: 10px; cursor: default; }
.att-stepper span { font-weight: 500; color: #1f2328; font-variant-numeric: tabular-nums; }
.att-stepper button {
  border: 0; background: none; color: #8b949e;
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px;
  font-family: inherit;
}
.att-stepper button:hover { color: #1f2328; }
.att-stepper button:disabled { color: #c3c9cf; cursor: default; }

/* ── 卡殼 ──────────────────────────────────────────────── */
.att-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  padding: 16px 18px;
}
.att-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.att-muted { font-size: 12px; color: #8b949e; }

/* ── 四級 KPI 卡 ───────────────────────────────────────── */
.att-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.att-kpi {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  border-top: 3px solid var(--lv);
}
.att-kpi-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #57606a; }
.att-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lv); flex: none; }
.att-kpi-n {
  margin-top: 8px;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.att-kpi-n small { font-size: 12px; font-weight: 400; color: #8b949e; margin-left: 3px; }
.att-kpi-rule { margin: 4px 0 0; font-size: 12px; color: #8b949e; }

/* ── 明細 + 側欄 ───────────────────────────────────────── */
.att-content { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.att-table-card { flex: 1; min-width: 420px; padding: 0; overflow: hidden; }
.att-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 16px; }

.att-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid #f2f3f5;
  display: flex; align-items: center; gap: 10px;
}
.att-card-head h2 { margin: 0; }
.att-chips { margin-left: auto; display: flex; gap: 6px; }
.att-chip {
  border: 0; background: none; font-family: inherit;
  font-size: 12px; color: #8b949e;
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
  transition: background-color .12s ease;
}
.att-chip:hover { background: #f6f7f8; }
.att-chip.on { background: #eef4ee; color: #15803d; font-weight: 500; }

/* 三欄:日期 / 上班打卡 / 狀態 */
.att-row {
  display: grid;
  grid-template-columns: 110px 1fr 140px;
  gap: 0 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #f5f6f7;
  background: var(--tint, #fff);
  transition: background-color .12s ease;
}
.att-row-head {
  padding: 10px 18px;
  background: #fafbfc;
  font-size: 12px; color: #8b949e;
  border-bottom: 1px solid #f2f3f5;
}
#rows .att-row:hover { background: #fafbfc; }

.att-d1 { font-size: 14px; font-weight: 500; }
.att-d2 { font-size: 11px; color: #8b949e; margin-top: 1px; }
.att-in { display: flex; align-items: center; gap: 8px; }
.att-in .att-dot { width: 7px; height: 7px; }
.att-time { font-size: 14px; font-variant-numeric: tabular-nums; }
.att-delta { font-size: 11px; }

.att-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
}
.att-pill .att-dot { width: 6px; height: 6px; }

.att-empty { padding: 28px 18px; text-align: center; font-size: 13px; color: #8b949e; margin: 0; }

/* ── 月曆 ──────────────────────────────────────────────── */
.att-cal-head, .att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.att-cal-head { font-size: 11px; color: #8b949e; text-align: center; margin-bottom: 6px; }
.att-cal span {
  aspect-ratio: 1; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-variant-numeric: tabular-nums;
  background: #fafbfc; color: #c3c9cf;
}
.att-cal span.blank { background: transparent; }
.att-cal span.has { font-weight: 700; }

/* ── 顏色說明 ──────────────────────────────────────────── */
.att-legend { display: flex; flex-direction: column; gap: 10px; }
.att-legend > div { display: flex; gap: 10px; align-items: flex-start; }
.att-sw { width: 14px; height: 14px; border-radius: 4px; margin-top: 2px; flex: none; background: var(--lv); }
.att-legend b { font-size: 13px; font-weight: 500; display: block; }
.att-legend small { font-size: 12px; color: #8b949e; margin-top: 1px; display: block; }

/* ── 本月統計 ──────────────────────────────────────────── */
.att-stats { display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: #57606a; }
.att-stats > div { display: flex; }
.att-stats b { margin-left: auto; font-weight: 700; color: #1f2328; font-variant-numeric: tabular-nums; }

/* ── 窄版 ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .att-side { width: 100%; }
}
@media (max-width: 820px) {
  .att-kpis { grid-template-columns: repeat(2, 1fr); }
  .att-table-card { min-width: 0; }
  /* 表格橫向捲,但日期欄唔准縮(設計交接指定) */
  .att-table-scroll { overflow-x: auto; }
  .att-table-scroll > * { min-width: 420px; }
}

/* ── 揀同事(D217 重開,老闆 2026-09-09):淨係職級 1 見到 ───────── */
.att-who { display: inline-flex; align-items: center; gap: 6px; }
.att-who-label { font-size: 13px; color: #6b7280; }
.att-who select {
  height: 32px; padding: 0 8px;
  border: 1px solid #d9dce1; border-radius: 6px;
  background: #fff; font: inherit; font-size: 13px; color: #1f2937;
}
