/* ============================================================
   考勤记录 · 考勤日历（/records）页面样式 — owner: calendar-dev
   仅使用设计 token，深色模式自动跟随 body.theme-dark
   ============================================================ */

/* ---------- 页面与月份头部 ---------- */
.rp-page { padding-top: 6px; }

.rp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 2px 0 12px;
}
.rp-month-row { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }

.rp-arrow {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.rp-arrow .icon { width: 19px; height: 19px; stroke-width: 2; }
.rp-arrow:active { background: var(--bg-2); transform: scale(.94); }
.rp-arrow:disabled { opacity: .26; pointer-events: none; }

.rp-month-text { flex: 1; min-width: 0; padding: 0 2px; }
.rp-month-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 21px; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.2; white-space: nowrap;
}
.rp-month-title em {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  height: 17px; line-height: 17px; padding: 0 6px; border-radius: 5px;
  color: var(--brand-600); background: var(--brand-100);
}
.rp-month-sub {
  margin-top: 3px; font-size: 11px; color: var(--text-3);
  line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rp-today-btn {
  flex: none; height: 40px; padding: 0 13px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-100); color: var(--brand-600);
  font-size: 12.5px; font-weight: 650;
  transition: transform var(--dur-1), background var(--dur-1);
}
.rp-today-btn i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.rp-today-btn:active { transform: scale(.95); background: var(--brand-200); }

/* ---------- 本月概览 ---------- */
.rp-overview {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px; padding: 11px 2px 10px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.rp-ov { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rp-ov + .rp-ov::before {
  content: ""; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 1px; background: var(--line-2);
}
.rp-ov-val {
  font-family: var(--font-num); font-size: 21px; font-weight: 750;
  line-height: 1.1; letter-spacing: -.02em; color: var(--text-1);
}
.rp-ov-val small {
  margin-left: 2px; font-size: 10px; font-weight: 600;
  letter-spacing: 0; color: var(--text-3);
}
.rp-ov-val.is-warn { color: var(--warning-deep); }
.rp-ov-val.is-danger { color: var(--danger-deep); }
.rp-ov-val.is-brand { color: var(--brand-600); }
.rp-ov-label { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-3); }
.rp-ov-label i { width: 5px; height: 5px; border-radius: 50%; }

/* ---------- 月历 ---------- */
.rp-cal-card { padding: 13px 12px 11px; border-radius: var(--r-l); margin-bottom: 18px; }

.rp-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.rp-week span {
  height: 20px; line-height: 20px; text-align: center;
  font-size: 10.5px; font-weight: 600; color: var(--text-4);
}
.rp-week span.is-weekend { color: var(--text-3); }

.rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.rp-day {
  position: relative; height: 42px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-1); font-family: var(--font-num);
  transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.rp-day-num { font-size: 14.5px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.rp-day-dots { height: 5px; display: flex; align-items: center; justify-content: center; }
.rp-day-dot { width: 5px; height: 5px; border-radius: 50%; }

.rp-day.is-weekend .rp-day-num { color: var(--text-3); }
.rp-day.is-future { opacity: .42; }
.rp-day.is-out { opacity: .24; }
.rp-day:disabled { pointer-events: none; }

.rp-day.is-today::before {
  content: ""; position: absolute; inset: 2px; border-radius: 10px;
  border: 1.4px solid var(--brand-300); pointer-events: none;
}
.rp-day.is-today .rp-day-num { color: var(--brand-600); font-weight: 750; }

.rp-day.is-selected {
  background: var(--brand); color: #fff;
  box-shadow: var(--brand-glow); transform: translateY(-1px);
  opacity: 1;
}
.rp-day.is-selected::before { border-color: transparent; }
.rp-day.is-selected .rp-day-num { color: #fff; font-weight: 750; }
.rp-day.is-selected .rp-day-dot { background: rgba(255, 255, 255, .92); }

.rp-day:not(:disabled):active { background: var(--bg-2); }
.rp-day.is-selected:active { background: var(--brand-600); }

.rp-legend {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed var(--line-2);
}
.rp-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-3); }
.rp-legend i { width: 5px; height: 5px; border-radius: 50%; }

/* 状态圆点配色（日历 + 图例 + 概览） */
.rp-day-dot.is-normal, .rp-legend i.is-normal, .rp-ov-label i.is-normal { background: var(--success); }
.rp-day-dot.is-overtime, .rp-legend i.is-overtime, .rp-ov-label i.is-overtime { background: var(--warning); }
.rp-day-dot.is-missing, .rp-legend i.is-missing, .rp-ov-label i.is-missing { background: var(--danger); }
.rp-day-dot.is-leave, .rp-legend i.is-leave, .rp-ov-label i.is-leave { background: var(--brand); }
.rp-day-dot.is-rest, .rp-legend i.is-rest { background: var(--text-4); }

/* ---------- 本月记录 ---------- */
.rp-sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 0 2px 10px;
}
.rp-sec-title {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 16px; font-weight: 700; letter-spacing: -.015em;
}
.rp-sec-title em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.rp-sec-note { font-size: 10.5px; color: var(--text-4); }

