/* ===== AmarokOS Platform 设计 Tokens（所有模块统一共享） =====
 * 修改时同步更新所有模块，模块 styles.css 请勿重复声明 :root
 */
:root {
  --bg: #ffffff;
  --canvas: #ffffff;
  --panel: #ffffff;
  --panel-soft: #ffffff;
  --text: #151b2d;
  --muted: #6b7280;
  --line: #e2e5ec;
  --line-strong: #d7dbe4;
  --head: #fafbff;
  --accent: #D5000D;
  --accent-strong: #b8000b;
  --accent-soft: #fce8ea;
  /* —— 主题强调色：统一使用 LOGO 红色，不再使用紫色 —— */
  --purple: var(--accent);         /* 历史兼容：所有紫色调用点统一映射为 LOGO 红色（#D5000D） */
  --purple-strong: var(--accent-strong);
  --purple-soft: var(--accent-soft);
  --ok: #12b76a;
  --warn: #b45309;
  --bad: #b42318;
  --shadow: 0 10px 24px rgba(17, 24, 39, .08);
  --shadow-soft: 0 4px 14px rgba(17, 24, 39, .06);
  --sidebar-width: 232px;
  --sidebar-collapsed-width: 44px;
  /* —— Focus Ring（键盘焦点环，A11y 无障碍回填）—— */
  --focus-ring: 2px solid rgba(213, 0, 13, .45);
  /* —— Radius 4 级圆角 token（统一散落硬编码）—— */
  --radius-xs: 6px;   /* 小按钮、输入框、表格 cell：紧凑控件 */
  --radius-sm: 10px;  /* 卡片、一般面板：标准控件 */
  --radius-md: 12px;  /* KPI、模块卡片：中等面板 */
  --radius-lg: 20px;  /* 登录卡、picker、顶栏：大圆角容器（用户明确要求顶栏 20px） */

  /* —— Typography 8 级排版 token（统一散落硬编码字号）—— */
  --fs-xs: 11px;    /* 微标签、badge 脚注 */
  --fs-sm: 12px;   /* 次要文字、caption、footer */
  --fs-base: 13px; /* 正文导航、nav 项 */
  --fs-md: 14px;   /* 按钮文字、表头、panel-head */
  --fs-lg: 16px;   /* 子标题、picker 标题、KPI 标签 */
  --fs-xl: 18px;   /* 顶栏标题、空态主标题 */
  --fs-2xl: 22px;  /* 登录卡标题、KPI 图标 */
  --fs-3xl: 24px;  /* KPI 数字、section 标题 */
  /* 30px（card strong 数字）和 32px（empty-icon）出现极少，保留原始值不单独建 token */

  /* —— Spacing 8 级间距 token（收敛散落 margin/padding）—— */
  --sp-1: 4px;   /* 紧凑间距：badge、icon 内边距 */
  --sp-2: 8px;   /* 基础间距：按钮 padding、gap */
  --sp-3: 12px;  /* 标准间距：table cell、panel padding */
  --sp-4: 16px;  /* 中等间距：panel-head、flow gap */
  --sp-5: 20px;  /* 大间距：sidebar padding、topbar margin */
  --sp-6: 24px;  /* 超大间距：login-card padding */
  --sp-7: 32px;  /* section 间距 */
  --sp-8: 40px;  /* 空态垂直留白 */
  /* 6/10/14/15/18px 等半步值因位置敏感不强制收敛，保留原始 px */

  /* —— 平台级补充颜色 token（收入 shell.css 中高频硬编码）—— */
  --sidebar-bg: #FEFDFB;      /* 侧边栏暖灰背景 */
  --sidebar-border: #e8eaef;  /* 侧边栏右分割线 */
  --icon-gray: #858b96;      /* 图标按钮灰、收起箭头灰 */
  --nav-muted: #6f7682;      /* 导航次级文字灰 */
  --hover-bg: #f3f4f7;       /* nav-item / brand hover 背景 */
  --hover-bg-alt: #f5f6f8;   /* sidebar-account hover 背景 */
  --input-focus-bg: #fbfaff; /* 单元格内 input 聚焦底色 */
  --disabled-bg: #f8fafc;    /* 禁用控件底色 */
  --disabled-text: #667085;   /* 禁用控件文字色 */
  --dark-bg: #1f242b;        /* 登录卡近黑背景 */
  --purple: var(--accent);         /* 历史兼容：紫色强调色统一映射为 LOGO 红色（#D5000D） */
  --purple-2: var(--accent-strong);/* 历史兼容：渐变终点紫色 → LOGO 深红色（#b8000b），与 accent 组成红色渐变 */
  --ok-bg: #ecfdf3;          /* badge.ok 背景 */
  --warn-bg: #fff7ed;        /* badge.warn 背景 */
  --bad-bg: #fef3f2;         /* badge.bad 背景 */
  --ok-text: #0f8038;        /* ok 文字色 */
  --bad-text: #c21f23;       /* err 文字色 */
  --scrollbar-thumb: #d5d7db;    /* 滚动条拇指 */
  --scrollbar-thumb-hover: #b9bcc2; /* 滚动条拇指 hover */
}

* { box-sizing: border-box; }

/* ===== 全局 Focus Ring 回填：A11y 无障碍键盘焦点可见 =====
 * 历史问题：shell.css 里 outline:none 让键盘 Tab 的焦点完全看不见，键盘用户完全迷失。
 * 策略：对所有交互元素，:focus-visible（键盘聚焦）时显示统一 --focus-ring；
 *       鼠标点击的 :focus 不显示（避免视觉噪音）。
 *       原生 browser outline 保留走，不硬 none；需单独 outline-color:transparent 的场景交由具体规则。 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

/* input/select/textarea 原本默认 outline:none 用的是 focus 态边框反馈；
 * 但键盘用户必须能看见焦点，所以用 :focus-visible 覆盖额外一层 ring。
 * 它们的 outline-color 统一透明，避免 mouse focus 时出现默认黑边。 */
input, select, textarea {
  outline-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: var(--fs-md);
  letter-spacing: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; color: var(--text); }

