/* ==========================================================================
   森茂管理系统 · 统一界面层
   与森茂销售管理系统（报价系统）共用同一套设计语言：
   深色分组侧栏 / 蓝色品牌 / 卡片 / 表格 / 状态标签
   ========================================================================== */

:root {
  --brand: #165DFF;
  --brand-dark: #0E42D2;
  --brand-light: #EEF4FF;
  --brand-ink: #0B1F4B;

  --bg: #F6F8FB;
  --card: #FFFFFF;
  --line: #E4E9F2;
  --line2: #EEF1F7;
  --text: #101828;
  --text2: #475467;
  --text3: #98A2B3;

  --ok: #067647;
  --ok-bg: #ECFDF3;
  --warn: #B54708;
  --warn-bg: #FFFAEB;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --money: #C0392B;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --h-ctl: 36px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-2: 0 4px 12px rgba(16, 24, 40, .08);
  --sh-3: 0 16px 40px rgba(16, 24, 40, .14);
  --ease: 140ms cubic-bezier(.2, .8, .2, 1);

  --nav-w: 228px;
  --nav-bg: #0C1729;
  --nav-bg2: #101E36;
  --nav-text: #A9B6CB;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { letter-spacing: -.01em; }

a { color: inherit; }

::selection { background: rgba(22, 93, 255, .16); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #D3DAE6; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #B6C0D1; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, .22);
  border-radius: var(--r-md);
}

.inline { display: inline; margin: 0; }

/* ---------- 侧栏 ---------- */
body.has-appnav { padding-left: var(--nav-w); }

.appnav {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  z-index: 60;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg2) 100%);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.an-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  flex: none;
  text-decoration: none;
}

.an-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #165DFF, #4C8BFF);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(22, 93, 255, .35);
}

.an-brand-txt { display: flex; flex-direction: column; min-width: 0; }
.an-name { color: #fff; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.an-sub { color: #5D6C85; font-size: 10.5px; letter-spacing: 1px; }

.an-edition {
  margin: 6px 10px 0;
  padding: 6px 9px;
  border-radius: 6px;
  background: #FFF4D6;
  border: 1px solid #F5D48A;
  color: #8A5A00;
  font-size: 11px;
  line-height: 1.5;
}

.an-body { flex: 1; overflow-y: auto; padding: 6px 10px 14px; }

.an-cap {
  font-size: 10.5px;
  color: #55637C;
  letter-spacing: 1.2px;
  font-weight: 600;
  padding: 14px 12px 6px;
}

.an-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--nav-text);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--ease), color var(--ease);
}

.an-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.an-item.on { background: rgba(22, 93, 255, .16); color: #fff; font-weight: 600; }
.an-item.on::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4C8BFF;
}

.an-ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; opacity: .85; }
.an-item.on .an-ico { opacity: 1; }
.an-ico svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.an-group { margin-top: 2px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .06); }
.an-group-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  border-radius: 8px;
}
.an-group-cap::-webkit-details-marker { display: none; }
.an-group-cap::after {
  content: "›";
  font-size: 13px;
  color: #6B7A94;
  transition: transform var(--ease);
}
.an-group[open] > .an-group-cap::after { transform: rotate(90deg); }
.an-group-cap:hover { color: #8FA0BC; }
.an-num { margin-left: auto; font-size: 10px; color: #46536A; letter-spacing: 0; }
.an-group[open] .an-num { display: none; }

.an-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); flex: none; }

.an-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: #8FA0BA;
  font-size: 11.5px;
  line-height: 1.5;
}
.an-status b { display: block; color: #D6DEEB; font-weight: 600; font-size: 11.5px; }
.an-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12B76A;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .18);
  flex: none;
  margin-top: 6px;
}

.an-toggle {
  display: none;
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 80;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 22px rgba(22, 93, 255, .4);
  align-items: center;
  justify-content: center;
}
.an-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.an-mask { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 55; }

/* ---------- 顶栏 ---------- */
.apptop {
  height: 62px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.crumb { font-size: 12.5px; color: var(--text3); }
.crumb b { color: var(--text); font-weight: 600; }

.hd-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hd-user .btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }

/* ---------- 页面容器 ---------- */
.page { padding: 22px 24px 70px; max-width: 1240px; margin: 0 auto; }

.page-title { font-size: 22px; font-weight: 700; margin: 4px 0 14px; }

.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: 21px; font-weight: 650; margin: 8px 0 4px; }
.page-head .muted { max-width: 860px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text3);
  text-decoration: none;
  font-size: 12.5px;
  transition: color var(--ease);
}
.back-link:hover { color: var(--brand); }

