﻿/* 团队出勤页样式 + 图表基础 */
/* 由 chart-dev 填充；请只在本文件内追加，避免修改共享 CSS */

/* ---- chart primitives (shared with charts.js) ---- */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.chart-legend .lg-item i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.chart-legend .lg-item b { font-family: var(--font-num); color: var(--text-2); font-weight: 650; }
.donut { position: relative; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.donut-center b { font-size: 25px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.donut-center span { font-size: 9.5px; color: var(--text-3); }
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.ring-center b { font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.ring-center span { font-size: 9px; color: var(--text-3); }
.h-bars { display: flex; flex-direction: column; gap: 10px; }
.h-bar-row { display: flex; align-items: center; gap: 9px; }
.h-bar-label { width: 46px; flex: none; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-bar-track { flex: 1; height: 7px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.h-bar-track i { display: block; height: 100%; border-radius: 4px; }
.h-bar-val { width: 38px; text-align: right; font-size: 10.5px; color: var(--text-3); flex: none; }
.spark { display: block; }

/* ============================================================
   团队出勤页 /team
   ============================================================ */
.sp-top { padding-top: 8px; }
.sp-seg button { font-size: 13px; }
.sp-cap {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 2px 0; font-size: 10.5px; color: var(--text-3); font-weight: 500;
}
.sp-cap-right { color: var(--text-4); flex: none; }
.sp-body { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

/* ---- KPI 总览 ---- */
.sp-hero { padding: 16px; }
.sp-hero-top { display: flex; align-items: center; gap: 18px; }
.sp-hero-side { display: grid; gap: 12px; flex: 1; min-width: 0; }
.sp-kpi { display: flex; flex-direction: column; gap: 1px; }
.sp-kpi-label { font-size: 11px; color: var(--text-3); font-weight: 500; line-height: 1.3; }
.sp-kpi-val { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.sp-kpi-val b {
  font-family: var(--font-num); font-size: 21px; font-weight: 750;
  letter-spacing: -.02em; line-height: 1.15;
}
.sp-kpi-val small { font-size: 10.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.sp-hero .ring-center b { font-size: 19px; }
.sp-hero-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.sp-metric { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sp-metric + .sp-metric::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px;
  width: 1px; background: var(--line-2);
}
.sp-metric-label { font-size: 10.5px; color: var(--text-3); }
.sp-metric b {
  display: flex; align-items: baseline; gap: 1px;
  font-family: var(--font-num); font-size: 16px; font-weight: 700; letter-spacing: -.01em;
}
.sp-metric b small { font-size: 10px; font-weight: 600; color: var(--text-3); }
.sp-metric b.is-warn { color: var(--warning-deep); }
.sp-metric b.is-danger { color: var(--danger); }
.sp-hero-foot { margin-top: 10px; font-size: 10px; line-height: 1.5; color: var(--text-4); }

/* ---- 洞察 ---- */
.sp-insight {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--r-m);
  background: var(--brand-100);
  border: 1px solid var(--brand-200);
}
.sp-insight-ico { flex: none; color: var(--brand); margin-top: 1px; }
.sp-insight-ico .icon { width: 15px; height: 15px; stroke-width: 1.9; }
.sp-insight-lines { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sp-insight-lines p { font-size: 11.5px; line-height: 1.55; color: var(--text-2); }
.sp-insight-lines p b { color: var(--brand-600); font-weight: 700; }

/* ---- 通用图表卡 ---- */
.sp-card .card-head { margin-bottom: 10px; }
.sp-head-sub { font-size: 10.5px; color: var(--text-3); font-weight: 500; white-space: nowrap; flex: none; }
.sp-head-sub b { font-family: var(--font-num); font-size: 12px; color: var(--text-2); font-weight: 700; }
.sp-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; font-size: 10px; color: var(--text-4); line-height: 1.5;
}
.sp-card-foot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 出勤构成 ---- */
.sp-donut-row { display: flex; align-items: center; gap: 16px; }
.sp-donut-side { flex: 1; min-width: 0; }
.sp-donut-side .chart-legend { margin-top: 0; gap: 9px 10px; }
.sp-donut-side .chart-legend .lg-item { font-size: 11px; }
.sp-donut-side .chart-legend .lg-item b { font-size: 11.5px; }

/* ---- 团队入口 ---- */
.sp-team-entry { margin-top: 14px; }
.sp-team-entry .icon { width: 16px; height: 16px; }
.sp-empty-card { margin: 0; }
.sp-foot { text-align: center; font-size: 10px; color: var(--text-4); padding: 2px 0 4px; }

/* ============================================================
   团队出勤页 /team
   ============================================================ */
.sp-tov { padding: 16px; }
.sp-tov-top { display: flex; align-items: center; gap: 16px; }
.sp-tov-main { flex: 1; min-width: 0; }
.sp-tov-title { font-size: 12.5px; color: var(--text-2); font-weight: 550; display: flex; align-items: baseline; }
.sp-tov-title b {
  font-family: var(--font-num); font-size: 26px; font-weight: 750;
  letter-spacing: -.02em; color: var(--text-1); margin: 0 1px 0 5px; line-height: 1.1;
}
.sp-tov-title small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.sp-tov-sub {
  font-size: 10.5px; color: var(--text-3); margin-top: 3px; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-tov-bar { margin-top: 9px; }
.sp-tov-bar .bar { height: 5px; }
.sp-tov-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.sp-tstat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sp-tstat + .sp-tstat::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 1px; background: var(--line-2);
}
.sp-tstat b {
  font-family: var(--font-num); font-size: 17px; font-weight: 700;
  letter-spacing: -.01em; line-height: 1.2;
}
.sp-tstat span { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.sp-tstat.is-success b { color: var(--success-deep); }
.sp-tstat.is-brand b { color: var(--brand); }
.sp-tstat.is-cyan b { color: var(--cyan); }
.sp-tstat.is-danger b { color: var(--danger); }

/* ---- 搜索 + 筛选 ---- */
.sp-toolbar { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sp-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-m); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1), box-shadow var(--dur-2);
}
.sp-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.sp-search-ico { display: flex; color: var(--text-3); }
.sp-search-ico .icon { width: 16px; height: 16px; }
.sp-search-input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  font-size: 14px; color: var(--text-1);
}
.sp-search-input::placeholder { color: var(--text-4); }
.sp-clear {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--bg-2); color: var(--text-3);
}
.sp-clear .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.sp-fseg button { font-size: 12px; }
.sp-fseg .seg-count { height: 14px; min-width: 14px; font-size: 9.5px; }

/* ---- 成员列表 ---- */
.sp-list-area { margin-top: 12px; }
.sp-list {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-l); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.sp-row {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 66px; padding: 12px 14px;
  text-align: left; transition: background var(--dur-1);
}
.sp-row:active { background: var(--card-2); }
.sp-row + .sp-row::before {
  content: ""; position: absolute; top: 0; left: 65px; right: 14px;
  height: 1px; background: var(--line-2);
}
.sp-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sp-row-name {
  display: flex; align-items: center; gap: 5px;
  font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-row-role {
  font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-me {
  flex: none; font-style: normal; font-size: 9.5px; font-weight: 700;
  line-height: 1; padding: 2px 4px; border-radius: 4px;
  color: var(--brand-600); background: var(--brand-100);
}
.sp-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.sp-row-time {
  font-family: var(--font-num); font-size: 12.5px; font-weight: 650;
  color: var(--text-2); letter-spacing: -.01em; line-height: 1.1;
}
.sp-row-time.is-empty { color: var(--text-4); font-weight: 500; }
.sp-row .status-pill { height: 20px; padding: 0 7px; font-size: 10.5px; border-radius: 6px; gap: 4px; }
.sp-row .status-pill i { width: 5px; height: 5px; }
/* 外出：沿用 HIIUI 深青文字保证浅色模式对比度，深色模式切回变量青 */
.status-pill.sp-pill--outing { color: #0b9e9b; background: var(--cyan-soft); }
body.theme-dark .status-pill.sp-pill--outing { color: var(--cyan); }
.sp-count { margin-top: 10px; text-align: center; font-size: 10.5px; color: var(--text-4); }

/* ---- 成员详情 sheet ---- */
.sp-sheet-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sp-sheet-info { min-width: 0; }
.sp-sheet-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 16px; font-weight: 650; letter-spacing: -.01em;
}
.sp-sheet-role { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.sp-sheet-pill { margin-top: 7px; }
.sp-sheet-pill .status-pill { height: 21px; padding: 0 8px; font-size: 10.5px; }
.sp-sheet-card {
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
}
.sp-sheet-hours { align-items: flex-start; }
.sp-sheet-hrs { display: flex; align-items: baseline; gap: 2px; }
.sp-sheet-hrs b {
  font-family: var(--font-num); font-size: 27px; font-weight: 750;
  letter-spacing: -.02em; line-height: 1.1;
}
.sp-sheet-hrs span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.sp-sheet-daily {
  text-align: right; font-size: 11px; color: var(--text-2); line-height: 1.5;
  padding-top: 2px;
}
.sp-sheet-daily b { font-family: var(--font-num); font-size: 13px; font-weight: 700; color: var(--text-1); }
.sp-sheet-daily span { font-size: 10px; color: var(--text-4); }
.sp-sheet-card .chart-svg { margin-top: 6px; }
.sp-sec-label {
  display: flex; align-items: center; gap: 5px;
  margin: 16px 0 8px; font-size: 12px; font-weight: 650; color: var(--text-2);
}
.sp-sec-label .icon { width: 14px; height: 14px; color: var(--text-3); }
.sp-kv {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0;
}
.sp-kv + .sp-kv { border-top: 1px solid var(--line-2); }
.sp-kv > span { font-size: 12px; color: var(--text-3); flex: none; }
.sp-kv > b {
  font-size: 12px; font-weight: 600; color: var(--text-1); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


