* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #e7eaf0;
  --text: #1c2430;
  --muted: #7b8794;
  --brand: #1d6fe0;
  --brand-d: #1557b0;
  --ok: #15a06a;
  --warn: #d98b18;
  --bad: #d9483b;
  --nav: #16202e;
  --nav-text: #c9d4e2;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.10);
  --radius: 14px;
  --radius-sm: 9px;
}
[data-theme="dark"] {
  --bg: #0e131a;
  --panel: #161e2a;
  --panel-2: #1b2533;
  --line: #28323f;
  --text: #e7eef6;
  --muted: #8a97a8;
  --brand: #4a93f0;
  --brand-d: #2f7fe0;
  --ok: #2dd4a0;
  --warn: #e0a33a;
  --bad: #f0705f;
  --nav: #0a0e14;
  --nav-text: #aeb9c7;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#16202e,#26405f); }
.login-card { width: 380px; background: #fff; border-radius: 14px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 布局 */
.app { display: flex; height: 100vh; overflow: hidden; }
.side { width: 200px; background: var(--nav); color: #c9d4e2; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 20px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.side nav { flex: 1; padding: 12px 0; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 2px 10px; border-radius: 8px; color: var(--nav-text); text-decoration: none; font-size: 14px; cursor: pointer; transition: background .15s, color .15s; }
.side nav a svg { flex: 0 0 auto; opacity: .82; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.active { background: rgba(74,147,240,.16); color: #fff; box-shadow: inset 3px 0 0 var(--brand); font-weight: 500; }
.nav-group { margin: 4px 0; }
.nav-group-title { padding: 14px 16px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.32); }
.btn.tiny#theme-btn { margin-top: 2px; }
.me { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.me-name { color: #fff; font-weight: 500; }
.me-role { color: #7f8fa3; font-size: 12px; margin: 3px 0 10px; }
main { flex: 1; padding: 24px 28px; overflow: auto; }

/* 组件 */
.btn { padding: 9px 16px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; color: var(--text); }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-d); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c5c0; }
.btn.danger:hover { background: #fdf0ef; color: var(--bad); border-color: var(--bad); }
.btn.tiny { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { padding: 16px 40px; font-size: 17px; border-radius: 40px; }
.btn.sm { padding: 2px 10px; font-size: 13px; border-radius: 12px; }

h2.page { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
p.desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.spacer { flex: 1 !important; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px; background: #f7f8fa; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f0f2f4; }
tr:hover td { background: #fafbfc; }
.num { text-align: center; font-variant-numeric: tabular-nums; }
th.num { text-align: center; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 600; margin-top: 6px; }
/* 顶部统计卡：左侧加彩色竖线，按指标区分 */
.stat-grid > .stat { border-left-width: 4px; }
.stat-grid > .stat:nth-child(1) { border-left-color: var(--brand); }
.stat-grid > .stat:nth-child(2) { border-left-color: var(--ok); }
.stat-grid > .stat:nth-child(3) { border-left-color: var(--warn); }
.stat-grid > .stat:nth-child(4) { border-left-color: var(--bad); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; background: #eef1f4; color: #5a6673; margin-right: 4px; }
.tag.ok { background: #e5f6ee; color: #0f7a52; }
.tag.warn { background: #fdf3e2; color: #96601a; }
.tag.bad { background: #fdeceb; color: #a83226; }
.tag.info { background: #e8f1fd; color: #1557b0; }

/* 打卡区 */
.clock-box { text-align: center; padding: 30px 20px; }
.clock-time { font-size: 40px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.clock-date { color: var(--muted); margin-bottom: 22px; }
.gps-info { font-size: 12px; color: var(--muted); margin: 14px 0; line-height: 1.8; }
.gps-info b { color: var(--text); font-weight: 500; }
.cam-box { width: 220px; height: 165px; margin: 0 auto 14px; background: #eef1f4; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.cam-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-box img { width: 100%; height: 100%; object-fit: cover; }
.notice { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.notice.ok { background: #e5f6ee; color: #0f7a52; }
.notice.bad { background: #fdeceb; color: #a83226; }
.notice.info { background: #e8f1fd; color: #1557b0; }

/* 轻提示：接口失败时的全局兜底，避免「点了没反应」 */
#toast-wrap {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; max-width: 76vw;
}
.toast {
  padding: 10px 18px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  background: #ffffff; color: #1f2d3d; box-shadow: 0 6px 22px rgba(0, 0, 0, .16);
  animation: toast-in .18s ease-out;
}
.toast.bad { background: #fdeceb; color: #a83226; }
.toast.ok { background: #e5f6ee; color: #0f7a52; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chk input { width: auto; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; }
.bar { height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }

/* 仪表盘 */
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat .sub a { color: var(--brand); text-decoration: none; font-weight: 500; }
.stat .sub a:hover { text-decoration: underline; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f2f4; }
.bar-row:last-child { border-bottom: none; }
.bar-label { font-size: 13px; font-weight: 500; color: var(--text); }
.bar-track { height: 10px; background: #eef1f4; border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4a93f0); border-radius: 5px; transition: width .3s ease; }
.bar-val { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* 数据统计页 tab */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 20px; cursor: pointer; font-size: 14px; color: var(--muted);
       border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* ================= 移动端适配 =================
   背景：iPhone 员工走 H5 网页端打卡（没有原生 iOS App）。
   原本 0 条 @media，手机上会按桌面布局渲染——侧边栏占 200px、表格溢出。
   这里只在窄屏生效，桌面端外观完全不变。
   断点取 768px：覆盖手机竖屏与横屏；iPad 竖屏(768)以上仍走桌面布局。 */
@media (max-width: 768px) {
  /* 侧边栏 → 顶部横向滚动导航条 */
  .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .side {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: env(safe-area-inset-top);
  }
  .side::-webkit-scrollbar { display: none; }
  .brand {
    padding: 14px 14px;
    font-size: 15px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .side nav {
    display: flex;
    flex: 1 1 auto;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a {
    padding: 14px 15px;
    white-space: nowrap;
    font-size: 14px;
  }
  .me {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,.08);
    flex: 0 0 auto;
  }
  /* 姓名/角色占位太宽，手机上隐藏，退出按钮保留 */
  .me-name, .me-role { display: none; }
  .me .btn { white-space: nowrap; }

  /* 内容区：收窄留白 + 底部安全区（iPhone 横条） */
  main { padding: 12px 10px calc(24px + env(safe-area-inset-bottom)); }

  /* 多列网格 → 单列，否则输入框会被压到无法使用 */
  .g2, .g3, .g4 { grid-template-columns: 1fr; }

  /* 表格：让卡片自身横向滚动，表格按内容宽度展开，不挤压列 */
  .card { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table { min-width: max-content; }
  th, td { padding: 8px 10px; }

  /* iOS Safari 会在输入框字号 <16px 时自动放大页面，导致点一下就缩放 */
  input, select, textarea { font-size: 16px; }

  /* 登录卡片固定 380px 会在手机上溢出 */
  .login-wrap { padding: 16px; }
  .login-card { width: 100%; max-width: 380px; padding: 24px; }

  /* 打卡区 */
  .clock-box { padding: 20px 12px; }
  .clock-time { font-size: 34px; letter-spacing: 1px; }
  .cam-box { width: 180px; height: 135px; }

  /* 仪表盘 / 统计 */
  .stat { padding: 14px; }
  .stat .v { font-size: 22px; }
  .bar-row { grid-template-columns: 78px 1fr 70px; gap: 8px; }

  /* 页签横向滚动 */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 9px 14px; white-space: nowrap; }

  /* 操作按钮在窄屏下换行排列，避免挤出屏幕 */
  .row { gap: 8px; }
  .btn { padding: 8px 13px; }
  .btn.tiny { padding: 5px 9px; font-size: 12px; }
  .btn.big { padding: 14px 32px; font-size: 16px; }
}

/* 现场校验白名单（基站 / WiFi BSSID）逐条可视化管理 */
.wl-item-row { display: flex; gap: 4px; align-items: center; }
.wl-item-row input { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.wl-item { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-more { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ================= 精致升级（视觉打磨） ================= */
body { transition: background .2s ease, color .2s ease; }
.side { transition: background .2s ease; }
.card, .stat, .btn, .tab { transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease, background .15s ease; }
.card { box-shadow: var(--shadow); border-radius: var(--radius); }
.card:hover { box-shadow: var(--shadow-lg); }
.stat { box-shadow: var(--shadow); border-radius: var(--radius); }
.stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
h2.page { letter-spacing: .01em; }
.btn { border-radius: var(--radius-sm); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tab { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab.active { font-weight: 600; }
th { background: var(--panel-2); }
tr:hover td { background: var(--panel-2); }
.bar-fill { border-radius: 5px; }
.notice { box-shadow: var(--shadow); }
.empty { color: var(--muted); }

/* 暗色主题下的硬编码中性色覆盖（原样式用死值，亮色下没问题，暗色需回退） */
[data-theme="dark"] .card, [data-theme="dark"] .stat { background: var(--panel); }
[data-theme="dark"] th { background: #1b2533; color: #8a97a8; }
[data-theme="dark"] tr:hover td { background: #1b2533; }
[data-theme="dark"] .bar, [data-theme="dark"] .bar-track { background: #28323f; }
[data-theme="dark"] .cam-box { background: #1b2533; color: var(--muted); }
[data-theme="dark"] .shift-row { background: #1b2533 !important; }
[data-theme="dark"] .notice.ok { background: rgba(45,212,160,.12); color: #2dd4a0; }
[data-theme="dark"] .notice.bad { background: rgba(240,112,95,.14); color: #f0705f; }
[data-theme="dark"] .notice.info { background: rgba(74,147,240,.14); color: #8cc0f7; }
[data-theme="dark"] .tag { background: #243044; color: #9fb0c4; }
[data-theme="dark"] .tag.ok { background: rgba(45,212,160,.15); color: #4fd9ad; }
[data-theme="dark"] .tag.warn { background: rgba(224,163,58,.15); color: #e9b659; }
[data-theme="dark"] .tag.bad { background: rgba(240,112,95,.15); color: #f5877a; }
[data-theme="dark"] .tag.info { background: rgba(74,147,240,.15); color: #8cc0f7; }
[data-theme="dark"] .login-wrap { background: linear-gradient(135deg,#0a0e14,#101a2b); }
[data-theme="dark"] .wl-item, [data-theme="dark"] .wl-item-row input { color: #aeb9c7; }

/* ===== 概览页：异常卡 / 环比 / 实时出勤 / 供应商对比行 ===== */
.stat.anom { background: #fdeceb; }
.stat.anom .v { color: var(--bad); }
.up { color: var(--ok); }
.down { color: var(--bad); }
.realtime { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.realtime .rt-l { font-size: 12px; color: var(--muted); }
.realtime .rt-big { font-size: 24px; font-weight: 600; line-height: 1.1; }
.realtime .rt-info { font-size: 13px; color: var(--muted); }
.realtime .rt-info b { color: var(--text); }
.realtime .rt-info a { color: var(--brand); text-decoration: none; font-weight: 500; }
.realtime .rt-info a:hover { text-decoration: underline; }
.sup-row { display: grid; grid-template-columns: 108px 1fr 150px 104px; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.sup-row:hover { background: #f5f7f9; }

/* 暗色主题下的概览样式覆盖 */
[data-theme="dark"] .stat.anom { background: rgba(240,112,95,.12); }
[data-theme="dark"] .realtime { background: var(--panel); }
[data-theme="dark"] .sup-row:hover { background: #1f2832; }

/* 自定义月份选择器（替代原生 input[type=month]） */
.mp { position: relative; display: inline-block; }
.mp-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mp-trigger:hover { border-color: var(--brand); }
.mp-trigger:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,111,224,.18); }
.mp-trigger .mp-caret { color: var(--muted); transition: transform .15s; }
.mp.open .mp-trigger .mp-caret { transform: rotate(180deg); }
.mp-pop {
  position: absolute; top: calc(100% + 6px); z-index: 40;
  width: 232px; padding: 10px; display: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20,30,45,.14);
}
.mp-pop.mp-left { left: 0; right: auto; }   /* 触发器靠左 → 向右张开，避免溢出被侧栏裁切 */
.mp-pop.mp-right { right: 0; left: auto; }  /* 触发器靠右 → 向左张开 */
.mp-yr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.mp-yr button {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 16px; cursor: pointer;
}
.mp-yr button:hover { color: var(--brand); border-color: var(--brand); }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-cell {
  padding: 7px 0; border: 1px solid transparent; border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 13px; cursor: pointer; transition: background .12s, color .12s;
}
.mp-cell:hover { background: rgba(29,111,224,.10); }
.mp-cell.active { background: var(--brand); color: #fff; border-color: var(--brand); }
[data-theme="dark"] .mp-trigger { background: #1c2632; }
[data-theme="dark"] .mp-pop { background: #1c2632; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
[data-theme="dark"] .mp-cell { background: #243040; }

.th-hint { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
/* 明细区块（「考勤日历」页在用；人员列表的行内展开已于 2026-09-23 移除） */
/* 概况：圆形头像 + 姓名 + 元信息一行 */
.drill-head { display: flex; align-items: center; gap: 12px; }
.drill-avatar {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
.drill-id { min-width: 0; }
.drill-id .dn { font-size: 15px; font-weight: 600; }
.drill-id .dmeta { margin-top: 3px; font-size: 12px; color: var(--muted); }
/* 本月统计：六格横排（工时/出勤/异常/缺卡/人脸/设备） */
.drill-stats, .att-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 14px 0 8px; }
.drill-stats .ds { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.drill-stats .dsv { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drill-stats .dsv.anom { color: var(--bad); }
.drill-stats .dsl { margin-top: 2px; font-size: 11px; color: var(--muted); }
.drill-sub { font-size: 11px; color: var(--muted); }
.drill-h4 { margin: 14px 0 8px; font-size: 13px; font-weight: 600; }
.drill-hint { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
.drill-table th { background: transparent; }
/* 出勤日历：7 列，格子按当日状态着色；宽度撑满容器，不再限死 420px */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.cal-cell {
  /* 撑宽后不再用正方形（否则格子会随宽度变高），固定高度做成扁格 */
  min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 7px; background: var(--bg); color: var(--muted);
  font-size: 12px; font-variant-numeric: tabular-nums; border: 1px solid transparent;
}
.cal-cell .ch { font-size: 10px; font-weight: 400; opacity: .8; }
.cal-cell.blank { background: transparent; }
.cal-cell.s-ok { background: rgba(21,160,106,.14); color: #0f7a52; font-weight: 600; cursor: pointer; }
.cal-cell.s-anomaly { background: rgba(217,139,24,.18); color: #96601a; font-weight: 600; cursor: pointer; }
.cal-cell.s-missing { background: rgba(217,72,59,.14); color: #a83226; font-weight: 600; cursor: pointer; }
.cal-cell.s-none { background: var(--bg); color: var(--muted); }
.cal-cell.s-ok:hover, .cal-cell.s-anomaly:hover, .cal-cell.s-missing:hover { border-color: var(--brand); }
.cal-cell.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(29,111,224,.25); }
.cal-legend { display: flex; gap: 14px; margin: 8px 0 2px; font-size: 11px; color: var(--muted); }
.cal-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.cal-legend .dot.s-ok { background: rgba(21,160,106,.55); }
.cal-legend .dot.s-anomaly { background: rgba(217,139,24,.7); }
.cal-legend .dot.s-missing { background: rgba(217,72,59,.55); }
.cal-legend .dot.s-none { background: var(--line); }
[data-theme="dark"] .drill-stats .ds, [data-theme="dark"] .att-stats .ds { background: #1c2632; }
[data-theme="dark"] .cal-cell.s-ok { color: #6fe0b0; }
[data-theme="dark"] .cal-cell.s-anomaly { color: #f0c274; }
[data-theme="dark"] .cal-cell.s-missing { color: #f5a79c; }

/* 考勤日历页：顶部「人员 + 月份」两个选择器 */
.att-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.att-field { display: flex; align-items: center; gap: 8px; }
.att-label { font-size: 12px; color: var(--muted); }
/* 全局 input/select 背景是硬编码 #fff（暗色下没覆盖），这里用变量覆盖，保证双主题都正常 */
.att-sel {
  width: auto; min-width: 190px; max-width: 320px;
  padding: 8px 10px; font-size: 13px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.att-recs { max-height: 320px; overflow-y: auto; }
.att-recs .drill-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); }

/* 窄窗口：日历限宽，避免格子被拉得过分扁 */
@media (max-width: 1100px) {
  .cal { max-width: 560px; }
}
/* 移动端：侧栏变横向导航条时隐藏分组标题，避免挤占空间 */
@media (max-width: 768px) {
  .drill-stats, .att-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-cell { min-height: 32px; gap: 3px; }
  .cal-cell .ch { display: none; } /* 格子太窄，只留日期 */
  .nav-group-title { display: none; }
  .side nav a { margin: 0; border-radius: 0; }
  .side nav a.active { box-shadow: inset 0 -3px 0 var(--brand); background: transparent; }
  .sup-row { grid-template-columns: 64px 1fr 84px 70px; gap: 6px; font-size: 12px; }
}