p { margin: 0; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  padding: 1px 6px;
  background: var(--head);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.muted { color: var(--muted); }

.hidden { display: none !important; }

/* 通用按钮基础样式（Shell 与模块共享） */
button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--panel);
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
button:hover { border-color: var(--line-strong); background: var(--panel-soft); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.danger {
  background: #fff;
  border-color: #f2c2bf;
  color: var(--bad);
}
button.danger:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
button.full { width: 100%; padding: 9px 14px; }
button.secondary {
  background: var(--head);
  border-color: var(--line);
  color: var(--text);
}
button.secondary:hover { border-color: var(--line-strong); background: #ffffff; }
button.ghost, button.secondary.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
button.ghost:hover, button.secondary.ghost:hover { color: var(--text); background: var(--head); border-color: var(--line); }

/* ===== 组织人员：服务端主档 ===== */
.hr-organization-workspace { display: grid; gap: 16px; }
.hr-org-summary .panel-head { align-items: flex-start; }
.hr-org-metrics { display: flex; gap: 12px; padding: 0 18px 18px; flex-wrap: wrap; }
.hr-org-metrics span { min-width: 132px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--head); }
.hr-org-metrics b { color: var(--text); font-size: 20px; margin-right: 5px; }
.hr-org-layout { display: grid; grid-template-columns: minmax(285px, .72fr) minmax(0, 1.55fr); gap: 16px; align-items: start; }
.hr-org-directory .panel-head { gap: 12px; }
.hr-org-search { flex: 1; max-width: 230px; }.hr-org-search input { width: 100%; }
.hr-org-list { max-height: calc(100vh - 270px); overflow: auto; padding: 0 10px 10px; }
.hr-org-person { display: grid; width: 100%; grid-template-columns: 34px minmax(0,1fr) auto; text-align: left; align-items: center; gap: 10px; padding: 11px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); }
.hr-org-person:hover, .hr-org-person.selected { background: #fff5f5; border-color: #f3c2c4; }.hr-org-person b,.hr-org-person small { display: block; }.hr-org-person small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.hr-org-avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#ffe7e8; color:var(--accent); font-weight:700; }.hr-org-status { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }.hr-org-status.employed,.hr-org-status.probation { color:#16824a; }.hr-org-status.ended,.hr-org-status.archived { color:#8a6770; }
.hr-org-detail .panel-head { align-items: flex-start; }.hr-org-form { padding: 0 18px 18px; display: grid; gap: 18px; }.hr-org-form section { border-top: 1px solid var(--line); padding-top: 15px; }.hr-org-form h4 { margin: 0 0 12px; font-size: 14px; color: var(--muted); }.hr-org-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }.hr-org-grid label,.hr-org-reason label { display:grid; gap:6px; color:var(--muted); font-size:13px; }.hr-org-grid input,.hr-org-grid select,.hr-org-reason input { width:100%; }.hr-org-account { display:flex; gap:18px; color:var(--muted); }.hr-org-account span:first-child { color:var(--text); font-weight:600; }
@media (max-width: 960px) { .hr-org-layout { grid-template-columns: 1fr; }.hr-org-list { max-height: 330px; }.hr-org-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .hr-org-grid { grid-template-columns:1fr; }.hr-org-metrics span { min-width: calc(50% - 6px); }.hr-org-person { grid-template-columns:34px minmax(0,1fr); }.hr-org-status { grid-column:2; }.hr-org-search { max-width:none; }.hr-org-directory .panel-head { flex-wrap:wrap; } }
.hr-org-managed-wrap { margin: 12px 0 0; display: grid; gap: 12px; }
.hr-org-managed { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--head); padding: 40px 12px 12px; }
.hr-org-managed .hr-org-grid { margin: 0; }
.hr-org-managed-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; line-height: 1; border-radius: 50%; color: var(--muted); border: 1px solid var(--line); background: var(--panel); }
.hr-org-managed-remove:hover { color: var(--text); border-color: var(--line-strong); }
.hr-org-add-managed { justify-self: start; }
.hr-org-exempt { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--head); }
.hr-org-exempt label { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.hr-org-exempt input { width: auto; margin: 2px 0 0; flex: none; }
.hr-org-exempt input:disabled { cursor: not-allowed; }
.hr-org-exempt b { color: var(--text); }

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== 平台入口（apps/web/index.html）：模块选择首页 ===== */
/* 兼容两种容器：旧的 .platform-shell（预留）与新的 Shell 主内容区 .main-content 下 .view 内的模块卡片 */
.platform-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px 40px;
  color: var(--text);
}
.platform-shell header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 36px;
}
.platform-shell header .brand-logo {
  width: 220px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}
.platform-shell header .eyebrow {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 0 0 6px;
  text-transform: uppercase;
}
.platform-shell header p {
  color: var(--muted);
  font-size: var(--fs-md);
}
.platform-shell .module-grid,
.main-content .view .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.platform-shell .module-card,
.main-content .view .module-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 170px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.platform-shell .module-card:hover,
.main-content .view .module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.platform-shell .module-card.active,
.main-content .view .module-card.active {
  border-color: var(--accent-soft);
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}
.platform-shell .module-card > span,
.main-content .view .module-card > span {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .3px;
}
.platform-shell .module-card.planned > span,
.main-content .view .module-card.planned > span {
  background: var(--head);
  color: var(--muted);
  border: 1px solid var(--line);
}
.platform-shell .module-card.active > span,
.main-content .view .module-card.active > span {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-soft);
}
.platform-shell .module-card h2,
.main-content .view .module-card h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 4px 0 0;
}
.platform-shell .module-card p,
.main-content .view .module-card p {
  color: var(--muted);
  font-size: var(--fs-base);
  flex: 1;
}
.platform-shell footer,
.main-content .view > footer {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
  padding: 8px 0;
}

/* ===== Step 3：Toast 通知组件（平台级，所有模块通过 Orbit.shell.toast(msg, type, timeout) 调用）=====
 * 背景：之前操作成功/失败基本靠 alert() 弹窗，会阻塞交互、体验差；
 *       或完全不反馈，用户点了按钮不知道有没有生效。
 * 设计：
 *   - 固定在视口顶部居中（不会被任何弹层/侧栏/主内容挡住），z-index 200
 *   - 默认 info 型：白底 + 灰边，柔和不抢焦点
 *   - ok 型：绿色成功系 + ✓ 前缀
 *   - err 型：红色错误系 + ✕ 前缀
 *   - 带入场动画（从上方滑入）+ 退场淡出（JS 到时移除 DOM）
 *   - 最大宽度 480px，不会撑满小屏；文字自动换行
 * 使用示例：
 *   Orbit.shell.toast('已保存 8 条绩效记录', 'ok');
 *   Orbit.shell.toast('密码错误，请重试', 'err');
 *   Orbit.shell.toast('正在上传 CSV...', 'info', 1500);
 */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 200;
  max-width: 480px;
  min-width: 180px;
  padding: 10px 18px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(17, 24, 39, .14), 0 2px 6px rgba(17, 24, 39, .06);
  font-size: var(--fs-md);
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  animation: toastIn .22s cubic-bezier(.2,.8,.2,1) forwards;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* 多个 Toast 堆叠：通过 JS 设置 inline style margin-top 避免重叠；这里只给基础 .toast-leave 退场动画 */
.toast.toast-leave {
  animation: toastOut .2s ease forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}
/* —— 状态变种：ok / err / info —— */
.toast.toast-ok {
  border-color: rgba(18, 183, 106, .45);
  background: #f3fcf7;
  color: var(--ok-text);
}
.toast.toast-ok::before {
  content: "✓  ";
  font-weight: 700;
  color: var(--ok);
}
.toast.toast-err {
  border-color: rgba(180, 35, 24, .4);
  background: #fff4f3;
  color: var(--bad-text);
}
.toast.toast-err::before {
  content: "✕  ";
  font-weight: 700;
  color: var(--bad);
}
.toast.toast-info::before {
  content: "ⓘ  ";
  font-weight: 600;
  color: var(--muted);
}