.muted { color: var(--text3); font-size: 13px; margin: 0; }

.hint {
  margin-top: 18px;
  color: var(--text3);
  font-size: 12.5px;
  line-height: 1.7;
}

.section-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text);
}

.warn-text { color: var(--warn); font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn,
.small-btn,
.submit-btn,
.secondary-btn,
.primary,
.link-button,
.btn-approve,
.btn-reject {
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-ctl);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.btn:hover { border-color: #C6D2E4; color: var(--text); background: #FBFCFF; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .36); }
.btn.ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.link-button {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--h-ctl);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.small-btn:hover { border-color: #C6D2E4; color: var(--brand); background: #FBFCFF; }

.danger-btn { color: var(--danger); border-color: #FDA29B; background: var(--danger-bg); }
.danger-btn:hover { background: #FEE4E2; color: var(--danger); }

.btn-approve {
  flex: 1;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #A6F4C5;
  border-radius: var(--r-md);
  height: var(--h-ctl);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reject {
  flex: 1;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #FDA29B;
  border-radius: var(--r-md);
  height: var(--h-ctl);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 93, 255, .18);
  transition: background var(--ease);
}
.submit-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  margin-top: 10px;
  transition: border-color var(--ease), color var(--ease);
}
.secondary-btn:hover { border-color: #BFD3FF; color: var(--brand); }

.primary:not(.btn) {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.primary:not(.btn):hover { background: var(--brand-dark); }

/* ---------- 卡片 ---------- */
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--sh-1);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.card:hover { border-color: #BFD3FF; box-shadow: 0 6px 18px rgba(16, 24, 40, .07); transform: translateY(-1px); }

.card-hd {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.card-hd h2 { font-size: 14.5px; font-weight: 600; margin: 0; }
.card-bd { padding: 16px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel .card-hd { background: #fff; }
.panel .card-bd { padding: 16px; }
.panel .card-bd .muted { margin: -6px 0 12px; }
.panel .card-bd .grid { padding: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid .card {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.grid .card.shortcut-card {
  display: block;
  min-height: 0;
}

.shortcut-card { display: block; }
.shortcut-title { display: block; font-size: 13.5px; font-weight: 600; }
.shortcut-desc { display: block; margin-top: 3px; color: var(--text3); font-size: 12px; line-height: 1.6; font-weight: 400; }

.more-links { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.more-links > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text2);
  user-select: none;
  list-style: none;
}
.more-links > summary::-webkit-details-marker { display: none; }
.more-links > summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform var(--ease); }
.more-links[open] > summary::before { transform: rotate(90deg); }
.more-links > summary:hover { color: var(--brand); }
.more-links .grid { margin-top: 12px; }

/* ---------- 统计卡片 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

/* 六格 KPI（销售看板）：宽屏走两行三列，窄屏沿用上面的两列规则 */
@media (min-width: 1201px) {
  .stats.six { grid-template-columns: repeat(3, 1fr); }
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-1);
}
.stat span {
  display: block;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat label { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text2); }
.stat-warn { border-color: #FDA29B; background: #FFFCFB; }
.stat-warn span { color: var(--danger); }
.stat-warn label { color: #B42318; }

.stat-link { display: block; text-decoration: none; color: var(--text); transition: border-color var(--ease); }
.stat-link:hover { border-color: #BFD3FF; }
.stat-go { display: inline-block; margin-top: 6px; font-size: 12px; font-style: normal; color: var(--brand); }

/* ---------- 工作台今日待办 ---------- */
.todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.todo-card {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.todo-card:hover { border-color: #BFD3FF; box-shadow: var(--sh-2); }
.todo-num {
  display: inline-block;
  min-width: 30px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--brand);
}
.todo-card.zero .todo-num { color: var(--text3); }
.todo-label { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.todo-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text2); }

/* ---------- 工作台头图 ---------- */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 22px 24px;
  margin-bottom: 18px;
  background:
    radial-gradient(600px 220px at 88% -20%, rgba(76, 139, 255, .55), transparent 70%),
    linear-gradient(120deg, #0B1F4B 0%, #123B9E 55%, #165DFF 100%);
  box-shadow: 0 12px 28px rgba(11, 31, 75, .18);
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 62%);
  pointer-events: none;
}
.hero-in { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-l { min-width: 240px; flex: 1; }
.hero h2 { margin: 0 0 6px; font-size: 21px; font-weight: 650; letter-spacing: .2px; }
.hero p { margin: 0; font-size: 12.5px; opacity: .85; line-height: 1.8; }
.hero-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.hero-actions .btn { height: 38px; padding: 0 16px; font-size: 13px; }

/* 旧版大按钮（保留兼容） */
.hero-action {
  display: block;
  background: linear-gradient(120deg, #0B1F4B 0%, #123B9E 55%, #165DFF 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 18px 20px;
  text-decoration: none;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(11, 31, 75, .16);
}
.hero-title { font-size: 18px; font-weight: 650; }
.hero-sub { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.hero-secondary { background: linear-gradient(120deg, #0C1729, #1D3A6E); padding: 14px 20px; }
.hero-secondary .hero-title { font-size: 16px; }
.hero-alert { background: linear-gradient(120deg, #7A2E0E, #B54708); padding: 14px 20px; box-shadow: 0 8px 20px rgba(181, 71, 8, .2); }
.hero-alert .hero-title { font-size: 16px; }

/* ---------- 订单 / 步骤列表 ---------- */
.card-list,
.step-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.order-card,
.step-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  border-top: 1px solid var(--line2);
  transition: background var(--ease);
}
.order-card:first-child,
.step-card:first-child { border-top: 0; }
.order-card:hover,
.step-card:hover { background: #FAFBFF; }

.order-main { flex: 1; min-width: 0; }
.order-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 4px; }
.order-no { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.order-title { font-size: 15.5px; font-weight: 600; }
.order-meta,
.step-meta { font-size: 12.5px; color: var(--text3); margin-top: 3px; }
.step-name { font-size: 15.5px; font-weight: 600; }
.step-arrow { font-size: 22px; color: #B6C6E8; }

/* ---------- 表单 ---------- */
.form-card,
.pay-card,
.approval-card,
.success-card,
.summary-card,
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.form-card {
  padding: 20px;
  margin-bottom: 16px;
}
.worker-page .form-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-row .field-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=tel], input[type=search], select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-height: var(--h-ctl);
  padding: 6px 10px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input::placeholder, textarea::placeholder { color: #B0B9C8; }
input:hover, select:hover, textarea:hover { border-color: #C6D2E4; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, .12);
}
select { cursor: pointer; }

.big-input,
.big-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 16px;
  background: #fff;
}
.form-row textarea { min-height: 76px; resize: vertical; }
.radiolist { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; list-style: none; }
.radiolist li { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.radiolist input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

.line-inputs { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.line-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text2); }

.qty-input {
  width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
}

.reason-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
}

.po-line-editor { border-top: 1px solid var(--line2); padding: 12px 0; }
.po-line-editor:first-of-type { border-top: 0; }

.approve-form { margin-top: 12px; }
.approve-actions { display: flex; gap: 10px; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th {
  background: #F8FAFC;
  color: var(--text2);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line2);
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover td { background: #FAFBFF; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- 标签 / 状态 ---------- */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  background: #F2F4F7;
  color: var(--text2);
  white-space: nowrap;
}
.badge { background: var(--brand-light); color: var(--brand-dark); }
.pill { margin-left: 4px; background: var(--brand-light); color: var(--brand-dark); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- 提示 / 消息 ---------- */
.notice {
  margin: 14px 0;
  padding: 11px 14px;
  background: var(--warn-bg);
  border: 1px solid #FEDF89;
  border-radius: var(--r-md);
  color: #93370D;
  font-size: 13px;
  line-height: 1.65;
}
.notice a { color: var(--brand-dark); }
.notice.ok { background: var(--ok-bg); border-color: #A6F4C5; color: var(--ok); }
.notice.bad { background: var(--danger-bg); border-color: #FDA29B; color: #B42318; }

.messages { margin-bottom: 14px; }
.message {
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}
.message.error { background: var(--danger-bg); color: var(--danger); border-color: #FDA29B; }
.message.success { background: var(--ok-bg); color: var(--ok); border-color: #A6F4C5; }
.message.info { background: var(--brand-light); color: var(--brand-dark); border-color: #D1E0FF; }

.empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--text2);
}
.empty-state p { margin: 6px 0; font-size: 13.5px; }

/* ---------- 报工结果 ---------- */
.success-card {
  padding: 26px 20px;
  text-align: center;
  margin: 0 auto 14px;
  max-width: 760px;
}
.success-icon {
  width: 54px;
  height: 54px;
  line-height: 54px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 10px;
}
.success-card h1 { font-size: 20px; margin: 0 0 8px; }
.success-amount { font-size: 38px; font-weight: 700; color: var(--brand); margin: 10px 0; font-variant-numeric: tabular-nums; }

.summary-card { padding: 8px 18px; margin: 0 auto 14px; max-width: 760px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: 0; }

.actions { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }

.pay-card,
.approval-card { padding: 16px; margin-bottom: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-row form { margin: 0; }

.hours-preview { font-size: 15px; font-weight: 600; color: var(--ok); min-height: 22px; margin: -4px 0 12px; }

.block-btn { display: block; text-align: center; text-decoration: none; margin-bottom: 14px; }

/* ---------- 异常卡片 ---------- */
.exc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.exc-thumb { display: block; width: 100%; max-height: 280px; object-fit: cover; background: #E5E7EB; }
.exc-body { padding: 12px 16px 16px; }
.exc-desc { font-size: 14px; line-height: 1.6; margin: 8px 0 6px; word-break: break-word; }

/* ---------- 登录 ---------- */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% 0%, #E8F0FF 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 100%, #EAEFFA 0%, transparent 55%),
    #F4F7FC;
}
.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 9vh 18px 40px;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand b { display: block; font-size: 17px; color: var(--text); }
.auth-brand span { display: block; font-size: 11px; letter-spacing: 1.2px; color: var(--text3); }
.login-card {
  padding: 24px;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
}
.login-card h1 { font-size: 18px; margin: 0 0 18px; }
.login-card label { display: block; margin-bottom: 14px; font-size: 12.5px; color: var(--text2); }
.login-card input {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 93, 255, .12); }
.error { color: var(--danger); font-size: 13px; }

/* ---------- 其他 ---------- */
.pager { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text2);
  font-size: 12.5px;
  text-decoration: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  body.has-appnav { padding-left: 0; }
  .appnav {
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--sh-3);
  }
  body.nav-open .appnav { transform: none; }
  body.nav-open .an-mask { display: block; }
  .an-toggle { display: flex; }
  body.nav-open .an-toggle { display: none; }
  .page { padding: 16px 14px 96px; }
  .apptop { padding: 0 14px; height: 56px; }
}

@media (max-width: 700px) {
  .page-head h1 { font-size: 19px; }
  .stats { gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat span { font-size: 21px; }
  .grid { gap: 10px; }
  .grid .card { padding: 12px 13px; font-size: 13.5px; }
  .hero { padding: 18px 16px; }
  .hero h2 { font-size: 18px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .form-card { padding: 16px; }
  .summary-row { font-size: 13px; }
  .hd-user .btn.sm { display: none; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .appnav, .an-toggle, .an-mask, .apptop, .noprint { display: none !important; }
  body.has-appnav { padding-left: 0 !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card, .table-wrap, .form-card { box-shadow: none; border: 1px solid #ddd; }
  .data-table th { position: static; }
}

/* ---------- 智能表格样式（钉钉表格风格） ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.tag-in   { background: #E8F1FF; color: #1552F0; }
.tag-out  { background: #FFF4E5; color: #B25E09; }
.tag-corp { background: #EEF1F6; color: #3E4C66; }
.tag-priv { background: #FFF7DB; color: #8A6A00; }
.tag-ent  { background: #E8F1FF; color: #1552F0; }
.tag-cur  { background: #FDEBEF; color: #C4356B; }
.tag-ok   { background: #fff; color: #1552F0; border: 1px solid #B9D0FF; }
.tag-stop { background: #fff; color: #B25E09; border: 1px solid #F0C686; }

.money-in  { color: #1552F0; font-weight: 600; }
.money-out { color: #B25E09; font-weight: 600; }

.att-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--text2);
  background: #F4F6FA;
  text-decoration: none;
  font-size: 14px;
  margin-right: 4px;
}
.att-link:hover { background: #E8F1FF; color: #1552F0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  margin-bottom: 14px;
}
.filter-bar .f-row { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .f-row > span { font-size: 12px; color: var(--text2); }
.filter-bar select, .filter-bar input {
  min-height: 34px;
  min-width: 130px;
  font-size: 13px;
  padding: 4px 8px;
}
.filter-bar input[type=text] { min-width: 200px; }
.filter-bar .submit-btn,
.filter-bar .secondary-btn,
.filter-bar .small-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  margin-top: 0;
  padding: 0 14px;
  font-size: 13px;
}

.totals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 11px 16px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.totals-bar .t-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text2);
}
.totals-bar .t-item b { font-size: 16px; font-weight: 700; color: var(--text); }

.clamp {
  max-width: 320px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chart-card { display: flex; flex-direction: column; }
.chart-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 6px 0;
}
.chart-body svg { width: 100%; height: auto; max-width: 560px; }
.chart-legend { margin-top: auto; padding-top: 10px; }
.chart-body svg[viewBox^="0 0 180"] { max-width: 300px; }
.money-in, .money-out { white-space: nowrap; }
.nowrap { white-space: nowrap; }

.table-foot {
  padding: 8px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text3);
  border-top: 1px solid var(--line2);
  background: #F8FAFC;
}

/* 账户分组行 */
.acct-group td {
  background: #F8FAFC;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
}
.acct-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.acct-toggle .arrow { display: inline-block; transition: transform .15s; color: #8CA3C7; }
.acct-group.collapsed .acct-toggle .arrow { transform: rotate(-90deg); }
.acct-group.collapsed ~ tr.acct-child { display: none; }
tr.acct-child > td:first-child { padding-left: 34px; }
.acct-sub { font-size: 12px; color: var(--text3); font-weight: 400; margin-left: 6px; }

/* 动账分析大卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 18px 20px;
}
.stat-card .sc-label { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.stat-card .sc-value { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stat-card .sc-sub { margin-top: 6px; font-size: 12px; color: var(--text3); }
.stat-card .sc-unit { font-size: 14px; font-weight: 500; color: var(--text3); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
}
@media (min-width: 1180px) {
  .chart-grid { grid-template-columns: 1fr 1.4fr 1fr; }
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px 18px;
}
.chart-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--text2); }
.chart-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

.balance-list { font-size: 13px; }
.balance-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.balance-list li:last-child { border-bottom: 0; }
.balance-list .b-name { display: flex; flex-direction: column; gap: 2px; }
.balance-list .b-sub { font-size: 11.5px; color: var(--text3); }

/* ==========================================================================
   网格表组件（照「森茂仓储采购管理系统模板」的表格做法）
   全边框 + 斑马 + 悬停 + 粘性表头 + 双层分组表头 + 计算列底纹 + 合计行
   只新增 .gtable / .gbar / .bar-row 等类，.data-table 等老类不受影响。
   ========================================================================== */

/* 表格外壳：滚动容器 + 最大高度，表头粘在容器顶上 */
.gscroll {
  overflow: auto;
  max-height: 620px;
  background: var(--card);
}
.gscroll::-webkit-scrollbar { width: 9px; height: 9px; }
.gscroll::-webkit-scrollbar-thumb { background: #D3DAE6; border-radius: 6px; }

table.gtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.gtable thead th {
  background: #F8FAFC;
  color: var(--text2);
  font-weight: 600;
  text-align: center;
  padding: 8px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
  border-right: 1px solid var(--line2);
  border-bottom: 1px solid var(--line);
}
/* 双层分组表头：第一行按业务区块合并列，第二行才是字段名 */
.gtable thead tr.grp th {
  top: 0;
  z-index: 5;
  height: 27px;
  padding: 5px 8px;
  font-size: 11px;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-bottom: 1px solid var(--line);
}
.gtable thead tr.col th { top: 27px; z-index: 4; }
.gtable thead tr.col:first-child th { top: 0; }
.gtable tbody td {
  border: 1px solid var(--line2);
  padding: 0 6px;
  height: 34px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.gtable tbody tr:nth-child(even) { background: #FBFCFE; }
.gtable tbody tr:hover { background: var(--brand-light); }
.gtable tbody tr:last-child td { border-bottom: 1px solid var(--line2); }
.gtable td.left,
.gtable th.left { text-align: left; }
.gtable td.name {
  text-align: left;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 计算列（金额、差异、缺口等由别的列算出来的）：浅灰底 + 加粗，一眼看出不是录入值 */
.gtable td.calc {
  background: #F8FAFC;
  color: #344054;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gtable tbody tr:hover td.calc { background: #E7EEFB; }
/* 合计行 */
.gtable tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 650;
  border: 1px solid var(--line);
  padding: 8px;
  font-variant-numeric: tabular-nums;
}
/* 正负与状态着色 */
.num-pos { color: var(--ok); font-weight: 700; }
.num-neg { color: var(--danger); font-weight: 700; }
.gtable tr.row-warn { background: var(--warn-bg); }
.gtable tr.row-bad { background: var(--danger-bg); }
.gtable tr.row-ok { background: var(--ok-bg); }
.gtable tr.row-warn:hover,
.gtable tr.row-bad:hover,
.gtable tr.row-ok:hover { filter: brightness(.985); }
/* 资质临期/过期单元格 */
.gtable td.expired {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}
/* 内联编辑单元格（只在盘点录入这类真要当场改数的页面用） */
.gtable .cell-input {
  width: 100%;
  min-width: 52px;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 4px;
  border-radius: 4px;
  text-align: center;
  outline: none;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.gtable .cell-input:hover { border-color: var(--line); }
.gtable .cell-input:focus {
  border-color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, .12);
}
.gtable .cell-input.left { text-align: left; }
.gtable select.cell-input { cursor: pointer; }
.gtable .cell-input[type="number"] { -moz-appearance: textfield; }
.gtable .cell-input::-webkit-outer-spin-button,
.gtable .cell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 网格上方工具条：左边搜索和筛选，右边按钮 */
.gbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line2);
  background: #fff;
}
.gbar input[type="search"],
.gbar input[type="month"],
.gbar select {
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 0 10px;
  outline: none;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
}
.gbar input[type="search"] { min-width: 220px; }
.gbar input[type="month"] { min-width: 150px; }
.gbar input[type="search"]:focus,
.gbar input[type="month"]:focus,
.gbar select:focus { border-color: var(--brand-dark); }
.gbar .sp { flex: 1; }
.gbar .hint { margin: 0; font-size: 11.5px; }
/* 工具条里的按钮要跟着排一行，不能被 .submit-btn 的整宽块级样式带跑 */
.gbar .btn,
.gbar .small-btn,
.gbar .submit-btn,
.gbar .secondary-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  font-size: 12.5px;
}

/* 卡片正文贴边放表格时用 */
.card-bd.tight { padding: 0; }

/* 纯 CSS 条形图（看板用，不引图表库） */
.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 90px;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
  font-size: 12px;
}
.bar-row:last-child { margin-bottom: 0; }
.bar-name { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; background: #EEF2F8; height: 14px; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand-dark); border-radius: 4px; transition: width .4s var(--ease); }
.bar-fill.neg { background: #F04438; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: #344054; }

/* 单据详情页顶部的字段信息区 */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.mfield label { display: block; font-size: 11px; color: var(--text3); margin-bottom: 5px; }
.mfield .mv { font-size: 13px; font-weight: 600; }
.meta-grid.form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.meta-grid.form-grid .mfield .big-input,
.meta-grid.form-grid .mfield .big-select { width: 100%; }
@media (max-width: 900px) {
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 空态 */
.gempty {
  padding: 36px;
  text-align: center;
  color: var(--text2);
  font-size: 12px;
  background: var(--card);
}
.gempty b { display: block; color: #344054; font-size: 14px; margin-bottom: 6px; }

/* 状态标签的四种语义色（沿用 .badge 的形，只加修饰类） */
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.gray { background: #EEF1F6; color: var(--text2); }
.badge.blue { background: var(--brand-light); color: var(--brand-dark); }

/* KPI 卡的好/坏配色修饰（不改 .stat-card 本体） */
.stat-card.good .sc-value { color: var(--ok); }
.stat-card.warn .sc-value { color: var(--warn); }
.stat-card.bad .sc-value { color: var(--danger); }

/* 两栏 / 三栏看板栅格 */
.cols2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.cols2 > .panel, .cols2 > .chart-card { margin-bottom: 0; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols3 > .panel, .cols3 > .chart-card { margin-bottom: 0; }

/* 多层展开的层级缩进 */
.gtable .tree-indent {
  display: inline-block;
  min-width: 12px;
  color: var(--text3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
}

/* 紧凑指标条（齐套检查一类的页内小 KPI） */
.mini-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mini-kpis .mini {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #FBFCFE;
  padding: 10px 12px;
}
.mini-kpis .mini .ml { font-size: 11.5px; color: var(--text2); }
.mini-kpis .mini .mv {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.mini-kpis .mini .mh { font-size: 11px; color: var(--text3); margin-top: 2px; }
.mini-kpis .mini.good .mv { color: var(--ok); }
.mini-kpis .mini.warn .mv { color: var(--warn); }
.mini-kpis .mini.bad .mv { color: var(--danger); }

@media (max-width: 1100px) {
  .cols2, .cols3 { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 打印：只留表格本体，表头变实线，合计行不再粘底 */
.print-head { display: none; }

@media print {
  .print-head { display: block; text-align: center; margin-bottom: 10px; }
  .print-head h1 { font-size: 17px; margin: 0 0 4px; }
  .print-head .pmeta {
    font-size: 10px;
    color: #333;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .gscroll { overflow: visible; max-height: none; }
  .gtable { font-size: 10px; }
  .gtable thead th {
    position: static;
    background: #EEE !important;
    color: #000 !important;
    border: 1px solid #999 !important;
  }
  .gtable thead tr.grp th { background: #F6F6F6 !important; color: #000 !important; }
  .gtable tbody td { border: 1px solid #BBB !important; height: 26px; padding: 2px 4px; }
  .gtable tbody tr:nth-child(even) { background: #fff; }
  .gtable tbody tr:hover { background: transparent; }
  .gtable td.calc { background: #F7F7F7 !important; }
  .gtable tfoot td { position: static; background: #F2F2F2 !important; color: #000 !important; border: 1px solid #999 !important; }
  .gbar { display: none !important; }
  .panel, .chart-card { border: 0; box-shadow: none; }
}

/* ==========================================================================
   盘点闭环（盘点计划 / 盘点单 / 现场实盘）只新增类，不改老组件
   ========================================================================== */

/* 多选清单：仓库、物料类型这种一屏勾完的选项 */
.pick-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pick-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); }
.pick-item input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 页内提示条：差异要审核、建单后库存又动过这类需要看一眼的提醒 */
.notice-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: var(--warn-bg);
  color: #7A4B00;
  font-size: 12.5px;
}
.notice-band.bad { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.notice-band.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.notice-band b { font-weight: 600; }

/* 表格里直接改数的输入框，比页面表单的 .qty-input 矮一档 */
.gtable td .cell-input { height: 28px; width: 92px; padding: 0 8px; font-size: 12.5px; }
.gtable td .cell-note { height: 28px; width: 100%; padding: 0 8px; font-size: 12px; }
.gtable tr.line-equal { color: var(--text3); }
.gtable tr.line-pending { background: #FFFDF5; }
.btn-row.tight { margin-top: 0; gap: 6px; }

/* 现场实盘页：一台手机一屏两三张卡，戴手套也点得动 */
.count-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 12.5px; color: var(--text2); }
.count-progress .bar-track { flex: 1; max-width: 260px; }
.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}
.count-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 12px 14px;
  box-shadow: var(--sh-1);
}
.count-card.done { border-color: #C7E3D2; background: var(--ok-bg); }
.count-card .cc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.count-card .cc-meta { margin-top: 3px; font-size: 11.5px; color: var(--text3); }
.count-card .cc-lot { margin-top: 6px; font-size: 11.5px; color: var(--text2); }
.count-card form { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.count-card .cp-qty {
  height: 46px;
  width: 128px;
  font-size: 20px;
  font-weight: 600;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 10px;
  background: #fff;
}
.count-card .cp-qty:focus { border-color: var(--brand-dark); outline: none; }
.count-card .cc-nums { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--text3); }
.count-card .cc-diff { font-size: 14px; font-weight: 700; }

/* ==========================================================================
   流程指引（采购 / 生产 / 发货三条主线）只新增类，不改老组件
   ========================================================================== */

.flow-lead { font-size: 13.5px; line-height: 1.8; color: var(--text2); }
.flow-lead b { color: var(--text); }

/* 四条读图规则，先说清楚颜色含义，省得逐页解释 */
.flow-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.flow-rule {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #FBFCFE;
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.6;
}
.flow-rule b { display: block; color: var(--text); margin-bottom: 2px; }

.flow-sec { margin-top: 16px; }
.flow-plain { font-size: 12.5px; color: var(--text3); }
.flow-goal { margin-top: 6px; font-size: 13px; color: var(--text2); }
.flow-before {
  margin-top: 4px;
  padding: 8px 11px;
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12.5px;
  color: var(--brand-ink);
  line-height: 1.7;
}

.flow-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 2px;
  border-top: 1px solid var(--line2);
}
.flow-step:first-child { border-top: 0; }
.flow-no {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.flow-main { flex: 1; min-width: 0; }
.flow-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow-name { font-size: 15px; font-weight: 600; color: var(--text); }
.flow-who {
  padding: 1px 8px;
  border-radius: 999px;
  background: #EEF1F6;
  color: var(--text2);
  font-size: 11.5px;
}
.flow-what { margin-top: 5px; font-size: 13px; line-height: 1.75; color: var(--text2); }
.flow-line { margin-top: 3px; font-size: 12.5px; line-height: 1.7; color: var(--text3); }
.flow-line b {
  display: inline-block;
  min-width: 30px;
  margin-right: 6px;
  color: var(--text2);
  font-weight: 600;
}
/* 卡住时的第一落点，用告警色但不做到 .notice 那么重 */
.flow-stuck {
  margin-top: 7px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  color: #7A4B00;
  font-size: 12.5px;
  line-height: 1.7;
}
.flow-act { flex: 0 0 auto; padding-top: 2px; }
.flow-offtag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #F2F4F7;
  color: var(--text3);
  font-size: 11.5px;
  white-space: nowrap;
}
/* 别人负责的步骤：留字、去色，能看清顺序但不会想点 */
.flow-step.off .flow-no { background: #CDD5E0; }
.flow-step.off .flow-name,
.flow-step.off .flow-what { color: var(--text3); }

@media (max-width: 720px) {
  .flow-step { flex-wrap: wrap; }
  .flow-act { width: 100%; padding-left: 38px; }
}

@media print {
  .flow-sec { page-break-inside: auto; }
  .flow-step { page-break-inside: avoid; border-top-color: #BBB; }
  .flow-act, .flow-rules { display: none; }
  .flow-no { background: #EEE !important; color: #000 !important; }
  .flow-stuck { background: #F5F5F5 !important; color: #000 !important; border-left-color: #666; }
  .flow-before { background: #F5F5F5 !important; color: #000 !important; border-left-color: #666; }
}

/* 三条链跳转：先看到哪条链归自己 */
.flow-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #FBFCFE;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--ease), background var(--ease);
}
.flow-chip:hover { border-color: var(--brand); background: var(--brand-light); }
.flow-chip span { font-weight: 400; color: var(--text3); font-size: 11.5px; }

/* 一步都不归你的链默认收起，页面先给到自己那格 */
details.flow-sec > summary { cursor: pointer; list-style: none; }
details.flow-sec > summary::-webkit-details-marker { display: none; }
details.flow-sec > summary:hover { background: #FAFBFF; }

@media print {
  details.flow-sec > summary { cursor: auto; }
  .flow-chips { display: none; }
}

/* 工单详情页的「下一步」：把领料 / 补 BOM 摆在按钮位，别让人自己找 */
.wo-next {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  background: #FBFCFE;
  overflow: hidden;
}
.wo-next-hd {
  padding: 9px 14px;
  background: #F4F7FC;
  border-bottom: 1px solid var(--line2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .5px;
}
.wo-next-bd { padding: 12px 14px; display: grid; gap: 10px; }
.wo-next-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wo-next-tip { font-size: 12.5px; color: var(--text2); line-height: 1.6; }
.wo-next-tip b { color: var(--brand-dark); }
.wo-next .btn-approve { flex: 0 0 auto; min-width: 172px; }

/* 领料页：仓库选择压成一行，给下面三十几行用料腾地方 */
.issue-wh {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}
.issue-wh label { flex: 0 0 auto; font-size: 13px; color: var(--text2); }
.issue-wh select { flex: 1; width: auto; }

/* 领料页：核对区 */
.issue-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.po-line-editor.line-done { opacity: .62; }
.po-line-editor + .submit-btn { margin-top: 16px; }
/* 一张 BOM 常有三十几行，把数量输入框挪到右边，一屏能多看几行 */
.issue-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
}
.issue-line-main { flex: 1; min-width: 0; }
.issue-line-qty {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  justify-items: start;
  font-size: 12px;
  color: var(--text2);
}
/* 异常信息挪到「本次领料」右侧：一行一句短标签，长说明放悬浮提示，别把整行撑高 */
.issue-line-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: 220px;
}
.issue-line-warn {
  font-size: 11.5px;
  line-height: 1.35;
  text-align: right;
  color: var(--danger);
  cursor: help;
}
.issue-line.line-short .qty-input { border-color: #FDA29B; background: #FFFCFB; }
.issue-hd-t { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.issue-hd-warn {
  padding: 2px 10px;
  border: 1px solid #FDA29B;
  border-radius: 999px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
@media (max-width: 720px) {
  .issue-line { align-items: stretch; flex-direction: column; gap: 8px; }
  .issue-line-side { align-items: flex-start; max-width: none; }
  .issue-line-warn { text-align: left; }
}

@media print {
  .wo-next { border-color: #BBB; border-left-color: #666; background: #fff; }
  .wo-next-hd { background: #F1F1F1; border-bottom-color: #BBB; }
  .issue-hd .small-btn { display: none; }
}