.rp-chips { display: flex; gap: 8px; padding-bottom: 12px; }
.rp-chip {
  flex: none; height: 34px; padding: 0 12px; border-radius: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.rp-chip-n { font-family: var(--font-num); font-size: 9.5px; font-weight: 700; color: var(--text-4); }
.rp-chip.is-active {
  background: var(--brand-100); border-color: var(--brand-200);
  color: var(--brand-600); font-weight: 650;
}
.rp-chip.is-active .rp-chip-n { color: var(--brand-600); opacity: .75; }
.rp-chip:active { transform: scale(.96); }

.rp-list { overflow: hidden; }
.rp-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 11px 14px;
  text-align: left; transition: background var(--dur-1);
}
.rp-row + .rp-row { border-top: 1px solid var(--line-2); }
.rp-row:active { background: var(--card-2); }
.rp-row-date {
  width: 38px; flex: none; display: flex; flex-direction: column; gap: 1px;
  text-align: center;
}
.rp-row-date b {
  font-family: var(--font-num); font-size: 18px; font-weight: 700;
  line-height: 1.1; letter-spacing: -.02em;
}
.rp-row-date span { font-size: 9.5px; color: var(--text-3); }
.rp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rp-row-times {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-num); font-size: 13px; font-weight: 650;
  letter-spacing: .01em; color: var(--text-1);
}
.rp-row-times i { flex: none; width: 12px; height: 1px; background: var(--line); }
.rp-row-leave {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 650; color: var(--brand-600);
}
.rp-row-sub { font-size: 10.5px; line-height: 1.35; color: var(--text-3); }
.rp-row .status-pill { flex: none; }
.rp-empty { padding: 2px; }

/* ---------- 日详情 sheet ---------- */
.rp-sheet-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 2px 0 14px;
}
.rp-sheet-status-main { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.rp-sheet-status-text { font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.rp-sheet-hrs { flex: none; display: flex; align-items: baseline; gap: 3px; }
.rp-sheet-hrs b {
  font-family: var(--font-num); font-size: 30px; font-weight: 750;
  line-height: 1; letter-spacing: -.04em;
}
.rp-sheet-hrs span { font-size: 10.5px; font-weight: 600; color: var(--text-3); }

.rp-punches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-punch {
  padding: 11px 12px 12px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--line-2);
}
.rp-punch.is-missing { background: var(--danger-soft); border-color: transparent; }
.rp-punch.is-pending { border-style: dashed; background: var(--card); }
.rp-punch-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rp-punch-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
}
.rp-punch-label .icon { width: 12px; height: 12px; }
.rp-punch-state { font-size: 9px; font-weight: 650; color: var(--text-4); }
.rp-punch-state.is-missing { color: var(--danger-deep); }
.rp-punch-time {
  margin-top: 3px; font-size: 25px; font-weight: 750;
  line-height: 1.15; letter-spacing: -.035em;
}
.rp-punch-time.is-empty { font-size: 22px; font-weight: 650; color: var(--text-4); }
.rp-punch-loc { margin-top: 4px; font-size: 10px; line-height: 1.3; color: var(--text-2); }
.rp-punch-method {
  margin-top: 2px; font-family: var(--font-num); font-size: 9px;
  letter-spacing: .01em; color: var(--text-4);
}
.rp-punch-method.is-missing {
  font-family: var(--font-sans); font-weight: 600; color: var(--danger-deep);
}

.rp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rp-fact {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 12px; background: var(--card-2);
}
.rp-fact-label { font-size: 10px; color: var(--text-3); }
.rp-fact-val { font-family: var(--font-num); font-size: 18px; font-weight: 700; line-height: 1.2; }
.rp-fact-val small {
  margin-left: 2px; font-family: var(--font-sans);
  font-size: 9.5px; font-weight: 600; color: var(--text-3);
}
.rp-fact-val.is-warn { color: var(--warning-deep); }

.rp-detail { margin-top: 12px; border-top: 1px solid var(--line-2); }
.rp-detail-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 9px 0; font-size: 12.5px;
}
.rp-detail-row + .rp-detail-row { border-top: 1px solid var(--line-2); }
.rp-detail-row > span { flex: none; color: var(--text-3); }
.rp-detail-row > b { font-weight: 600; text-align: right; color: var(--text-1); word-break: break-word; }
.rp-detail-row > b.is-warn { color: var(--warning-deep); }

/* ---------- 动效 ---------- */
@keyframes rpFadeIn {
  from { opacity: .3; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.rp-anim { animation: rpFadeIn .28s var(--ease-out) both; }