/* ===== 仓储库存：ERP 快照与版本化标准查询 ===== */
.inventory-notice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: 10px 14px;
  border: 1px solid #f0d69a;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: #7c4a03;
  font-size: var(--fs-base);
}
.inventory-notice strong { white-space: nowrap; }

.inventory-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
/* 第一行：上传快照 + 上传与处理日志 左右两栏；第二行：快照与任务状态 横向铺满 */
.inventory-status-panel { grid-column: 1 / -1; }
/* 第一行两块面板头（标题 + 下划线）等高：上传面板用徽标(26px)、日志面板用按钮(35px)，自然高度不同(57 vs 66)，
   统一 min-height 让两条下划线落在同一高度 */
.inventory-upload-panel .panel-head,
#inventoryLogPanel .panel-head { min-height: 66px; }
/* 上传与处理日志列表限高：日志面板自然高度(=头66+提示39+间隔11+分页60+列表)不超过上传面板，
   行高由「上传 ERP 库存快照」决定(=按钮底部+一点)，日志面板经网格拉伸与之等高；日志多时列表内部滚动 */
#inventoryLogPanel .inventory-latest-table { max-height: 260px; }
.inventory-form,
.inventory-query-form {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) 18px 18px;
}
.inventory-form label,
.inventory-query-form label {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: var(--fs-base);
}
.inventory-form label > span,
.inventory-query-form label > span { font-weight: 600; }
.inventory-form small { color: var(--muted); }
.inventory-development-field[hidden] { display: none; }
.inventory-form input,
.inventory-query-form input,
.inventory-query-form select { width: 100%; }
.inventory-form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}
.inventory-api-base {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.inventory-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.inventory-status-grid > div {
  min-width: 0;
  padding: 12px 18px;
  background: #fff;
}
.inventory-status-grid dt {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.inventory-status-grid dd {
  margin: 3px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.inventory-status-value { display: inline-flex; align-items: center; gap: 7px; }
.inventory-elapsed { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inventory-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: inventory-spin .8s linear infinite;
}
@keyframes inventory-spin { to { transform: rotate(360deg); } }
.inventory-status-error { color: var(--danger, #b91c1c); font-weight: 600; }
.inventory-reason { display: block; max-width: 100%; }
.inventory-reason strong { color: var(--danger, #b91c1c); font-weight: 600; }
.inventory-reason-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.inventory-summary-block { padding: 14px 18px 18px; }
.inventory-summary-block h4 { margin-bottom: 10px; font-size: var(--fs-md); }
.inventory-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-2);
}
.inventory-summary-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--head);
}
.inventory-summary-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.inventory-summary-grid span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.inventory-empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}
.inventory-diff-block { border-top: 1px solid var(--line); }
.inventory-diff-summary { display: grid; gap: 10px; }
.inventory-diff-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.inventory-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--head);
  font-size: var(--fs-sm);
}
.inventory-diff-chip strong { font-variant-numeric: tabular-nums; }
.inventory-diff-chip.is-added strong { color: #15803d; }
.inventory-diff-chip.is-removed strong { color: #b91c1c; }
.inventory-diff-chip.is-changed strong { color: #b45309; }
.inventory-diff-meta { color: var(--muted); font-size: var(--fs-sm); }
.inventory-diff-detail {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}
.inventory-diff-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.inventory-diff-row:last-child { border-bottom: 0; }
.inventory-diff-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.inventory-diff-tag.is-added { background: #dcfce7; color: #15803d; }
.inventory-diff-tag.is-removed { background: #fee2e2; color: #b91c1c; }
.inventory-diff-tag.is-changed { background: #fef3c7; color: #b45309; }
.inventory-diff-name { font-weight: 600; overflow-wrap: anywhere; }
.inventory-diff-unit,
.inventory-diff-warehouse { color: var(--muted); }
.inventory-diff-qty { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 公司数据统一搜索 */
.company-search-shell { max-width: 1040px; margin: 0 auto; }
.company-search-attendance-mode .company-search-shell { max-width: none; }
.company-search-form {
  display: grid;
  grid-template-columns: 22px minmax(260px, 1fr) minmax(150px, 190px) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.company-search-leading { width: 20px; height: 20px; background: var(--muted); -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain; -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10.8 3.2a7.6 7.6 0 1 0 4.72 13.55l4.36 4.36 1.23-1.23-4.36-4.36A7.6 7.6 0 0 0 10.8 3.2Zm0 1.75a5.85 5.85 0 1 1 0 11.7 5.85 5.85 0 0 1 0-11.7Z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10.8 3.2a7.6 7.6 0 1 0 4.72 13.55l4.36 4.36 1.23-1.23-4.36-4.36A7.6 7.6 0 0 0 10.8 3.2Zm0 1.75a5.85 5.85 0 1 1 0 11.7 5.85 5.85 0 0 1 0-11.7Z'/></svg>"); }
.company-search-form input, .company-search-form select { margin: 0; min-height: 42px; }
.company-search-form input { border: 0; box-shadow: none; padding-left: 0; font-size: 16px; }
.company-search-form input:focus-visible { outline: none; }
.company-search-form:focus-within { border-color: var(--line); box-shadow: var(--shadow-soft), 0 0 0 3px rgba(17, 24, 39, .06); }
.company-search-hint { margin: 10px 2px 18px; color: var(--muted); font-size: 13px; }
.company-search-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.company-search-source { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--panel); color: var(--muted); font-size: 13px; }
.company-search-source::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.company-search-source[data-status="available"]::before { background: #16a34a; }
.company-search-source[data-status="restricted"]::before { background: #d97706; }
.company-search-result-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 2px 10px; }
.company-search-results { display: grid; gap: 10px; }
.company-search-empty { padding: 42px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; background: var(--panel); }
.company-search-result { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; background: var(--panel); text-align: left; color: var(--text); box-shadow: none; }
.company-search-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.company-search-result-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.company-search-result h3 { margin: 0 0 4px; font-size: 16px; }
.company-search-result p { margin: 0; color: var(--muted); line-height: 1.6; }
.company-search-result-subtitle { color: var(--text) !important; }
.company-search-error { color: var(--bad); }
/* 考勤模式只放宽结果区（36 列表格要横向空间），搜索栏本身保持与其他数据源一致的外观 */
.company-search-attendance-mode .company-search-form { max-width: 1040px; margin: 0 auto; }
.company-search-attendance-mode .company-search-hint,
.company-search-attendance-mode .company-search-sources,
.company-search-attendance-mode #inventoryLatestPanel { display: none; }
.company-search-attendance-mode .company-search-result-head { display: none; }
.company-search-attendance-mode .company-search-results { margin-top: 20px; }
/* 搜索页默认不展示「最新库存明细」（不再一进来就把库存摊开）；只有显式选「库存数据」
   或首页搜索命中库存时才展开整块明细。规则限定在 #companySearch 祖先内，绝不把类打到
   面板元素本身——面板与「库存管理」页共用，那样会连库存管理页一起隐藏。 */
#companySearch #inventoryLatestPanel { display: none; }
#companySearch.company-search-inventory-mode #inventoryLatestPanel { display: block; }
/* 库存态下没有命中时不显示空的虚框结果区（命中表渲染后自然出现） */
#companySearch.company-search-inventory-mode .company-search-results:empty { display: none; }
.company-search-attendance-panel { min-width: 0; }
.company-search-attendance-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 12px; }
.company-search-attendance-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.company-search-attendance-head h3, .company-search-attendance-head p { margin: 0; }
.company-search-attendance-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.company-search-attendance-nav { display: inline-flex; align-items: center; gap: 8px; }
.company-search-attendance-nav button { border: 0; background: transparent; color: var(--muted); min-width: 30px; min-height: 30px; padding: 4px; font-size: 20px; cursor: pointer; }
.company-search-attendance-nav button:hover:not(:disabled) { color: var(--text); }
.company-search-attendance-nav button:disabled { opacity: .3; cursor: default; }
.company-search-attendance-panel .company-search-table { min-width: max-content; table-layout: fixed; }
.company-search-attendance-panel .company-search-table th,
.company-search-attendance-panel .company-search-table td { white-space: pre-line; vertical-align: top; min-width: 110px; }
.company-search-attendance-panel .company-search-table th:nth-child(1),
.company-search-attendance-panel .company-search-table td:nth-child(1) { min-width: 64px; text-align: center; }
/* 本人考勤错误修订（公司搜索 · 考勤与假期） */
.company-search-attendance-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.company-search-attendance-status { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: nowrap; }
.company-search-attendance-status.is-open { border-color: var(--accent); color: var(--accent); }
.company-search-attendance-lock { color: var(--muted); font-size: 13px; }
.company-search-attendance-form { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.company-search-attendance-form-hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.company-search-attendance-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.company-search-attendance-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.company-search-attendance-reason { margin-top: 12px; }
.company-search-attendance-form-actions { display: flex; gap: 10px; margin-top: 14px; }
/* ===== 搜索历史下拉悬浮面板（公司数据搜索） ===== */
.company-search-history { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-soft); max-height: 260px; overflow-y: auto; }
.company-search-history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.company-search-history-clear { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.company-search-history-clear:hover { color: var(--bad); }
.company-search-history-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.company-search-history-item:hover, .company-search-history-item.active { background: var(--accent-soft); }
.company-search-history-term { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-search-history-del { flex: 0 0 auto; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; cursor: pointer; }
.company-search-history-del:hover { color: var(--danger, #b91c1c); }
.company-search-history-empty { padding: 20px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.company-search-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.company-search-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.company-search-table th { text-align: left; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.company-search-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.company-search-table tbody tr:last-child td { border-bottom: 0; }
.company-search-hit-row { cursor: pointer; }
.company-search-hit-row:hover { background: var(--accent-soft); }
.company-search-hit-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.company-search-hit-more { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--accent); font-size: 13px; cursor: pointer; }
.company-search-hit-more:hover { text-decoration: underline; }
.company-search-risk-bad { color: var(--danger, #b91c1c); font-weight: 600; }
.company-search-risk-warn { color: #d97706; font-weight: 600; }
.company-search-risk-ok { color: #16a34a; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .company-search-form { grid-template-columns: 20px 1fr; }
  .company-search-form select, .company-search-form button { grid-column: 2; width: 100%; }
  .company-search-attendance-mode .company-search-form { max-width: none; }
  .company-search-attendance-head { align-items: flex-start; flex-direction: column; }
}
.inventory-error { color: var(--bad); }

.inventory-latest-panel { margin-top: var(--sp-4); }
/* 上传与处理日志现置于 .inventory-layout 第一行，与「上传 ERP 库存快照」左右并列；
   去掉该面板在此网格内的顶部外边距，使两块顶边对齐 */
.inventory-layout .inventory-latest-panel { margin-top: 0; }
.inventory-fullscreen-button { white-space: nowrap; }
.inventory-latest-panel:fullscreen,
.inventory-latest-panel.is-fallback-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.inventory-latest-panel.is-fallback-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
}
body.inventory-fullscreen-open { overflow: hidden; }
.inventory-latest-panel:fullscreen .inventory-latest-table,
.inventory-latest-panel.is-fallback-fullscreen .inventory-latest-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  resize: none;
}
.inventory-latest-panel:fullscreen .inventory-latest-table .table-wrap,
.inventory-latest-panel.is-fallback-fullscreen .inventory-latest-table .table-wrap {
  height: 100%;
  max-height: none;
}
.inventory-latest-panel:fullscreen .inventory-latest-head,
.inventory-latest-panel.is-fallback-fullscreen .inventory-latest-head { flex: 0 0 auto; }
.inventory-latest-panel:fullscreen .inventory-latest-toolbar,
.inventory-latest-panel.is-fallback-fullscreen .inventory-latest-toolbar { flex: 0 0 auto; }
.inventory-latest-panel:fullscreen .inventory-pagination,
.inventory-latest-panel.is-fallback-fullscreen .inventory-pagination { flex: 0 0 auto; }
.inventory-latest-head > div { display: grid; gap: 2px; }
.inventory-latest-head .inventory-latest-actions {
  display: flex;
  grid-auto-flow: column;
  gap: 8px;
}
.inventory-icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--icon-gray);
  box-shadow: none;
}
.inventory-icon-button:hover {
  border-color: transparent;
  background: var(--hover-bg);
  color: var(--nav-muted);
}
.inventory-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inventory-icon-button.is-refreshing svg { animation: inventory-refresh-spin .75s linear infinite; }
@keyframes inventory-refresh-spin { to { transform: rotate(360deg); } }
.inventory-latest-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-3) 18px;
  border-bottom: 1px solid var(--line);
}
.inventory-latest-toolbar label {
  display: grid;
  align-content: start;
  gap: 5px;
  position: relative;
  color: var(--text);
  font-size: var(--fs-base);
}
.inventory-latest-toolbar label > span { font-weight: 600; }
.inventory-latest-toolbar label > small { color: var(--muted); font-size: var(--fs-sm); }
.inventory-latest-toolbar .inventory-hover-hint {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: min(340px, calc(100vw - 40px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  box-shadow: 0 8px 22px rgb(15 23 42 / 18%);
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  pointer-events: none;
}
.inventory-latest-toolbar input:hover + .inventory-hover-hint,
.inventory-latest-toolbar input:focus + .inventory-hover-hint {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.inventory-latest-toolbar input,
.inventory-latest-toolbar select { width: 100%; }
.inventory-warehouse-picker { position: relative; width: 100%; }
.inventory-warehouse-picker-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.inventory-warehouse-picker-toggle:hover,
.inventory-warehouse-picker-toggle[aria-expanded="true"] { border-color: var(--line-strong); background: var(--head); }
.inventory-warehouse-picker-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .16s ease; }
.inventory-warehouse-picker-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.inventory-warehouse-picker-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 240px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgb(15 23 42 / 16%);
}
.inventory-warehouse-picker-options[hidden] { display: none; }
.inventory-latest-toolbar .inventory-warehouse-picker-option { display: flex; grid-template-columns: none; align-items: center; justify-content: flex-start; gap: 9px; min-height: 34px; width: 100%; padding: 5px 7px; border-radius: 6px; box-sizing: border-box; cursor: pointer; }
.inventory-warehouse-picker-option:hover { background: var(--head); }
.inventory-latest-toolbar .inventory-warehouse-picker-option input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.inventory-latest-toolbar .inventory-warehouse-picker-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-warehouse-picker-actions { display: flex; justify-content: flex-end; padding: 7px 5px 2px; border-top: 1px solid var(--line); }
.inventory-warehouse-picker-actions button { min-height: 32px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-sm); }
.inventory-warehouse-picker-actions button:hover { background: var(--head); border-color: var(--line-strong); }
.inventory-data-scope-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inventory-data-scope-control select { flex: 1 1 auto; min-width: 0; width: auto; }
.inventory-data-scope-control .inventory-icon-button { flex: 0 0 auto; }
.inventory-latest-table {
  min-height: 180px;
  overflow: auto;
  resize: vertical;
}
.inventory-latest-table .table-wrap { max-height: none; }
.inventory-latest-table th { padding: 0; white-space: nowrap; }
.inventory-latest-table td { max-width: 260px; overflow-wrap: anywhere; }
.inventory-latest-table td.inventory-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 指定列内容水平居中（覆盖数字列默认右对齐；只作用于数据行 td，不碰表头与半隐列名带——二者保持左对齐） */
.inventory-latest-table tbody td[data-column-key="displayRowNumber"],
.inventory-latest-table tbody td[data-column-key="quantity"],
.inventory-latest-table tbody td[data-column-key="availableQuantity"],
.inventory-latest-table tbody td[data-column-key="unit"],
.inventory-latest-table tbody td[data-column-key="manufacturedOn"],
.inventory-latest-table tbody td[data-column-key="expiresOn"],
.inventory-latest-table tbody td[data-column-key="inboundConfirmedAt"],
.inventory-latest-table tbody td[data-column-key="inventoryAgeDays"],
.inventory-latest-table tbody td[data-column-key="daysRemaining"] {
  text-align: center;
}
.inventory-log-hint { margin: 0 12px 10px; font-size: 13px; text-align: left; }
.inventory-log-table { border-collapse: collapse; }
/* 日志表所有列表头与对应列内容都水平居中 */
.inventory-log-table th { text-align: center; font-weight: 600; }
.inventory-log-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: center; }
/* 「上传时间」列时间串不换行、数字等宽，避免窄列内折行 */
.inventory-log-table th:first-child,
.inventory-log-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.inventory-log-row { cursor: pointer; }
.inventory-log-file { max-width: 260px; overflow-wrap: anywhere; }
.inventory-log-status { display: inline-flex; align-items: center; gap: 6px; }
.inventory-log-reason strong { color: var(--danger, #b91c1c); font-weight: 600; }
.inventory-sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.inventory-sort-button:hover { border: 0; background: #f1f5f9; }
.inventory-sort-button:focus-visible { position: relative; z-index: 1; outline: 2px solid #2563eb; outline-offset: -2px; }
.inventory-sort-indicator { min-width: 14px; color: #94a3b8; font-size: 13px; text-align: center; }
.inventory-sort-button.is-active .inventory-sort-indicator { color: #2563eb; }
.inventory-header-label {
  display: block;
  min-height: 42px;
  padding: 10px 12px;
  font-weight: 700;
  text-align: left;
}
.inventory-latest-table tbody tr { cursor: default; background: var(--panel); transition: background .14s ease, box-shadow .14s ease; }
.inventory-latest-table tbody tr:hover { background: var(--head); }
.inventory-latest-table tbody tr.is-selected { background: #eef1f4; }
/* 标注行底色：仅「置顶/重要/紧急」着色（贴近对应徽标色系的浅色版）；备注/已处理只留商品格里的彩色徽标、不染整行 */
.inventory-latest-table tbody tr.is-pinned { background: #fffbea; }
.inventory-latest-table tbody tr.is-important { background: #fff7ee; }
.inventory-latest-table tbody tr.is-urgent { background: #fef2f2; }
.inventory-latest-table tbody tr.is-selected.is-pinned,
.inventory-latest-table tbody tr.is-selected.is-important,
.inventory-latest-table tbody tr.is-selected.is-urgent { background: #eef1f4; }  /* 选中优先于标注底色 */
.inventory-latest-table tbody tr.is-historical { color: #64748b; background-image: linear-gradient(135deg, rgba(148,163,184,.04) 25%, transparent 25%, transparent 50%, rgba(148,163,184,.04) 50%, rgba(148,163,184,.04) 75%, transparent 75%); background-size: 12px 12px; }
.inventory-row-product { display: flex; align-items: flex-start; gap: 7px; }
.inventory-row-markers { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.inventory-row-marker { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 700; white-space: nowrap; }
.inventory-row-marker.pinned { background: #fff7d6; color: #a16207; }
.inventory-row-marker.important { background: #ffedd5; color: #c2410c; }
.inventory-row-marker.urgent { background: #fee2e2; color: #b91c1c; }
.inventory-row-marker.note { display: block; flex: 1 1 100%; max-width: 100%; padding: 2px 7px; border-radius: 8px; background: #e0e7ff; color: #4338ca; font-weight: 600; line-height: 1.45; text-align: left; white-space: normal; word-break: break-word; }
.inventory-row-marker.handled { background: #dcfce7; color: #15803d; }
.inventory-row-marker.historical { background: #e2e8f0; color: #475569; }
.inventory-row-context-menu {
  position: fixed;
  z-index: 1300;
  min-width: 210px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgb(15 23 42 / 22%);
}
.inventory-row-context-title { padding: 7px 10px 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.inventory-row-context-menu button { display: block; width: 100%; padding: 9px 10px; border: 0; background: transparent; color: var(--text); text-align: left; }
.inventory-row-context-menu button:hover,
.inventory-row-context-menu button:focus-visible { border: 0; outline: none; background: #f1f5f9; }
.inventory-annotation-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgb(15 23 42 / 22%);
}
.inventory-annotation-dialog::backdrop { background: rgb(15 23 42 / 42%); }
.inventory-annotation-field { display: grid; gap: 7px; padding: 18px; font-weight: 600; }
.inventory-annotation-field textarea { width: 100%; resize: vertical; font: inherit; font-weight: 400; }
.inventory-annotation-field small { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.inventory-column-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgb(15 23 42 / 22%);
}
.inventory-column-dialog::backdrop { background: rgb(15 23 42 / 42%); }
.inventory-column-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.inventory-column-dialog-head h3 { margin: 0; }
.inventory-column-dialog-head p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.inventory-column-dialog-close {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
.inventory-column-dialog-close:hover { border: 0; background: #f1f5f9; color: #0f172a; }
.inventory-column-dialog-close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.inventory-column-selection-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.inventory-column-selection-tools > div { display: flex; gap: 6px; }
.inventory-column-order-list {
  display: grid;
  gap: 8px;
  max-height: 52vh;
  margin: 0;
  padding: 14px 18px;
  overflow: auto;
  list-style: none;
}
.inventory-column-order-list li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 48px;
  padding: 7px 10px 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.inventory-column-order-list li.is-selected { border-color: #60a5fa !important; background: #f5f9ff !important; }
.inventory-column-order-list li.is-dragging {
  opacity: .48;
  transform: scale(.985);
  border-style: dashed;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .14);
}
.inventory-column-order-list.is-drag-active,
.inventory-column-order-list.is-drag-active * { user-select: none; -webkit-user-select: none; }
.inventory-column-order-list li.drop-before {
  transform: translateY(5px);
  box-shadow: inset 0 3px 0 #2563eb, 0 -8px 18px rgba(37, 99, 235, .12);
}
.inventory-column-order-list li.drop-after {
  transform: translateY(-5px);
  box-shadow: inset 0 -3px 0 #2563eb, 0 8px 18px rgba(37, 99, 235, .12);
}
.inventory-column-order-list li.drop-before::before,
.inventory-column-order-list li.drop-after::after {
  content: '移动到这里';
  position: absolute;
  z-index: 3;
  left: 18px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  pointer-events: none;
  animation: inventory-drop-pulse .75s ease-in-out infinite alternate;
}
.inventory-column-order-list li.drop-before::before { top: -13px; }
.inventory-column-order-list li.drop-after::after { bottom: -13px; }
.inventory-column-order-list li.just-dropped { animation: inventory-column-settle .5s ease both; }
.inventory-column-order-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.inventory-column-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 32px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.inventory-column-drag-handle:hover { background: var(--head); color: var(--text); }
.inventory-column-drag-handle:active { cursor: grabbing; }
.inventory-column-order-main > label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}
.inventory-column-order-main > label input { margin: 0; }
.inventory-column-visibility {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 10px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
  cursor: pointer;
}
.inventory-column-visibility input[role="switch"] {
  appearance: none;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 11px 11px, #fff 0 7px, transparent 8px), #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  transition: background .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.inventory-column-visibility input[role="switch"]:checked {
  background: radial-gradient(circle at 27px 11px, #fff 0 7px, transparent 8px), #16a34a;
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .15);
}
.inventory-column-visibility input[role="switch"]:focus-visible { outline: 3px solid rgba(22, 163, 74, .24); outline-offset: 2px; }
.inventory-column-visibility-state {
  min-width: 28px;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}
.inventory-column-name {
  min-width: 170px;
  padding: 6px 8px;
  color: var(--text);
  font-weight: 600;
}
.inventory-column-order-list li:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.inventory-column-order-list li.is-selected .inventory-column-name { color: #1d4ed8; }
.inventory-column-order-list li.is-hidden .inventory-column-visibility-state { color: #64748b; }
.inventory-column-order-list li.is-hidden .inventory-column-name { color: var(--muted); text-decoration: line-through; }
.inventory-column-drag-ghost {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: -10000px;
  padding: 8px;
  border: 1px solid #60a5fa;
  border-radius: 12px;
  background: rgba(239, 246, 255, .96);
  box-shadow: 0 18px 36px rgba(30, 64, 175, .26);
  pointer-events: none;
}
.inventory-column-drag-ghost-title {
  padding: 2px 6px 7px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 750;
}
.inventory-column-drag-ghost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 46px;
  padding: 6px 9px 6px 12px;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}
.inventory-column-drag-ghost-row + .inventory-column-drag-ghost-row { margin-top: 6px; }
.inventory-column-drag-ghost-row > div:last-child { display: flex; align-items: center; gap: 6px; }
.inventory-column-drag-ghost-row button { min-width: 58px; }
@keyframes inventory-drop-pulse {
  from { transform: scale(.96); opacity: .82; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes inventory-column-settle {
  0% { transform: translateY(-8px); background: #dbeafe; box-shadow: 0 10px 24px rgba(37, 99, 235, .18); }
  65% { transform: translateY(2px); }
  100% { transform: translateY(0); }
}
.inventory-column-order-list li > div:last-child { display: flex; align-items: center; gap: 6px; }
.inventory-column-order-list button { min-width: 64px; }
.inventory-column-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.inventory-column-dialog-actions #inventoryLatestColumnOrderReset { margin-right: auto; }
.inventory-risk {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--head);
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.inventory-risk.expired { background: #fff0ef; color: var(--bad-text); }
.inventory-risk.within-30-days { background: #fff7df; color: #7c4a03; }
.inventory-risk.within-one-year { background: #fff7df; color: #7c4a03; }
.inventory-risk.below-60-percent { background: #fff0ef; color: var(--bad-text); }
.inventory-risk.meets-60-percent { background: #edf8f1; color: #17633a; }
.inventory-risk.not-calculable { background: #f3f4f6; color: #596274; }
.inventory-risk.normal { background: #edf8f1; color: #17633a; }
.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.inventory-pagination > div { display: flex; gap: var(--sp-2); }

.inventory-query-panel .panel-head > div { display: grid; gap: 2px; }
.inventory-query-form { border-bottom: 1px solid var(--line); }
.inventory-query-parameters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.inventory-query-result { min-height: 108px; }
.inventory-result-table { max-height: 52vh; }
.inventory-result-table td { max-width: 320px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .inventory-notice { align-items: flex-start; flex-direction: column; gap: var(--sp-1); }
  .inventory-status-grid,
  .inventory-query-parameters,
  .inventory-latest-toolbar { grid-template-columns: 1fr; }
  .inventory-form-actions { align-items: stretch; flex-direction: column; }
  .inventory-form-actions button { width: 100%; }
  .inventory-latest-head { align-items: flex-start; }
  .inventory-latest-head button { width: auto; }
  .inventory-latest-head .inventory-latest-actions { display: flex; flex-wrap: wrap; }
  .inventory-column-dialog-head { align-items: stretch; flex-direction: column; }
  .inventory-column-dialog-head > button { align-self: flex-end; }
  .inventory-column-selection-tools { align-items: stretch; flex-direction: column; }
  .inventory-column-selection-tools > div { display: grid; grid-template-columns: 1fr 1fr; }
  .inventory-column-order-list li { align-items: stretch; flex-direction: column; }
  .inventory-column-order-list li > div:last-child { justify-content: flex-end; }
  .inventory-column-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .inventory-column-dialog-actions #inventoryLatestColumnOrderReset { grid-column: 1 / -1; margin-right: 0; }
  .inventory-pagination { align-items: stretch; flex-direction: column; }
  .inventory-pagination > div { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ===== 考勤与假勤（v122 人力资源·人事运营） ===== */
.attendance-month-row { cursor: pointer; }
.attendance-month-row:hover { background: var(--head); }
.attendance-list-filter {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin: 0 12px var(--sp-3);
}
.attendance-list-filter label {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: var(--fs-base);
}
.attendance-list-filter label > span {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.attendance-list-filter select {
  min-width: 120px;
  min-height: 36px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--text);
}
.attendance-detail-panel { grid-column: 1 / -1; }
.attendance-detail-panel .inventory-latest-table { max-height: 66vh; }
.attendance-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 12px;
  flex-wrap: wrap;
}
.attendance-detail-toolbar-spacer { flex: 1 1 auto; }
.attendance-toolbar-button,
.attendance-finalize-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--text);
  padding: 0 14px;
}
.attendance-finalize-button { border-color: #efaaa7; color: var(--brand-dark); }
.attendance-detail-toolbar [hidden],
.attendance-revision-bar[hidden] { display: none !important; }
.attendance-revision-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin: 0 12px 14px;
  padding: 14px;
  border: 1px solid #efaaa7;
  border-radius: var(--radius-sm);
  background: #fffafa;
}
.attendance-revision-bar label { display: grid; gap: 6px; }
.attendance-revision-bar label > span { font-weight: 650; }
.attendance-revision-bar input { min-height: 40px; }
.attendance-version-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff4e8;
  color: #8a4b08;
  white-space: nowrap;
}
.attendance-version-status.final { background: #edf8f1; color: #17633a; }
.attendance-version-status.superseded { background: #f3f4f6; color: #596274; }
/* 考勤行导进来了，却没关联到员工档案（employee_id 为空）：这行不属于任何人，
   合计、员工自助与绩效取数都看不到它。用告警色而非品牌红，免得跟 LOGO 红混淆。 */
.attendance-unlinked-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.attendance-detail-table tr.attendance-row-unlinked > td,
.attendance-summary-table tr.attendance-row-unlinked > td { background: var(--bad-bg); }
.attendance-detail-table tr.attendance-row-unlinked > td:first-child,
.attendance-summary-table tr.attendance-row-unlinked > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.attendance-reconcile-warning { color: var(--bad); font-weight: 600; }
.attendance-revision-input {
  width: 100%;
  min-width: 84px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #efaaa7;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}
.attendance-revision-text { min-width: 180px; resize: vertical; line-height: 1.45; }
.attendance-resizable-table .attendance-revision-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.attendance-resizable-table .attendance-revision-text {
  min-width: 0;
  max-width: 100%;
  resize: vertical;
}
.attendance-revision-history {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: #fff;
}
.attendance-revision-history summary { cursor: pointer; padding: 10px 12px; font-weight: 650; color: var(--brand-dark); }
.attendance-revision-history .table-wrap { border-top: 1px solid var(--line); max-height: 280px; }
.attendance-revision-history table { min-width: 760px; }
.attendance-discipline-table { min-width: 4400px; }
.attendance-discipline-table.attendance-resizable-table {
  table-layout: fixed;
  min-width: 0;
}
.attendance-discipline-table th,
.attendance-discipline-table td { vertical-align: top; }
.attendance-resizable-table th[data-column-key] {
  overflow: visible;
  padding-right: 18px;
}
.attendance-resizable-table th[data-column-key="sequence"] {
  padding-left: 18px;
  text-align: center;
}
.attendance-column-resizer {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}
.attendance-column-resizer::after {
  content: '';
  position: absolute;
  top: 22%;
  right: 0;
  bottom: 22%;
  width: 1px;
  background: var(--line-strong);
  opacity: .55;
}
.attendance-column-resizer:hover::after,
.attendance-column-resizer:focus-visible::after,
.attendance-column-resizer.is-resizing::after {
  width: 2px;
  background: var(--accent);
  opacity: 1;
}
body.attendance-column-resizing {
  cursor: col-resize;
  user-select: none;
}
.attendance-discipline-table td.attendance-discipline-number {
  min-width: 82px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.attendance-discipline-table td.attendance-discipline-text {
  min-width: 150px;
  max-width: 300px;
  white-space: pre-line;
}
.attendance-resizable-table th.attendance-discipline-left,
.attendance-resizable-table td.attendance-discipline-left,
.attendance-resizable-table td.attendance-discipline-left input,
.attendance-resizable-table td.attendance-discipline-left textarea {
  text-align: left;
}
.attendance-detail-line { display: block; }
.attendance-detail-line + .attendance-detail-line { margin-top: 3px; }
.attendance-fullscreen-button { flex: 0 0 auto; }
.attendance-detail-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  white-space: nowrap;
}
.attendance-month-navigation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.attendance-current-month {
  min-width: 70px;
  padding: 0 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.attendance-month-navigation .inventory-icon-button:disabled {
  opacity: .35;
  cursor: default;
  background: transparent;
}
.attendance-detail-panel:fullscreen,
.attendance-detail-panel.is-fallback-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.attendance-detail-panel.is-fallback-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
}
body.attendance-fullscreen-open { overflow: hidden; }
.attendance-detail-panel:fullscreen > .panel-head,
.attendance-detail-panel:fullscreen > .attendance-detail-toolbar,
.attendance-detail-panel:fullscreen > .attendance-revision-bar,
.attendance-detail-panel.is-fallback-fullscreen > .panel-head,
.attendance-detail-panel.is-fallback-fullscreen > .attendance-detail-toolbar,
.attendance-detail-panel.is-fallback-fullscreen > .attendance-revision-bar { flex: 0 0 auto; }
.attendance-detail-panel:fullscreen > #attendanceDetail,
.attendance-detail-panel.is-fallback-fullscreen > #attendanceDetail {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.attendance-detail-panel:fullscreen > #attendanceDetail > .table-wrap,
.attendance-detail-panel.is-fallback-fullscreen > #attendanceDetail > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}
@media (max-width: 900px) {
  .attendance-revision-bar { grid-template-columns: 1fr; align-items: stretch; }
  .attendance-revision-bar .row-actions { justify-content: flex-end; }
}
.attendance-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.company-search-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== 我的绩效考核（主站公司看板） =====
 * 评分行按「生效角色」渲染，不按 A/B/C 节硬映射——C 节的权重在第一条考评人身上，
 * 但那个位置是空的，实际由 HR 复核打分。角色判断见 services/platform-api/src/performance-scoring-roles.mjs。
 */
.my-perf-panel { margin-top: 18px; }
/* .panel 自身没有内边距（靠 .panel-head 的 18px 和各自的主体类补），本面板此前漏了主体那一层，
   于是卡片和「我要评分」块直接贴到边框上（实测距框 1px，标题却是 19px）。内边距只加在主体整块上，
   内部两个网格不再各补一份，避免双重内边距。
   「自己」与「我要评分」不并排：并排时任务网格只分到一列（约 353px），auto-fill 只算得出 1 列，
   28 张卡片就堆成一条竖条。改成上下两块各自占满整幅宽度后，任务网格按宽度自动分列、多行铺开。 */
.my-perf-panel > .my-perf-body { display: grid; gap: 14px; padding: 14px 18px 18px; }
.my-perf-panel > .my-perf-body > .my-perf-error { margin: 0; }
.my-perf-cycle { margin-left: 8px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.my-perf-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #f3c2c4; border-radius: var(--radius-sm); background: #fff5f5; color: var(--bad); }
.my-perf-retry { flex: none; padding: 5px 12px; border: 1px solid currentColor; border-radius: var(--radius-xs); background: var(--panel); color: var(--bad); font-size: 12px; font-weight: 600; cursor: pointer; }
.my-perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.my-perf-tasks-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.my-perf-tasks-head span { color: var(--muted); font-size: 13px; }
.my-perf-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--head); }
.my-perf-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.my-perf-title { display: grid; gap: 6px; min-width: 0; }
.my-perf-title strong { font-size: 15px; }
.my-perf-role { display: inline-block; margin-right: 5px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.my-perf-role[data-role="hr"] { background: #eef2ff; color: #3538cd; }
.my-perf-role[data-role="self"] { background: #ecfdf3; color: #16824a; }
.my-perf-progress { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.my-perf-progress.done { color: #16824a; font-weight: 600; }
.my-perf-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.my-perf-score { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.my-perf-score small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.my-perf-open { justify-self: start; padding: 7px 14px; border: 1px solid var(--accent); border-radius: var(--radius-xs); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.my-perf-open:disabled { border-color: var(--line); background: var(--panel); color: var(--muted); cursor: default; }
/* 评完（任务卡＝我负责的考核点都打完，自评卡＝自评项都打完）→ 按钮与外框线转绿，
   与 HR 月度绩效卡片「已确认」用同一套色。光把右上角数字涂绿不够：红按钮留在卡片上，
   看着仍像还欠一个动作。 */
.my-perf-card.is-done { border-color: #b7dfc8; background: #f8fffb; }
.my-perf-card.is-done .my-perf-open { border-color: #16824a; background: #16824a; }
.my-perf-card.is-done .my-perf-open:hover { border-color: #12683a; background: #12683a; }

/* 遮罩是 grid + place-items:center，但隐式行轨道默认 auto，会按面板的**自然高度**（实测 1658px）
   撑大；.my-perf-sheet 的 max-height 只压住面板本身（774px），压不住轨道。于是面板在超高的轨道里
   居中，被推到视口下方 336px——表现就是「弹层只露一条边、看不到」。把轨道钉死在容器高度上。 */
.my-perf-overlay { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; padding: 20px; background: rgba(17, 24, 39, .45); }
body.my-perf-sheet-open { overflow: hidden; }
.my-perf-sheet { display: flex; flex-direction: column; width: min(1080px, 100%); max-height: min(86vh, 100%); border-radius: var(--radius-md); background: var(--panel); box-shadow: var(--shadow); }
.my-perf-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.my-perf-sheet-head strong { display: block; font-size: 16px; }
.my-perf-sheet-head .muted { display: block; margin-top: 4px; font-size: 12px; }
.my-perf-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--panel); font-size: 18px; line-height: 1; cursor: pointer; }
/* 全屏 / 导出长图两个按钮跟关闭键并排放在标题行右侧（按钮样式在共享的 performance-sheet.css） */
.my-perf-sheet-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.my-perf-hint { margin: 0; padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--head); color: var(--muted); font-size: 12px; }
/* gap 交给 performance-sheet.css 里各块自己的 margin-top（与 HR 模块的评分表同一套间距），
   这里再加一份两倍间距就出来了。 */
.my-perf-rows { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px 18px 12px; display: block; scrollbar-gutter: stable; }
.my-perf-rows > :first-child { margin-top: 0; }
.my-perf-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.my-perf-status { font-size: 13px; color: var(--muted); }
.my-perf-status[data-kind="error"] { color: var(--bad); }
.my-perf-status[data-kind="ok"] { color: #16824a; }
.my-perf-save { padding: 9px 20px; border: 1px solid var(--accent); border-radius: var(--radius-xs); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.my-perf-save:disabled { border-color: var(--line); background: var(--panel); color: var(--muted); cursor: default; }

/* 评分模式开关：逐条 / 整页。做成胶囊式两段切换——外壳整条圆角、选中段是嵌在里面的实心药丸，
   跟 HR 模块 styles.css 里的 .segmented 同一套结构（那里圆角 10px），这里取满圆角 999px 才成「胶囊」。
   外壳用内边距 + gap 让药丸缩在轨道里，所以不再需要 overflow: hidden 和按钮间的 border-left。 */
.my-perf-mode { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.my-perf-mode button { padding: 5px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; transition: background .15s ease, color .15s ease; }
.my-perf-mode button.is-on { background: var(--accent); color: #fff; }

/* 逐条模式：一屏一个考核点，头上有「第 N / M 条」和进度条。 */
.my-perf-step-head { display: grid; gap: 6px; margin-bottom: 8px; }
.my-perf-step-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.my-perf-step-section { font-weight: 600; }
.my-perf-step-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.my-perf-step-bar { height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.my-perf-step-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .18s ease; }
.my-perf-step-nav { display: flex; flex: none; align-items: center; gap: 8px; }
.my-perf-step-btn { padding: 9px 18px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--panel); color: inherit; font-weight: 600; cursor: pointer; }
.my-perf-step-btn:disabled { color: var(--muted); cursor: default; }
.my-perf-step-btn.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.my-perf-step-btn.is-primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
/* 逐条模式的第 1 页：人员信息 + 四位考评人摘要，单独的「信息页」。人员块原来常驻在
   .my-perf-rows 顶部（那样它是首个子元素，靠 .my-perf-rows > :first-child 归零上边距），
   搬进 .my-perf-step 之后要靠下面这条把 performance-sheet.css 里的 margin-top:16px 抵消掉。
   用特异性压过（0,2,0 对 0,1,0），这样不必去动 performance-sheet.css 及其版本号。 */
.my-perf-step-info { display: block; }
.my-perf-step .template-personnel-block { margin-top: 0; }
.my-perf-step-lead { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 720px) {
  .my-perf-grid { grid-template-columns: 1fr; }
  .my-perf-overlay { padding: 0; }
  .my-perf-sheet { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .my-perf-sheet-tools { flex-wrap: wrap; justify-content: flex-end; }
  .my-perf-sheet-foot { flex-wrap: wrap; }
  .my-perf-step-nav { flex: 1 1 auto; }
  .my-perf-step-btn { flex: 1 1 auto; }
}
