/* ============ 必火人事 品牌主色：青绿（覆盖 Element Plus 主色全梯度，与财务铜橙区分）============ */
:root {
  --el-color-primary: #2F8F5B;
  --el-color-primary-light-3: #66B088;
  --el-color-primary-light-5: #97C9AC;
  --el-color-primary-light-7: #C7E2D3;
  --el-color-primary-light-8: #DDEDE3;
  --el-color-primary-light-9: #EEF6F1;
  --el-color-primary-dark-2: #26724A;
  --bihuo-ink: #23272E;   /* 深岩灰：品牌深色（顶栏/品牌区） */
  --bihuo-ember: #2FA56B; /* 高光青绿 */

  /* ── 设计 token：间距 / 圆角 / 大号数字。复用型组件类(metric-card/m-card/ovw-stat 等)统一引用，
     以后调全局卡片间距/圆角改这里一处即可（取值=现状，引入不改观感）。注：散落在各页 inline style
     里的间距/圆角暂未 token 化（量大、改动风险高），后续再逐步收敛。 ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --radius-md: 8px;   /* 卡片标准圆角 */
  --radius-lg: 12px;
  --fz-metric: 24px;  /* 看板大号金额数字 */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--el-text-color-primary);
}

#app {
  height: 100%;
}

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--el-bg-color-page);
}

.login-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: var(--el-text-color-secondary);
}
.login-foot a {
  color: var(--el-text-color-secondary);
  text-decoration: none;
}
.login-foot a:hover {
  color: var(--el-color-primary);
}

.login-card {
  width: 360px;
}

.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--el-text-color-secondary);
  font-size: 13px;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--el-border-color);
}

.login-logo {
  display: block;
  width: 66px;
  height: 66px;
  border-radius: 15px;
  object-fit: cover;
  margin: 6px auto 12px;
}
.login-title {
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 2px;
}
.login-sub {
  text-align: center;
  font-size: 12px;
  color: var(--el-text-color-secondary);
  letter-spacing: 2px;
  margin: 0 0 22px;
}

/* ---------- 整体布局 ---------- */
.layout {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 200px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--el-border-color-light);
}

.brand {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--bihuo-ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #F2EBE2;
}
.brand .brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
}
.brand .em {
  color: var(--bihuo-ember);
}

.sidebar .el-menu {
  flex: 1;
  border-right: none;
}

/* 导航角标：行内小红数字（待办/待审批计数）。取代 el-badge——
   el-badge 的 <sup> vertical-align:bottom 会贴到 56px 行底、看着「斜下方」；
   行内 inline-flex 居中才正好待在文字正后方。桌面侧栏与手机抽屉共用。 */
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 8px;
  border-radius: 9px;
  background: var(--el-color-danger);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  flex: none;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--el-border-color-light);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--el-text-color-regular);
}

.content {
  flex: 1;
  overflow: auto;
  padding: 24px;
  background: #fff;
}

/* ---------- 看板指标卡 ---------- */
.cards-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* 驾驶舱分组小标题（综合 / 工资 / 报销） */
.ovw-group-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--el-text-color-secondary);
  margin: 2px 0 8px;
  border-left: 3px solid var(--el-color-primary);
  padding-left: 8px;
}

.metric-card {
  background: var(--el-fill-color-light);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.metric-card .label {
  font-size: 13px;
  color: var(--el-text-color-secondary);
  margin-bottom: 8px;
}

.metric-card .value {
  font-size: var(--fz-metric);
  font-weight: 500;
  color: var(--el-text-color-primary);
}

.metric-card .value.danger { color: var(--el-color-danger); }
/* 语义色数字卡（财务总览/业务收入用：收入绿、支出橙、增值税灰、正数蓝、负数走 .danger）。
   收口原先散在各页 inline 的 #67c23a/#e6a23c/#909399/#409eff，统一到这里，口径一处可改。 */
.metric-card .value.c-income  { color: var(--el-color-success); }
.metric-card .value.c-expense { color: var(--el-color-warning); }
.metric-card .value.c-vat     { color: var(--el-color-info); }
.metric-card .value.c-pos     { color: #409eff; }   /* 正数(利润/现金为正)蓝，非主题色、刻意 */

.metric-card .unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--el-text-color-secondary);
}

/* ---------- 通用 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar .spacer {
  flex: 1;
}

.mt16 {
  margin-top: 16px;
}

.mb16 {
  margin-bottom: 16px;
}

.pager {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.money {
  font-variant-numeric: tabular-nums;
}

.danger-text {
  color: var(--el-color-danger);
}

.muted {
  color: var(--el-text-color-secondary);
}

.submit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-left .topbar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger {
  padding: 4px;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  color: var(--el-text-color-regular);
}

/* ---------- 手机卡片列表（表格在窄屏的替代渲染） ---------- */
.m-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-card {
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  background: #fff;
}

.m-card .m-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m-card .m-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 14px;
}

.m-card .m-k {
  color: var(--el-text-color-secondary);
  flex: none;
}

