/* SRM 基础样式。
 *
 * T2决策：Bootstrap 5 仅用于基础样式，不引入 Bootstrap JS 组件。
 * 本文件是自建的轻量基础样式（毛坯风格），后续需要时再引入 Bootstrap CSS。
 * 硬规范：全站列表用原生 <table> + <thead>/<tbody>，禁止 div 模拟。
 */

:root {
  --c-bg: #f5f6f8;
  --c-surface: #ffffff;
  --c-border: #e3e6ea;
  --c-text: #1f2328;
  --c-text-2: #656d76;
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-success: #16a34a;
  --c-warning: #d97706;
  --c-danger: #dc2626;
  --c-info: #0891b2;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

/* ---------- 布局 ---------- */

.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 24px;
  height: 52px;
  min-height: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand { font-size: 16px; font-weight: 600; color: var(--c-text); text-decoration: none; }
.brand span { color: var(--c-primary); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { color: var(--c-text-2); font-size: 13px; }
.user-chip strong { color: var(--c-text); }

.role-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
}

/* ⚠️ 2026-11-11 站内信铃铛（M20） */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  color: var(--c-text-2);
  text-decoration: none;
  line-height: 1;
}
.notif-bell:hover { color: var(--c-primary); }
.notif-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--c-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
/* ⚠️ 2026-11-11 铃铛 hover 提示（铃铛 vs 待办分工） */
.notif-tip {
  position: absolute;
  top: 28px;
  right: 0;
  display: none;
  width: 210px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--c-border, #d3d1c7);
  color: var(--c-text);
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
  z-index: 100;
  text-align: left;
}
.notif-bell:hover .notif-tip { display: block; }
/* 未读通知行的淡色高亮 */
.row-unread { background: #f0f7ff; }

/* ⚠️ 2026-11-11 通知分类 Tab（按「行动」分：待处理/被驳回/已通知） */
.notif-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.notif-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-text-2);
  text-decoration: none;
  border: 1px solid var(--c-border, #d3d1c7);
  background: #fff;
}
.notif-tab:hover { color: var(--c-primary); border-color: var(--c-primary); }
.notif-tab.active {
  color: #fff;
  border-color: transparent;
  background: var(--c-primary, #378add);
}
/* 分类色：待处理=红(对齐待办 block)、被驳回=橙、已通知=灰 */
.notif-tab-action.active { background: #a32d2d; }
.notif-tab-rejected.active { background: #b97417; }
.notif-tab-notified.active { background: #5f5e5a; }
.notif-tab-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e24b4a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
.notif-tab.active .notif-tab-badge { background: rgba(255,255,255,0.3); }

/* ⚠️ 2026-11-11 供应商业绩评价：评级彩色徽章 */
.score-badge {
  display: inline-block;
  min-width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.score-badge.score-A { background: #639922; }
.score-badge.score-B { background: #378add; }
.score-badge.score-C { background: #ba7517; }
.score-badge.score-D { background: #e24b4a; }

/* ⚠️ 2026-11-11 评鉴表评分档位：固定 5 列等宽，10 分制与 5 分制圆点垂直对齐 */
.score-opts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.score-opt {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  font-size: 13px;
  white-space: nowrap;
}
.score-opt input { margin: 0; }
/* 备注输入框占满列宽 */
td input[name^="remark_"] { width: 100%; box-sizing: border-box; }

/* ⚠️ 2026-11-11 评鉴表评价结论：三档自动匹配高亮 */
.assess-conclusion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.assess-conclusion-row .mark { font-size: 14px; width: 16px; text-align: center; }
.assess-conclusion-row.on {
  background: var(--c-surface);
  color: var(--c-primary);
  font-weight: 500;
}

.container { margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 460px; margin: 0 auto; padding: 60px 24px; }

.page-title { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.page-sub { color: var(--c-text-2); font-size: 13px; margin: 0 0 20px; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 16px; }

/* ---------- 表格（原生 table，硬规范） ---------- */

.table-wrap { overflow-x: auto; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.table th,
table.table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
table.table thead th {
  background: #fafbfc;
  font-weight: 600;
  color: var(--c-text-2);
  font-size: 12px;
  border-bottom: 2px solid var(--c-border);
}
table.table tbody tr:hover { background: #f8f9fa; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .empty { text-align: center; color: var(--c-text-2); padding: 32px; }

/* ---------- 表单 ---------- */

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--c-text-2);
  font-weight: 500;
}
.form-row label .req { color: var(--c-danger); margin-left: 2px; }

input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="month"], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d0d7de;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--c-text);
  box-sizing: border-box;
}
input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="month"], select {
  height: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
input:disabled, select:disabled, textarea:disabled {
  background: #f6f8fa;
  color: var(--c-text-2);
  cursor: not-allowed;
}
textarea { resize: vertical; min-height: 68px; }

/* 只读展示块：编辑页里不可编辑的字段（名称/备注等由乙方维护的内容） */
.readonly-box {
  padding: 8px 10px;
  background: var(--c-bg-2, #f6f8fa);
  border: 1px solid var(--c-border, #e2e6ea);
  border-radius: 4px;
  color: var(--c-text-2, #6b7684);
  min-height: 20px;
}
.readonly-box:empty::before {
  content: "（无）";
  color: var(--c-text-3, #9aa4b0);
}
input[readonly] {
  background: var(--c-bg-2, #f6f8fa);
  color: var(--c-text-2, #6b7684);
  cursor: not-allowed;
}

.form-hint { font-size: 12px; color: var(--c-text-2); margin-top: 4px; }

/* ⚠️ **``my-0`` 之前根本没定义**（2026-10-24 发现）——
   全站模板都在用 ``class="form-hint my-0"`` 表达「不要上边距」，
   但 CSS 里查无此类 → **那条意图一直没生效**（各有 4px 上边距）。
   现在补上，别让模板继续写空类名。 */
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-default { background: #fff; color: var(--c-text); border-color: #d0d7de; }
.btn-default:hover { background: #f6f8fa; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-link { background: none; color: var(--c-primary); padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

/* ---------- 筛选条 ---------- */

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-row { margin-bottom: 0; min-width: 160px; }

/* ---------- 提示条 ---------- */

.flash-list { position: fixed; top: 64px; right: 24px; z-index: 999; max-width: 380px; }
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
  border: 1px solid;
  box-shadow: var(--shadow);
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* 悬浮 flash 提示（2026-11-08）：fixed 定位，不推挤页面内容 */
.flash-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  max-width: 90vw;
}
.flash-stack .alert {
  margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

/* ---------- 状态标签 ---------- */

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.6;
}
.tag-gray { background: #f1f3f5; color: #495057; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }

/* ---------- 菜单 ---------- */

.menu { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.menu a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--c-text-2);
  text-decoration: none;
  font-size: 13px;
}
.menu a:hover { background: #eef1f4; color: var(--c-text); }
.menu a.active { background: var(--c-primary); color: #fff; }

/* ---------- 统计卡 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  /* ⚠️ **gap 10px**（2026-10-23 统一）——跟 .kpi-grid 一致 */
  gap: 10px;
  margin-bottom: 16px;
}
/* ⚠️ 2026-11-11 工作台 BI 化：固定 3 列栅格，
   与统计卡行（3 卡）列宽严格一致、上下列边界对齐。
   第二行只有 2 卡时，占前 2 列、第 3 列留空。 */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  /* ⚠️ **12px 14px**（2026-10-23 统一）——
     原来 14px 16px，比 .card-header（12px 16px）还高 → 卡片显得松 */
  padding: 12px 14px;
  box-shadow: var(--shadow);
  /* ⚠️ 2026-11-11 排版优化：flex 垂直布局，
     明细行（.stat-rows）用 margin-top:auto 推到底部 →
     同一行卡片内容顶部对齐、明细行底部对齐，减少内容多少不一的视觉落差 */
  display: flex;
  flex-direction: column;
  height: 100%;
}
.stat-label { font-size: 12px; color: var(--c-text-2); margin-bottom: 4px; }
/* ⚠️⚠️ **统计卡数字统一 21px**（2026-10-23 用户要求：
   「按物料档案的大小比例，统一每个业务界面的大小」）
   ⚠️ 原来 ``.stat-value`` 是 22px、``.kpi-value`` 是 26px
   → **工作台比其他 9 个业务页大 4px** → 切页面时字号会「跳」。
   ✅ **统一到 21px**（跟 ``.page-title`` 的 20px 同一量级，
      突出但不突兀，跟物料档案页的 13px 正文 / 20px 标题形成层级）。 */
.stat-value { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--c-text-2); margin-top: 2px; }

/* ---------- 统计卡 · 结构化补充件（2026-10-23 工作台改造） ----------
   ⚠️ **为什么要有这一段**：工作台「本月应付 / 已付 / 未到期 / 逾期」
   原来只有 4 个裸数字，甲方看不出「还剩多少没付」「什么时候到付款日」。
   → 光加文字没用（用户明确说「显示的方式应该不是单纯文字」），
   → 所以给统计卡加**进度条**和**键值行**两种结构化元素。

   ⚠️ **零依赖**：离线环境没有 ECharts / Chart.js，CDN 也加载不了
   → 进度条一律用纯 CSS（div + 宽度百分比）。
   ------------------------------------------------- */

/* 进度条：外层灰底（= 100%），内层彩色填充 */
.stat-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--c-border);
  overflow: hidden;
  margin: 8px 0 6px;
}
.stat-bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--c-primary);
}
.stat-bar.bar-paid   > i { background: var(--c-success); }
.stat-bar.bar-danger > i { background: var(--c-danger); }
.stat-bar.bar-warn   > i { background: var(--c-warning); }
.stat-bar.bar-info   > i { background: var(--c-info); }

/* ⚠️ **堆叠条**（本月应付 = 已付 + 未付）——两段并排，一眼看完成度 */
.stat-bar.is-stack { display: flex; }
.stat-bar.is-stack > i { border-radius: 0; }
.stat-bar.is-stack > i:first-child { border-radius: 3px 0 0 3px; }
.stat-bar.is-stack > i:last-child  { border-radius: 0 3px 3px 0; }
.stat-bar.is-stack > i.seg-paid   { background: var(--c-success); }
.stat-bar.is-stack > i.seg-unpaid { background: var(--c-border); }
/* ⚠️⚠️ **2026-10-24 新增 · 支出去向双色条**
   「本月支出去向」= 本月付款里「冲逾期」vs「冲当期」两部分。
   → 红=冲逾期（还老账）、绿=冲当期（还新货款），
     一眼看出「本月掏的钱有多少在还逾期欠款」（用户第③问）。 */
.stat-bar.is-stack > i.seg-overdue { background: var(--c-danger); }
.stat-bar.is-stack > i.seg-current  { background: var(--c-success); }

/* ⚠️ **归月基准切换器**（2026-10-24 新增）
   工作台的卡从「写死本月」改成「可切历史月」——
   甲方要能看到「上个月实际掏了多少、其中多少在还逾期」。
   ⚠️ **不是新组件**：复用 .btn / .btn-sm，只是包一层排版。 */
.month-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text-2);
  margin-bottom: 12px;
  padding: 6px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.month-switch .ms-label { font-weight: 500; color: var(--c-text); }
.month-switch .ms-cur {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
}
.month-switch .ms-note { color: var(--c-text-2); }

/* 键值行：卡里的「标签 — 值」小行 */
/* ⚠️ 2026-11-11 margin-top:auto —— 配合 .stat-card 的 flex 布局，
   把明细行推到底部，同一行卡片底部对齐 */
.stat-rows { margin-top: auto; padding-top: 6px; }
.stat-rows .srow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text-2);
  padding: 2px 0;
}
.stat-rows .srow > span:last-child {
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.stat-rows .srow.warn > span:last-child { color: var(--c-warning); }
.stat-rows .srow.danger > span:last-child { color: var(--c-danger); }
.stat-rows .srow.ok > span:last-child { color: var(--c-success); }
.stat-rows .srow.info > span:last-child { color: var(--c-primary); }

/* 徽标小标签（笔数、日期等） */
.stat-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1.6;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid var(--c-border);
  background: #f8fafc;
  color: var(--c-text-2);
  margin-right: 4px;
}
.stat-tag.is-danger { border-color: var(--c-danger); color: var(--c-danger); background: #fff5f5; }
.stat-tag.is-warn   { border-color: var(--c-warning); color: var(--c-warning); background: #fffaf0; }
.stat-tag.is-ok     { border-color: var(--c-success); color: var(--c-success); background: #f0fff4; }

/* ---------- 待开发模块标记 ---------- */

.placeholder-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.placeholder {
  border: 1px dashed #d0d7de;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fafbfc;
}
.placeholder-code { font-size: 11px; color: var(--c-text-2); }
.placeholder-name { font-size: 13px; font-weight: 500; }
.placeholder-step { font-size: 11px; color: var(--c-warning); margin-top: 2px; }

/* ---------- 登录页（2026-10-26 美化 · 方案 A「稳健专业」）---------- */

/* 整页：左右分栏（左品牌 / 右登录） */
.login-body { background: #fff; }
.login-page { display: flex; min-height: 100vh; }

/* ---------- 左侧品牌区 ---------- */
.login-brand {
  /* ⚠️ 44% → 46%（2026-10-26 截图后调）——
     右侧太窄时 348px 的表单在中间「漂浮」，两边各空一大片。 */
  width: 46%;
  max-width: 540px;
  flex: 0 0 46%;
  /* ⚠️ **渐变别经过紫**（2026-10-26 截图后调）——
     原来 #1e3a8a → #2563eb → #3b82f6 中间插值出紫色调，看着"脏"。
     → 三色同在蓝系，明度递进。 */
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 58%, #2f6fe4 100%);
  color: #fff;
  padding: 52px 52px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* 右上 / 左下装饰光弧 */
.login-brand::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -190px;
  top: -170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.login-brand::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  left: -140px;
  bottom: -130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.login-brand-logo { display: flex; align-items: center; gap: 11px; position: relative; }
.login-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}
.login-brand-name { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
/* ⚠️ **内容紧跟 logo**（2026-10-26 截图后调）——
   原来 ``justify-content: space-between`` 把 logo/标题/脚注撑到三头
   → 中间大片空白，松散。→ 标题块跟 logo 走，脚注沉底。 */
.login-brand-mid { position: relative; margin: 64px 0 0; }
.login-brand-title { font-size: 30px; font-weight: 650; line-height: 1.35; letter-spacing: .5px; }
.login-brand-desc {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, .82);
}
.login-brand-points { list-style: none; margin-top: 30px; display: grid; gap: 13px; }
.login-brand-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .92);
}
.login-brand-tick {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  flex: 0 0 19px;
  background: rgba(255, 255, 255, .2);
  display: grid;
  place-items: center;
}
.login-brand-foot {
  position: relative;
  margin-top: auto;
  padding-top: 28px;
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
}

/* ---------- 右侧登录区 ---------- */
.login-panel {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px 40px;
  /* ⚠️ 略深一点，与白色品牌区拉开层次（截图后调） */
  background: #f7f9fb;
}
/* ⚠️⚠️ **必须 ``min-width: 0``**（2026-10-26 移动端截图发现）
   grid item 默认 ``min-width: auto`` → 宽度不小于 **min-content**
   → 输入框的 placeholder「甲方账号或供应商编码」把整块撑破
   → 移动端右侧被裁掉。 */
.login-form { width: 100%; max-width: 384px; min-width: 0; }
.login-form-title { font-size: 22px; font-weight: 650; letter-spacing: .3px; }
.login-form-sub { margin-top: 8px; font-size: 13.5px; color: var(--c-text-2); }
.login-alerts { margin-bottom: 18px; }
.login-field { margin-top: 26px; }
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 8px;
  color: #32383f;
}
.login-field input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 14.5px;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid #d8dee4;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input::placeholder { color: #a8b0b8; }
.login-field input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
/* 密码显隐：包裹层 + 眼睛按钮 */
.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 44px; }
.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #8a949e;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
.login-password-toggle:hover { color: var(--c-primary); }
.login-password-toggle.is-visible { color: var(--c-primary); }
.login-btn {
  width: 100%;
  height: 46px;
  margin-top: 30px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: var(--c-primary);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .08s;
}
.login-btn:hover { background: var(--c-primary-dark); }
.login-btn:active { transform: translateY(1px); }
.login-form-note { margin-top: 18px; font-size: 12.5px; color: #8b949e; text-align: center; }

/* 窄屏：品牌区收到顶部，只留标题 */
@media (max-width: 860px) {
  .login-page { flex-direction: column; }
  .login-brand {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 28px 22px;
  }
  .login-brand-mid { margin: 24px 0 0; }
  .login-brand-points,
  .login-brand-foot { display: none; }
  .login-panel { padding: 34px 20px 52px; }
  .login-form { max-width: 100%; }
}

/* ---------- 错误页 ---------- */

.error-box { text-align: center; padding: 80px 24px; }
.error-code { font-size: 56px; font-weight: 700; color: var(--c-text-2); line-height: 1; }
.error-msg { font-size: 16px; margin: 12px 0 24px; color: var(--c-text); }

/* ---------- 提示块 ---------- */

.notice {
  padding: 10px 14px;
  background: #f6f8fa;
  border-left: 3px solid var(--c-info);
  border-radius: 3px;
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 16px;
}
/* ---------- 附件 ---------- */
/* 证书附件的小胶囊标签，点开在新标签页内联预览 */
.file-chip {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  padding: 1px 8px;
  margin: 0 4px 4px 0;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: #f6f8fa;
  color: var(--c-primary);
  font-size: 12px;
  text-decoration: none;
}
.file-chip:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* 禁用态按钮：按钮常驻但当前不可用（如已是启用态时的「停用」）。
   不用 display:none，因为隐藏掉就丢失了「该操作存在但现在不可用」的信息。
   同时兜住 cursor 与 pointer-events，防止 JS 绕过 disabled。 */
.btn-disabled,
button:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* ================================================================
   工具类（2026-10-16 整理）
   ================================================================
   背景：30 个模板里有 485 处内联 style，压缩下来只有 116 个唯一值。
   重复最多的是「提示框」那套组合：
       style="border-left-color:var(--c-warning);background:#fffbeb"
   出现 15 次，横跨 6 个模板 —— 改配色要翻 6 个文件。

   把这类跨模板复用的提成类：外观不变，但改一次就够。
   **只收「确实跨模板重复」的**，一次性微调仍留内联，不要过度抽象。
   ================================================================ */

/* ---------- 提示框 ---------- */
/* 语义色 + 浅底 = 一整套「提醒」。原先每个模板手写一遍组合。 */
.notice {
  border-left: 3px solid var(--c-border);
  background: var(--c-bg);
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.notice-warning {
  border-left-color: var(--c-warning);
  background: #fffbeb;
}
.notice-danger {
  border-left-color: var(--c-danger);
  background: #fef2f2;
}
.notice-success {
  border-left-color: var(--c-success);
  background: #f0fdf4;
}
.notice-info {
  border-left-color: var(--c-info);
  background: #f0f9ff;
}
/* 页内提示块：不需要下边距（自己控制间距时用） */
.notice-flush { margin-bottom: 0; }

/* ---------- 语义文字色 ---------- */
.text-primary { color: var(--c-primary); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-danger  { color: var(--c-danger); }
.text-info    { color: var(--c-info); }
.text-muted   { color: var(--c-text-2); }
/* 金额 / 关键数值：略加大加粗，用于对账金额列 */
.text-amount { font-size: 15px; font-weight: 600; color: var(--c-primary); }
.text-bold    { font-weight: 600; }

/* ---------- 对齐 ---------- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
/* 表格里的数字列：右对齐 + 等宽数字，便于纵向比对金额 */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 间距 ---------- */
.mt-0 { margin-top: 0; }
.mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
/* 上下各留一点，用于两个相邻块之间 */
.my-8  { margin: 8px 0; }
.my-12 { margin: 12px 0; }

/* ---------- 布局 ---------- */
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.flex-end      { margin-left: auto; }
.align-end     { align-items: flex-end; }
.w-auto        { width: auto; }
.w-full        { width: 100%; }
.container-900 { max-width: 900px; }
.container-820 { max-width: 820px; }
/* 隐藏但仍占位：表单里的「另有一个隐藏域」等场景 */
.relative { position: relative; }

/* ---------- 表单辅助 ---------- */
/* 表格里的小字说明（原先都是 style="font-size:12px"） */
.tiny { font-size: 12px; }
.clickable { cursor: pointer; }

/* 只改左边框色、不换底色 —— 模板里是
   class="notice" style="border-left-color:var(--c-info)"
   （7 处）。底色保持 .notice 的中性灰，只强调语义。 */
.notice-info-line   { border-left-color: var(--c-info); }
.notice-primary-line { border-left-color: var(--c-primary); }
.notice-warning-line { border-left-color: var(--c-warning); }
.notice-danger-line  { border-left-color: var(--c-danger); }

/* ---------- 订单选料：价格选项单选（2026-10-16）---------- */
/* 基准价与所有可用协商价并列成单选列表，默认选基准价。
   协商价是「特定批次的特批价」，由下单的人按实际数量判断用哪个。 */
.price-opt {
  display: block;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  line-height: 1.5;
}
.price-opt:hover { border-color: var(--c-primary); background: #f8fafc; }
.price-opt-on {
  border-color: var(--c-primary);
  background: #eff6ff;
}
.price-opt-price {
  font-weight: 600;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}
/* 数量不在适用区间内的协商价：置灰但**仍显示**——
   让用户知道有这个价、为什么不能用，而不是压根看不到。 */
.price-opt-off {
  opacity: .55;
  cursor: not-allowed;
  background: #f8f9fa;
}
.price-opt-off:hover { border-color: var(--c-border); background: #f8f9fa; }
.price-opt .form-hint { margin-top: 2px; }

/* ---------- 订单明细行：确认态（2026-10-16）---------- */
/* 点「确认」后该行标成已确认，颜色区分于未确认的行 ——
   让人一眼看出哪几行还没核过。 */
.row-confirmed { background: #f0fdf4; }
.row-confirmed .btn[disabled] { opacity: 1; }

/* ---------- 订单明细：数量输入框（2026-10-16 用户报障后修）---------- */
/* 现象：填数量时 number 输入框的上下箭头把框挤窄，数量显示不全。
   原因：① 上下箭头占约 20px  ②「单价」列装价格选项列表后变宽，
   把整张表撑开，其他列被压缩。
   处理：① 隐藏箭头（反正没人用鼠标点它，step=0.01 已足够）
        ② 列宽重新分配，见 form.html 的 <th style="width:..."> */
.order-table .qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}
.order-table .qty-input::-webkit-outer-spin-button,
.order-table .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* 隐藏箭头后框会变宽，这里给个下限，保证数字完整显示 */
.order-table .qty-input {
  min-width: 82px;
  width: 100%;
}
/* 表格不再被内容撑变形 —— 列宽按表头固定，
   内容超宽时在单元格内换行而不是压缩整列。 */
table.table.order-table {
  table-layout: fixed;
  width: 100%;
}
table.table.order-table td,
table.table.order-table th {
  word-break: break-word;
}

/* ⚠️ **2026-11-03 通用「固定列宽」表格**：
   对账单列表 13 列溢出 260px 后，用 ``table-layout:fixed`` + 按内容重排列宽。
   抽成通用 ``.table-fixed``，任何「列数多、容易溢出」的宽表都可加它，
   让 th 的 width 被严格尊重、超宽内容在单元格内换行而不是撑破整列。
   ⚠️ 只加给**写全了 th width** 的表 —— 没写 width 的表加 fixed 会按均分分配，
   可能比 auto 更难看（所以不全局强制，由模板主动加 class）。 */
table.table.table-fixed {
  table-layout: fixed;
  width: 100%;
}
table.table.table-fixed td,
table.table.table-fixed th {
  word-break: break-word;
}
/* 兼容别名：对账单列表页历史上叫 statement-table */
table.table.statement-table {
  table-layout: fixed;
  width: 100%;
}
table.table.statement-table td,
table.table.statement-table th {
  word-break: break-word;
}

/* 价格选项在单元格内**纵向堆叠**，不横向撑开列宽。
   （用户 2026-10-16 报障的根因之一：选项列表把整张表撑变形，
     连带把数量列压窄。） */
.order-table .price-cell { width: 100%; }
.order-table .price-opt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 5px 7px;
  margin-bottom: 4px;
}
.order-table .price-opt .form-hint {
  flex-basis: 100%;
  margin: 0;
  line-height: 1.3;
}
.order-table .price-opt-price {
  flex: 0 0 auto;
  min-width: 46px;
}

/* ══════════════════════════════════════════════════════════════════
   工作台（M15 · 2026-10-22 按「工作台界面设计规范」重做）
   ══════════════════════════════════════════════════════════════════ */

/* ---- ① 待办告警区（**0 值隐藏不占位**）---- */
.alert-strip {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch;
}
.alert-item {
  display: flex; align-items: center; gap: 10px;
  /* ⚠️ **9px 13px**（2026-10-23 统一）—— 跟 .kpi 密度一致 */
  padding: 9px 13px; border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface, #fff);
  text-decoration: none; color: inherit;
  min-width: 190px;
  transition: box-shadow .15s, transform .15s;
}
.alert-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.10); transform: translateY(-1px); }
.alert-item .alert-count {
  /* ⚠️ **21px**（2026-10-23 统一）—— 原来 26px */
  font-size: 21px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.alert-item .alert-label { font-size: 13px; font-weight: 600; }
.alert-item .alert-hint  { font-size: 11px; color: var(--c-text-2); }
/* ⚠️ 1~5 → 橙；>5 或含过期 → 红 */
.alert-item.level-warning { border-color: #f6ad55; background: #fffaf0; }
.alert-item.level-warning .alert-count { color: #c05621; }
.alert-item.level-danger  { border-color: #fc8181; background: #fff5f5; }
.alert-item.level-danger  .alert-count { color: #c53030; }
/* ⚠️⚠️ **``.level-ok`` 是 2026-10-24 新增** —— 「待办事项 0 条」的样式
   灰底灰字，**不用红橙**：0 条不是警报，是「一切正常」。
   ⚠️ 没有这个类 → 0 待办那一条会**掉进 level-warning 的默认边框**
   （或干脆没有边框），看着像出错了。 */
.alert-item.level-ok { border-color: #cbd5e0; background: #f7fafc; }
.alert-item.level-ok .alert-count { color: #4a5568; }
/* ⚠️ **``.level-watch`` 是 2026-10-25 新增** —— 甲方待办第三层「监控型」
   （如「变更申请待审批」）。灰底灰字：它是**要办的事**，但不是
   「不办就卡死」的那种 → 不该用红/橙吓人。 */
.alert-item.level-watch { border-color: #cbd5e0; background: #f7fafc; }
.alert-item.level-watch .alert-count { color: #4a5568; }

/* ---- 待办事项分类徽章（2026-10-25 新增）----
   ⚠️ **为什么要有这个组件**：
   用户 2026-10-25 要求「待办事项在工作台不展开明细，点击后流转到独立页面」
   → 工作台上只留**一行摘要**（约 60px），
   但甲方仍要**一眼看出 12 类各有多少** → 用徽章表达。
   ⚠️ **0 条的灰掉但仍显示** —— 用户要知道「有这一类、现在 0」。
   （与 ``.alert-item`` 的「0 值不占位」是**故意不同**：待办是栏目，不是告警。） */
.todo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--c-border); background: var(--c-bg);
  border-radius: 999px; padding: 2px 10px; font-size: 12px;
  text-decoration: none; color: var(--c-text-2);
}
.todo-chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.todo-chip .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-chip.zero { opacity: .45; }
.todo-chip.d { border-color: #fc8181; background: #fff5f5; }
.todo-chip.d .n { color: #c53030; }
.todo-chip.w { border-color: #f6ad55; background: #fffaf0; }
.todo-chip.w .n { color: #c05621; }
.todo-chip.m { border-color: #cbd5e0; }

/* ⚠️ **告警条锚点定位** —— 顶部「待办事项」点进来要落到「我的待办」卡片上，
   但页面顶部有 sticky 侧边栏/头部，直接跳会被盖住一截。
   `scroll-margin-top` 给锚点留出偏移量。 */
#todo-list { scroll-margin-top: 72px; }

/* ---- ② 本月关键数据（只读大数字）---- */
/* ⚠️ **``.kpi-grid`` 已废弃** —— 统一用 ``.stat-grid``（见上） */
/* ⚠️ **``.kpi`` 已废弃** —— 统一用 ``.stat-card``（见上） */
/* ⚠️ **``.kpi-label`` 已废弃** —— 用 ``.stat-label`` */
/* ⚠️⚠️ **``.kpi-*`` 已废弃**（2026-10-23）
   工作台原来用一套 ``kpi-grid / kpi / kpi-value``，
   其他 9 个业务页用 ``stat-grid / stat-card / stat-value``
   → **两套结构、字号还不一样（26px vs 22px）**，切页面时字号会「跳」。

   ✅ **统一成 ``stat-*`` 那一套**（9 个业务页 + 工作台 = 同一套）。
   下面是「统计卡当链接用」的补充样式（``.stat-card`` 本身是 ``<div>``）。 */
a.stat-card { text-decoration: none; color: inherit; display: block; }
a.stat-card:hover { border-color: var(--c-primary); }
/* ---- 状态色（原来挂在 .kpi.is-* 上，现在挂在 .stat-card 上）---- */
.stat-card.is-danger .stat-value { color: var(--c-danger); }
.stat-card.is-warning .stat-value { color: var(--c-warning); }
.stat-card.is-muted .stat-value { color: var(--c-text-2); font-weight: 500; }

/* ---- ③ 账龄环图（**纯 SVG，零依赖**）---- */
.aging-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.aging-svg { flex: 0 0 auto; }
.aging-legend { flex: 1 1 200px; min-width: 200px; }
.aging-legend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; font-size: 13px;
}
.aging-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
}
.aging-legend-row .lg-label { flex: 1 1 auto; }
.aging-legend-row .lg-amt {
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.aging-legend-row .lg-pct {
  color: var(--c-text-2); font-size: 11px; width: 46px; text-align: right;
}
.aging-legend-row a.lg-label:hover { color: var(--c-primary); text-decoration: underline; }

/* ---- 顶部窗口期条 ---- */
.window-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 6px; margin-bottom: 12px;
  font-size: 13px;
}
.window-bar.state-open    { background: #e6fffa; color: #285e61; border: 1px solid #4fd1c5; }
.window-bar.state-closed  { background: #fff5f5; color: #742a2a; border: 1px solid #fc8181; }
.window-bar.state-not_yet { background: #f7fafc; color: #4a5568; border: 1px solid #cbd5e0; }
.window-bar .wb-days { font-weight: 700; }

/* ---- 逾期 TOP5 ---- */
.top5-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--c-border);
  text-decoration: none; color: inherit;
}
.top5-row:last-child { border-bottom: none; }
.top5-row:hover { background: var(--c-bg-2, #f7fafc); }
.top5-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-danger); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.top5-name { flex: 1 1 auto; }
.top5-days {
  font-weight: 700; color: var(--c-danger);
  font-variant-numeric: tabular-nums;
}
.top5-amt {
  width: 120px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- 我的权限（**从首页移出**，进头像菜单）---- */
.perm-list { margin: 0; }
.perm-list td, .perm-list th { font-size: 13px; }

/* ══════════════════════════════════════════════════════════════════
   深色侧边栏布局（2026-10-23 · 用户选「版 A 控制台」）
   ══════════════════════════════════════════════════════════════════ */
/* ⚠️ **只在带 .layout-side 的页面生效** —— 登录页没有侧边栏，
   别用 `body {}` 全局改，否则登录页会被挤到右边。 */
/* ⚠️⚠️⚠️ **body 必须 ``height:100vh; overflow:hidden``**（2026-10-23）
   ──────────────────────────────────────────────────────────────
   ⚠️ **最后 15px 的差异来自「body 自己的滚动条」**：
   ```
   /change/    main = 879   ← 内容短，body 不溢出 → **body 无滚动条**
   /material/  main = 864   ← 内容长，body 溢出   → **body 有滚动条（15px）**
   ```
   → 视口越窄，这个差越明显。

   ✅ **body 不滚动（``overflow:hidden`` + ``height:100vh``），
   由右侧 ``.side-body`` 自己滚**（``overflow-y:scroll``）
   → 侧边栏固定、右侧内容独立滚动，**所有页面宽度完全一致**。

   ⚠️ 这是标准的后台系统布局（侧边栏固定 + 内容区独立滚动）。 */
body.layout-side {
  display: flex; height: 100vh; overflow: hidden; margin: 0;
  background: var(--c-bg, #f6f7f9);
  /* ⚠️ **2026-11-01 弹性撑满**：不加 min-width ——
     内容区 flex:1 始终撑满剩余宽度，缩小窗口时内容弹性收缩
     （卡片 auto-fit 自动换行、表格 table-wrap 内部横滚），
     左右内边距固定，不出现整页横向滚动。 */
  width: 100vw;   /* 显式撑满视口，缩放后也不留白 */
}

/* ---- 侧边栏本体 ---- */
/* ⚠️⚠️ **宽度 212 → 186px**（2026-10-23 用户要求）
   ──────────────────────────────────────────────────────────────
   用户原话：「左侧栏的宽度适当小一些（**供应商管理的理字右侧边缘
   距离左侧栏右边框减少一半**），同时右侧页面宽幅增加其减少的一半距离」

   ⚠️ **「品牌文字右边缘到右边框」的距离 = 侧边栏宽 − 左内边距 − 文字宽**
   → **左侧内边距不变、侧边栏变窄 26px**，
     右边距就从 51px 自动变成 25px（**正好减半**），
     而右侧内容区**同样多出 26px**。

   ⚠️ **不缩窄品牌文字**（缩了就破坏「字右边缘」这个基准点）。 */
.side {
  width: 186px; flex: 0 0 186px;
  background: #1e293b; color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 15px 17px 13px; color: #fff; text-decoration: none;
  font-size: 14.5px; font-weight: 700;
}
.side-logo {
  width: 25px; height: 25px; border-radius: 6px; background: #3b82f6;
  display: inline-flex; align-items: center; justify-content:center;
  font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.side-nav { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ---- 分组标题（业务阶段）---- */
.side-grp { margin-bottom: 3px; }
.side-grp-t {
  padding: 11px 17px 5px; font-size: 10.5px; color: #64748b;
  font-weight: 700; letter-spacing: .4px;
  display: flex; align-items: center; gap: 7px;
}
.side-grp-t::after { content: ""; flex: 1; height: 1px; background: #334155; }

/* ---- 菜单项 ---- */
.side-item {
  display: block; padding: 7px 17px 7px 19px;
  font-size: 13px; color: #cbd5e1; text-decoration: none;
  border-left: 2.5px solid transparent; transition: background .12s, color .12s;
}
.side-item:hover { background: #263449; color: #fff; }
.side-item.on {
  background: #263449; color: #fff;
  border-left-color: #3b82f6; font-weight: 600;
}

/* ⚠️ 2026-11-11 侧边栏二级分组：低频项收进「更多」子菜单 */
.side-more { margin-top: 2px; }
.side-more-t {
  padding: 6px 17px 6px 19px; font-size: 12px; color: #64748b;
  cursor: pointer; user-select: none;
}
.side-more-t:hover { color: #cbd5e1; }
.side-more-t.open { color: #cbd5e1; }
.side-item-sub { padding-left: 30px; font-size: 12.5px; color: #94a3b8; }
.side-item-sub.on { color: #fff; }

/* ---- 底部用户 ---- */
.side-foot { border-top: 1px solid #334155; padding: 11px 14px; }
.side-user { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.side-avatar {
  width: 27px; height: 27px; border-radius: 50%; background: #3b82f6;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.side-user strong { display: block; color: #e2e8f0; font-size: 12.5px; }
.side-user em {
  display: block; color: #64748b; font-size: 10.5px; font-style: normal;
}

/* ---- 右侧内容区 ---- */
/* ⚠️⚠️⚠️ **必须 ``overflow-y: scroll``**（2026-10-23 用户报障「页面还是不一样」）
   ──────────────────────────────────────────────────────────────
   ⚠️ **最后 15px 的差异来自「垂直滚动条」**：
   ```
   /change/    main = 894   ← 内容短，**没有滚动条**
   /material/  main = 879   ← 内容长，**有滚动条（占 15px）**
   ```
   → 同一个系统里，**页面宽幅差一个滚动条的宽度**。

   ✅ **滚动条永远占位**（``overflow-y: scroll``）→
   无论内容长短，右侧内容区宽度**完全一致**。

   ⚠️ **为什么不用** ``scrollbar-gutter: stable``：
   那个是**较新**的属性，老浏览器不认 → 会退化成「有的页面有、有的没有」。
   ⚠️ ``overflow-y: scroll`` 兼容性最好，行为也最确定。 */
.side-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  overflow-y: scroll;          /* ⚠️ 滚动条永远占位 → 宽度一致 */
}

/* ⚠️⚠️⚠️ **这里必须写 width:100%**（2026-10-23 用户报障「页面宽幅不一样」）
   ──────────────────────────────────────────────────────────────
   ⚠️ **根因**：``.side-body`` 是 **flex 容器**（``flex-direction:column``），
   而 ``.container`` 有 ``margin: 0 auto`` ——
   在 flex 的 **cross-axis** 上，``auto`` 外边距会**吸收多余空间**，
   导致 flex item **收缩到内容宽度**（不再是「撑满 + 居中」）。

   实测（headless Chrome，1600 视口）：
   ```
   /material/   main = 1280   ← 表格宽，撑满了
   /change/     main =  686   ← 只有几列 + 「共 0 条」→ 缩到内容宽
   /order/      main = 1068
   /write-off/  main = 1060
   ```
   → **页面宽度跟着内容变** —— 同一个系统里页面宽幅参差不齐。

   ✅ **加 ``width:100%``** → 宽度不再受内容影响，
   ``max-width:1280px`` 仍然生效（超宽时居中）。
   ⚠️ **不写这一条，max-width 也没用**（元素压根到不了 1280）。 */
.side-body > .container,
.side-body > .topbar { width: 100%; }

/* ⚠️ **2026-11-01 撑满**：后台内容区不再 1280 居中留白，
   大屏时撑满整行（min-width 1280 已在 body.layout-side 上）。
   ⚠️ 只覆盖后台页（.layout-side 下），登录页的 .container 不受影响。 */
.side-body > .container { max-width: none; }

.side-body > .topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--c-border);
}
/* ⚠️ **顶栏只剩右边的用户操作** —— 左侧空着（品牌移到侧边栏了） */
.side-body > .topbar .menu:empty { display: none; }
/* ⚠️ 内容区左右留白 —— 顶栏同样对齐，别出现「内容缩进而顶栏没缩进」 */
.side-body > .container { padding-left: 24px; padding-right: 24px; }

/* ⚠️ **2026-11-01 已删除「窄屏收起侧边栏」的 media query**：
   原来 `@media (max-width:900px)` 把侧边栏文字 ``font-size:0`` 隐藏，
   但菜单项本来就没有图标 → 手机窄屏下只剩一条空深色条（文字没了、
   盲点还有反应）。
   → 按「不追求移动端完美适配」原则，侧边栏在窄屏下**保持完整 186px
   + 文字正常**，窄屏时整个页面横向滚动（配合 body.width:100vw）。 */

/* ══════════════════════════════════════════════════════════════════
   业务流程图（2026-10-23 用户要求）
   ══════════════════════════════════════════════════════════════════ */
/* ⚠️ **它不是导航** —— 入口在左侧边栏，这里只回答
   「这件事在流程的哪一步」。所以**纯文字、不可点**。 */
.flow {
  display: flex; align-items: stretch; gap: 0;
  overflow-x: auto; padding: 4px 0 8px;
}
.flow-stage {
  flex: 1 1 0; min-width: 168px;
  border: 1px solid var(--c-border); border-radius: 10px;
  background: #fff; padding: 12px 13px;
  display: flex; flex-direction: column;
}
.flow-arrow {
  flex: 0 0 30px; display: flex; align-items: center; justify-content: center;
  color: var(--c-text-3); font-size: 17px;
}
.flow-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.flow-no {
  width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff; flex: 0 0 auto;
}
.flow-name { font-size: 13.5px; font-weight: 700; }
.flow-desc {
  font-size: 11px; color: var(--c-text-2); line-height: 1.5;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--c-border);
}
.flow-mods { display: flex; flex-wrap: wrap; gap: 4px; }
.flow-mod {
  font-size: 11px; padding: 2px 7px; border-radius: 5px;
  background: var(--c-bg-2); color: var(--c-text-1); white-space: nowrap;
}
/* ---- 系统配置（不在流程里，单独一行）---- */
.flow-sys {
  margin-top: 12px; padding: 9px 13px; border-radius: 8px;
  background: var(--c-bg-2); border: 1px dashed var(--c-border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.flow-sys .lb { font-size: 12px; font-weight: 700; color: var(--c-text-2); }
.flow-sys .ds { font-size: 11px; color: var(--c-text-3); }
/* ---- 窄屏：流程图改成纵向 ---- */
@media (max-width: 860px) {
  .flow { flex-direction: column; }
  .flow-arrow { flex: 0 0 22px; transform: rotate(90deg); }
  .flow-stage { min-width: 0; width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════
   页面宽度统一（2026-10-23 用户要求）
   ══════════════════════════════════════════════════════════════════ */
/* ⚠️ **所有页面的容器统一 1280px**（= 物料档案页的基准）。
   原来 30 个页面**各写各的** inline max-width（640~1500px 不等）
   → 「每个页面宽幅不一样」。

   ⚠️ **但表单/详情页的内容仍要限制可读宽度** ——
   容器统一了，**输入框不能拉成 1280 宽**（那没法看）。
   → 用 ``.form-narrow`` 把字段区收窄，容器本身仍然对齐。 */
.form-narrow { max-width: 860px; }
.form-narrow-wide { max-width: 1100px; }

/* ⚠️ 2026-11-08 预付款表单：一行 6 字段等宽排布，不留白 */
.adv-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: start;
}
.adv-grid .form-group { margin: 0; }
.adv-grid .form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--c-text-2);
  font-weight: 500;
  height: 18px;
  line-height: 18px;
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .adv-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .adv-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ⚠️ 2026-11-10 通用表单栅格：标签对齐 + 控件等高 + 栅格等宽。
   用于「乙方编辑资料」等字段表单，替代 `.filter-bar` 的 flex（宽度不均、
   长字段如「户名」被截断）。支持 ``.span-2``（跨两列）/ ``.span-full``（整行）。
   默认按内容自动等宽，最小 180px，窄屏自动换列。 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
  align-items: start;
}
.form-grid .form-row { margin: 0; }
.form-grid .form-row label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--c-text-2);
  font-weight: 500;
  height: 18px;
  line-height: 18px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-full { grid-column: 1 / -1; }
/* 等宽均分（指定列数时用）：覆盖 auto-fit，保证一行 N 列严格等宽 */
.form-grid.form-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.form-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .form-grid.form-grid-cols-3,
  .form-grid.form-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   筛选区控件宽度（2026-10-23 · 配合「页面宽幅统一」）
   ══════════════════════════════════════════════════════════════════ */
/* ⚠️ **``.filter-row`` 之前没有 CSS 定义** ——
   用它包着的页面（发票台账等），里面的 ``<select>``
   触发 ``width:100%`` → **拉满 1150px**，一个下拉占半屏。

   ✅ **补上定义**（跟 ``.filter-bar`` 一样的 flex 布局），
   并给筛选区控件**限宽** —— 页面宽了，控件不该跟着无限拉宽。 */
.filter-row {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.filter-row > div { min-width: 160px; max-width: 320px; }

/* ⚠️ **通用兜底**：任何筛选区里的控件都别拉满整行。
   关键词框可以宽一点（要放长编码）。 */
.filter-bar input[type="text"],
.filter-row input[type="text"] { max-width: 420px; }
.filter-bar select,
.filter-row select { max-width: 320px; }

/* ══════════════════════════════════════════════════════════════════
   逾期待处理 · 校验弹窗（2026-10-23）
   ══════════════════════════════════════════════════════════════════ */
.ov-modal-wrap {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ov-modal {
  background: #fff; border-radius: 12px; max-width: 760px; width: 100%;
  max-height: 86vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
.ov-modal .card-header { border-radius: 12px 12px 0 0; }

/* ══════════════════════════════════════════════════════════════════
   甲方人员账号创建 + 权限勾选（2026-10-26）
   ══════════════════════════════════════════════════════════════════ */

/* 页面头：标题 + 右侧按钮 */
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-head-row .page-sub { margin-bottom: 0; }

/* ---------- 归属（radio 卡片）---------- */
.perm-roles { display: grid; gap: 8px; }
.perm-role {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface);
  transition: border-color .15s, background .15s;
}
.perm-role:hover { border-color: var(--c-primary); }
.perm-role input { margin: 0; }
.perm-role span { font-weight: 500; font-size: 13.5px; }
.perm-role em {
  font-style: normal; font-size: 12px; color: var(--c-text-2);
}

/* ---------- 权限分组 ---------- */
.perm-hint {
  font-size: 12.5px; color: var(--c-text-2);
  margin-bottom: 14px; line-height: 1.7;
}
.perm-admin-note { color: var(--c-primary); }

.perm-groups { display: grid; gap: 14px; }
.perm-group {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden;
}
.perm-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 12px;
  background: #f6f8fa; border-bottom: 1px solid var(--c-border);
}
.perm-group-name { font-weight: 600; font-size: 13px; }
.perm-items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px; padding: 6px;
}
/* ⚠️ **用 flex 而不是 grid**（2026-10-26 截图后改）——
   原来 ``grid-template-columns: auto 1fr auto`` 把「默认」标签推到
   **格子最右**，在多列布局下看起来像「属于下一个权限」
   （截图：供应商档案 … 默认 … 物料与价格）。
   → 改成 flex，标签**紧跟名称**。 */
.perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s;
}
.perm-item:hover { background: #f2f6fb; }
.perm-item input { margin: 0; flex: 0 0 auto; }
.perm-item-name { font-size: 13px; flex: 0 0 auto; }
.perm-item-desc { display: none; }
.perm-item.is-admin { opacity: .75; cursor: default; }
.perm-item.is-admin:hover { background: transparent; }

/* 「默认」小标签：紧跟权限名后面 */
.perm-tag {
  font-size: 11px; line-height: 1.4;
  color: var(--c-text-2); background: #eef1f5;
  padding: 0 5px; border-radius: 3px;
  flex: 0 0 auto; white-space: nowrap;
}

/* ---------- 权限计数徽标 ---------- */
.perm-count {
  display: inline-block; font-size: 12px; font-weight: 500;
  color: var(--c-text); margin-right: 4px;
}

/* 「我的权限」里的清单项（只读展示） */
.perm-item.is-on .perm-mark { color: var(--c-success); font-weight: 600; }
.perm-item.is-off { opacity: .45; }
.perm-item.is-off .perm-mark { color: var(--c-text-2); }
.perm-mark { width: 14px; text-align: center; }

/* ⚠️ 警告色按钮（2026-10-26 加 · 「待审核的期初调整单（N）」入口用） */
.btn-warning {
    background: #fff8e6;
    color: #b7791f;
    border: 1px solid #f0c96a;
}
.btn-warning:hover {
    background: #fdf3d4;
    color: #975a16;
}

/* ⚠️⚠️ **五档分账的段落色**（2026-10-28 方案 1）
   冲逾期=红 / 冲当期=绿 / **预付·结转=蓝** / 预付款冲抵=紫 / 其他=灰 */
.stat-bar.is-stack > i.seg-prepaid { background: #3182ce; }
.stat-bar.is-stack > i.seg-advance { background: #805ad5; }
.stat-bar.is-stack > i.seg-other   { background: #a0aec0; }

/* ══════════════════════════════════════════════════════════════
   可搜索下拉框（searchable select）· 2026-11-01
   配合 js/searchable-select.js 使用：给 <select> 加 class="searchable"。
   供应商多了不用滚动一个个找，输入文字实时过滤。
   ══════════════════════════════════════════════════════════════ */
.ss-wrap { position: relative; width: 100%; }
.ss-wrap select { display: none; }
.ss-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d0d7de;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--c-text);
  cursor: pointer;
}
.ss-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.ss-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  display: none;
}
.ss-wrap.ss-open .ss-list { display: block; }
.ss-item {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-item:hover { background: #f0f4ff; }
.ss-item-on { background: #eaf1ff; color: var(--c-primary); }
.ss-empty {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--c-text-2);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   移动端响应式适配（2026-11-11 · 需求 8）
   核心页手机可用：侧边栏抽屉 + 栅格单列 + 表格横滚
   ══════════════════════════════════════════════════════════════ */

/* 汉堡按钮：默认隐藏，手机上显示 */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--c-text);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* 遮罩层：侧边栏抽屉打开时盖住内容 */
.side-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, .45);
}

/* ⚠️ 手机断点（≤ 768px）：侧边栏变抽屉 */
@media (max-width: 768px) {
  .hamburger { display: inline-block; }

  /* 侧边栏默认隐藏（滑出屏幕左侧） */
  .side {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 600;
    width: 220px;
    flex: 0 0 220px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  /* 打开时滑入 */
  body.side-open .side { transform: translateX(0); }
  body.side-open .side-mask { display: block; }
  /* ⚠️ 2026-11-11 抽屉打开时锁定底层滚动，避免「滑侧边栏时右侧跟着滚」 */
  body.side-open { overflow: hidden; }

  /* 内容区不再 flex 侧栏，占满全屏 */
  body.layout-side { display: block; height: auto; overflow: auto; }
  .side-body { width: 100%; }

  /* 顶部栏精简 */
  .topbar { padding: 8px 10px; gap: 6px; }
  .topbar-right { gap: 6px; }
  .user-chip .role-badge { display: none; }
  .topbar .btn { padding: 4px 8px; font-size: 12px; }

  /* 容器内边距收紧 */
  .side-body > .container { padding-left: 12px; padding-right: 12px; }

  /* 统计卡/工作台栅格 → 单列 */
  .stat-grid,
  .dash-grid {
    grid-template-columns: 1fr !important;
  }

  /* 表格横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 业务流程竖排 */
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }

  /* 页面标题字号 */
  .page-title { font-size: 17px; }

  /* ⚠️ 对账/审批详情页适配（2026-11-11）：
     金额汇总区（filter-bar）手机变 2 列网格，字段更紧凑 */
  .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
    align-items: start;
  }
  .filter-bar > div { min-width: 0; }
  .filter-bar .form-row { min-width: 0; }

  /* 按钮行在手机上更紧凑 */
  .btn-row { gap: 6px; }
  .btn-row .btn { padding: 6px 10px; font-size: 13px; }

  /* 待办页：分类标签横向滚动，事项行紧凑 */
  .todo-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .todo-tab { flex: 0 0 auto; white-space: nowrap; }
  .todo-item { padding: 8px 6px; }

  /* 卡片内边距收紧 */
  .card-body { padding: 10px 12px; }
  .card-header { padding: 10px 12px; }
}