.m-card .m-v {
  text-align: right;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

/* 卡片内的表单控件铺满值区域（避免固定宽度 select/input 溢出/被裁切） */
.m-card .m-v .el-select,
.m-card .m-v .el-input,
.m-card .m-v .el-date-editor.el-input,
.m-card .m-v .el-date-editor,
.m-card .m-v .el-input-number {
  width: 100% !important;
}

.m-card .m-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-empty {
  text-align: center;
  color: var(--el-text-color-secondary);
  padding: 24px 0;
}

/* ---------- 手机端响应式（≤768px） ---------- */
@media (max-width: 768px) {
  .content {
    padding: var(--sp-3);
  }

  .topbar {
    padding: 0 12px;
  }

  .cards-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .metric-card {
    padding: var(--sp-3);
  }

  .metric-card .value {
    font-size: 20px;
  }

  .login-card {
    width: 92vw;
    max-width: 360px;
  }

  /* 弹窗/确认框近全屏，避免比屏还宽 */
  .el-dialog {
    width: 92vw !important;
    max-width: 92vw;
  }

  .el-message-box {
    width: 90vw !important;
    max-width: 90vw;
  }

  /* 工具栏按钮在窄屏更易点 */
  .toolbar .el-button {
    margin-left: 0 !important;
  }

  /* 抽屉内菜单铺满 */
  .el-drawer__body {
    padding: 0;
  }
}

/* 手机：表单堆叠 + 控件铺满（提交录入等用 .m-form 标记） */
.m-form .el-form-item {
  display: block;
  margin-right: 0;
  margin-bottom: 12px;
}

.m-form .el-form-item__content {
  display: block;
}

.m-form .el-select,
.m-form .el-input,
.m-form .el-date-editor.el-input,
.m-form .el-date-editor,
.m-form .el-input-number {
  width: 100% !important;
}

/* ---------- 审批流程图（审批面板 §30） ---------- */
.flow {
  position: relative;
  display: flex;
}

.flow-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.flow-track,
.flow-track-done {
  position: absolute;
  top: 13px;
  height: 2px;
  z-index: 0;
}

.flow-track {
  left: 12.5%;
  right: 12.5%;
  background: var(--el-border-color-lighter);
}

.flow-track-done {
  left: 12.5%;
  background: var(--el-color-success);
}

.flow-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.flow-dot.done {
  background: var(--el-color-success-light-9);
  color: var(--el-color-success);
}

.flow-dot.current {
  background: var(--el-color-primary-light-9);
  color: var(--el-color-primary);
  box-shadow: 0 0 0 3px var(--el-color-primary-light-9);
}

.flow-dot.pending,
.flow-dot.not_reached {
  background: var(--el-fill-color);
  color: var(--el-text-color-secondary);
}

.flow-dot.skipped {
  background: transparent;
  border: 1px dashed var(--el-border-color);
  color: var(--el-text-color-secondary);
}

.flow-dot.rejected {
  background: var(--el-color-danger-light-9);
  color: var(--el-color-danger);
}

.flow-role {
  font-size: 12px;
  color: var(--el-text-color-secondary);
  margin-top: 8px;
}

.flow-name {
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.flow-name.cur {
  color: var(--el-color-primary);
}

.flow-name.rej {
  color: var(--el-color-danger);
}

.flow-time {
  font-size: 11px;
  color: var(--el-text-color-secondary);
}

/* 手机端：流程竖排 */
.flow.vertical {
  flex-direction: column;
  border-left: 2px solid var(--el-border-color-lighter);
  margin-left: 14px;
  padding-left: 4px;
}

.flow.vertical .flow-track,
.flow.vertical .flow-track-done {
  display: none;
}

.flow.vertical .flow-step {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  padding: 5px 0;
}

.flow.vertical .flow-dot {
  margin: 0 0 0 -15px;
  flex: none;
  background-clip: padding-box;
}

.flow.vertical .flow-role {
  margin-top: 0;
}

.flow.vertical .flow-meta {
  display: flex;
  flex-direction: column;
}

/* ---------- 审批面板（§30） ---------- */
.ovw-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ovw-stat {
  background: var(--el-fill-color-light);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  cursor: pointer;
}

.ovw-stat:hover {
  background: var(--el-fill-color);
}

.ovw-stat.ovw-hot {
  background: var(--el-color-primary-light-9);
}

.ovw-label {
  font-size: 13px;
  color: var(--el-text-color-secondary);
}

.ovw-stat.ovw-hot .ovw-label {
  color: var(--el-color-primary);
}

.ovw-val {
  font-size: var(--fz-metric);
  font-weight: 500;
  margin-top: 4px;
}

.ovw-stat.ovw-hot .ovw-val {
  color: var(--el-color-primary);
}

.ovw-card {
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.ovw-card:hover {
  border-color: var(--el-color-primary-light-5);
}

.ovw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ovw-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ovw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--el-color-primary-light-9);
  color: var(--el-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  flex: none;
}

/* ---------- 我的待办（§52 员工手机端首屏，暖调亲和） ---------- */
.todo-page { max-width: 680px; margin: 0 auto; padding: 4px 0 24px; }
.todo-hero {
  background: var(--el-color-primary-light-9);
  border-radius: 16px; padding: 18px 18px 16px; margin-bottom: 16px;
}
.todo-hero .greet { font-size: 20px; font-weight: 600; color: var(--bihuo-ink); }
.todo-hero .sub { font-size: 13px; color: var(--el-text-color-secondary); margin-top: 4px; }
.todo-group { margin-bottom: 18px; }
.todo-gh {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; margin: 2px 2px 9px;
}
.todo-gh .dot { width: 8px; height: 8px; border-radius: 50%; }
.todo-gh .n {
  margin-left: 6px; font-size: 12px; font-weight: 500;
  background: var(--el-fill-color); color: var(--el-text-color-secondary);
  border-radius: 9px; padding: 0 7px; min-width: 18px; text-align: center;
}
.todo-gh.t-must { color: var(--el-color-danger); }
.todo-gh.t-must .dot { background: var(--el-color-danger); }
.todo-gh.t-follow { color: var(--el-color-warning); }
.todo-gh.t-follow .dot { background: var(--el-color-warning); }
.todo-gh.t-info { color: var(--el-text-color-secondary); }
.todo-gh.t-info .dot { background: var(--el-text-color-secondary); }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 0.5px solid var(--el-border-color-light);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 9px;
  cursor: pointer; transition: background .15s, transform .05s;
}
.todo-item:active { transform: scale(0.99); background: var(--el-fill-color-light); }
.todo-ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.todo-ic.ic-must { background: var(--el-color-danger-light-9); color: var(--el-color-danger); }
.todo-ic.ic-follow { background: var(--el-color-warning-light-9); color: var(--el-color-warning); }
.todo-ic.ic-info { background: var(--el-fill-color); color: var(--el-text-color-secondary); }
.todo-m { flex: 1; min-width: 0; }
.todo-m .todo-t { font-size: 15px; font-weight: 500; color: var(--el-text-color-primary); }
.todo-m .todo-s { font-size: 12.5px; color: var(--el-text-color-secondary); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-item .todo-go { color: var(--el-text-color-placeholder); font-size: 15px; flex: none; }
.todo-empty { text-align: center; padding: 56px 16px; color: var(--el-text-color-secondary); }
.todo-empty .ok { font-size: 56px; color: var(--el-color-success); }
.todo-empty .t { font-size: 17px; font-weight: 500; color: var(--el-text-color-primary); margin: 12px 0 4px; }
.todo-foot { text-align: center; margin-top: 6px; }

/* ---------- 手机抽屉：用户身份头 + 底部操作（§52） ---------- */
.drawer-user {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px; border-bottom: 1px solid var(--el-border-color-lighter);
}
.drawer-user .du-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--el-color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.drawer-user .du-info { min-width: 0; }
.drawer-user .du-name { font-size: 15px; font-weight: 500; color: var(--el-text-color-primary); }
.drawer-user .du-dept { font-size: 12px; color: var(--el-text-color-secondary); }
.drawer-foot {
  display: flex; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--el-border-color-lighter); margin-top: 6px;
}

/* ---------- 驾驶舱 待拍板卡 + 月结收口（§52 P3） ---------- */
.pending-card {
  background: #fff; border: 0.5px solid var(--el-border-color-light);
  border-left: 3px solid var(--el-color-primary); border-radius: var(--el-border-radius-base);
  padding: 12px 14px; margin-bottom: 14px;
}
.pending-card.sc-bad { border-left-color: var(--el-color-danger); background: var(--el-color-danger-light-9); }
.pending-card .sc-prob { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--el-color-danger);
  padding: 3px 2px; line-height: 1.5; }
.pending-card .sc-prob .el-icon { margin-top: 2px; flex-shrink: 0; }
.pending-card .pc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pending-card .pc-title { font-size: 15px; font-weight: 600; color: var(--bihuo-ink); display: flex; align-items: center; gap: 6px; }
.pending-card .pc-title .el-icon { color: var(--el-color-primary); }
.pc-items { display: flex; flex-direction: column; gap: 6px; }
.pc-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.pc-item:hover { background: var(--el-fill-color-light); }
.pc-item .pc-sub { flex: 1; min-width: 0; font-size: 13px; color: var(--el-text-color-regular); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-item .pc-go { color: var(--el-text-color-placeholder); font-size: 13px; }
.pc-closeout { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--el-border-color-light); }
.pc-co-label { font-size: 12px; color: var(--el-text-color-secondary); margin-bottom: 7px; }
.pc-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 9px; border-radius: 13px; }
.pc-chk .el-icon { font-size: 14px; }
.pc-chk.st-done { background: var(--el-color-success-light-9); color: var(--el-color-success); }
.pc-chk.st-todo { background: var(--el-color-warning-light-9); color: var(--el-color-warning); }
.pc-chk.st-none { background: var(--el-fill-color); color: var(--el-text-color-secondary); }
.pc-co-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.pc-co-foot .ok-text { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--el-color-success); }
