/* 轻费控 · 移动优先 / 企微 PC 内嵌适配 */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #0f1b2d;
  --ink-2: #37485c;
  --muted: #7c8a9a;
  --line: #e8ecf1;
  --line-strong: #dbe2ea;
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --primary-soft: #e8f4f2;
  --primary-line: #c6e5e0;
  --gold: #a8721c;
  --danger: #bf3b34;
  --danger-soft: #fcefee;
  --warn: #b06a12;
  --warn-soft: #fdf3e5;
  --info: #1d4ed8;
  --info-soft: #eaf0ff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-btn: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 10px 30px rgba(15, 27, 45, .05);
  --shadow-btn: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .03);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible { outline: 2px solid rgba(15, 118, 110, .45); outline-offset: 2px; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.ic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ------------------------------------------------------------ 布局：外壳固定视口，内容区内部滚动 */
html, body { height: 100%; }

.app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app.login-mode {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
.app.login-mode .sidebar,
.app.login-mode .tabbar { display: none; }
.app.login-mode .main { height: auto; min-height: 100vh; padding-bottom: 0; }

.sidebar { display: none; }

.main {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.topbar {
  flex: none;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  background: rgba(244, 246, 248, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

.back-btn { display: none; }
.back-btn.visible { display: inline-flex; }

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px 24px;
  animation: fade .22s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 27, 45, .16) transparent;
}
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: rgba(15, 27, 45, .16); border-radius: 3px; }
.view::-webkit-scrollbar-thumb:hover { background: rgba(15, 27, 45, .26); }
.view::-webkit-scrollbar-track { background: transparent; }
@keyframes fade {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  transition: color .18s ease, background .18s ease;
}
.tab-item:hover { color: var(--ink-2); }
.tab-item .ic { width: 22px; height: 22px; }
.tab-item.active { color: var(--primary); }
.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.tab-badge {
  position: absolute;
  top: 0;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 17px;
  text-align: center;
  font-weight: 600;
}

/* ------------------------------------------------------------ 通用组件 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card + .card, .section + .section { margin-top: 14px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.2px;
}
.section-desc { font-size: 12px; color: var(--muted); }
.section-link {
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff 0%, #f9fbfc 100%);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: var(--shadow-btn);
  transition: transform .15s var(--ease), background .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.btn:hover {
  border-color: #cfd8e3;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 4px rgba(15, 27, 45, .07), 0 8px 18px -10px rgba(15, 27, 45, .3);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(15, 27, 45, .08); }
.btn:disabled,
.btn:disabled:hover {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn .ic { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(180deg, #128a7f 0%, #0d6e66 100%);
  border-color: #0d6e66;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16),
              0 1px 2px rgba(13, 110, 102, .25), 0 8px 20px -10px rgba(13, 110, 102, .7);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #159489 0%, #0f7a70 100%);
  border-color: #0f7a70;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18),
              0 2px 4px rgba(13, 110, 102, .25), 0 12px 24px -10px rgba(13, 110, 102, .7);
}
.btn-primary:active { transform: translateY(1px); }
.btn-soft {
  background: var(--primary-soft);
  border-color: var(--primary-line);
  color: var(--primary-dark);
  box-shadow: none;
}
.btn-soft:hover { background: #dff0ed; border-color: #b4dad4; color: var(--primary-dark); }
.btn-danger {
  background: linear-gradient(180deg, #c8483f 0%, #b3362f 100%);
  border-color: #b3362f;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14),
              0 8px 20px -12px rgba(179, 54, 47, .8);
}
.btn-danger:hover { background: linear-gradient(180deg, #d45349 0%, #bd3b33 100%); border-color: #bd3b33; color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: #edd2cf; background: #fff; box-shadow: none; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #e3bbb7; color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(15, 27, 45, .04); border-color: transparent; color: var(--ink-2); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 30px; padding: 0 14px; font-size: 12.5px; border-radius: 8px; letter-spacing: .2px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.icon-btn:hover { background: #fff; border-color: var(--line); box-shadow: var(--shadow-btn); }
.icon-btn:active { transform: scale(.95); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.chip-draft { background: #f1f4f7; color: #6b7a8a; }
.chip-pending { background: var(--warn-soft); color: var(--warn); }
.chip-approved { background: var(--primary-soft); color: var(--primary); }
.chip-paid { background: var(--info-soft); color: var(--info); }
.chip-rejected { background: var(--danger-soft); color: var(--danger); }
.chip-withdrawn { background: #f1f4f7; color: #8a95a3; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef3f6;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

.segmented {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease), box-shadow .16s var(--ease);
}
.segmented button:hover { border-color: var(--line-strong); color: var(--ink-2); }
.segmented button.active {
  background: var(--primary-soft);
  border-color: var(--primary-line);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.searchbox {
  position: relative;
  margin-top: 10px;
}
.searchbox .ic {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.searchbox input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}
.searchbox input:focus { border-color: var(--primary-line); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 台账工具栏：搜索 + 状态/范围下拉 */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.list-toolbar .searchbox { flex: 1; min-width: 0; margin-top: 0; }
select.input.filter-select {
  width: auto;
  flex: none;
  height: 40px;
  padding: 0 30px 0 12px;
  border-radius: 10px;
  border-color: var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8a9a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}
@media (max-width: 560px) {
  .list-toolbar { flex-wrap: wrap; }
  .list-toolbar .searchbox { flex-basis: 100%; }
  select.input.filter-select { flex: 1; }
}
.export-btn { flex: none; height: 40px; padding: 0 12px; }
.export-btn .ic { width: 15px; height: 15px; margin-right: 4px; }

/* ------------------------------------------------------------ 看板 */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi-value {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi-value.small-value { font-size: 18px; }
.kpi-foot { font-size: 11px; color: var(--muted); }
.kpi-click { cursor: pointer; }
.kpi-click:active { transform: scale(.99); }

.progress {
  height: 6px;
  border-radius: 4px;
  background: #edf1f4;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.progress.warn > i { background: #d18b21; }
.progress.danger > i { background: var(--danger); }

.dash-banner {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: linear-gradient(110deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 10px 26px rgba(15, 118, 110, .2);
}
.dash-banner .ic { width: 20px; height: 20px; }
.dash-banner-text { flex: 1; font-size: 13px; }
.dash-banner-text b { font-weight: 650; }
.dash-banner button {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  height: 30px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.dash-banner button:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .4); }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-btn);
  transition: border-color .18s var(--ease), color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
}
.quick-action .ic { width: 19px; height: 19px; color: var(--primary); }
.quick-action:hover {
  border-color: var(--primary-line);
  color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -6px rgba(15, 27, 45, .3);
}
.quick-action:active { transform: scale(.97); border-color: var(--primary); color: var(--primary-dark); }

.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font); }
.chart-empty {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: #fafbfc;
  border-radius: 10px;
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 14px;
}
.donut-wrap { width: 148px; flex: none; }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-name {
  flex: 1;
  color: var(--ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.legend-value { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 550; }
.legend-ratio { width: 38px; text-align: right; color: var(--muted); font-size: 11px; }

.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-index {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  background: #f1f5f8;
  color: var(--muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rank-index.top { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.rank-name b { font-weight: 550; }
.rank-bar { margin-top: 5px; height: 4px; border-radius: 3px; background: #f1f4f6; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--primary-line); border-radius: 3px; }

.budget-list { display: flex; flex-direction: column; gap: 13px; }
.budget-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.budget-item-top .num { color: var(--ink-2); }

/* ------------------------------------------------------------ 单据台账 */
.report-list { display: flex; flex-direction: column; gap: 10px; }

.ledger {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ledger-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row:hover { background: #f6faf9; }
.ledger-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}
.ledger-icon .ic { width: 18px; height: 18px; }
.ledger-icon.kind-expense { background: #e8f4f1; color: #0f766e; }
.ledger-icon.kind-loan { background: #fbf1e0; color: #a9741a; }
.ledger-icon.kind-payroll { background: #eaf0fb; color: #2f5fc4; }
.ledger-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ledger-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ledger-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ledger-type {
  flex: none;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  line-height: 1.5;
}
.ledger-meta {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ledger-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.ledger-amount {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

.load-more { margin-top: 12px; }

/* 审批台待办卡片 */
.todo-card {
  padding: 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.todo-card:hover { border-color: var(--line-strong); box-shadow: 0 10px 26px -18px rgba(15, 27, 45, .35); }
.todo-card .ledger-row { padding: 0; border: 0; background: none; }
.todo-card .ledger-row:hover { background: none; }
.report-list.todo-list { display: flex; flex-direction: column; }
.todo-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.todo-reject {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.todo-reject:hover { color: var(--danger); background: var(--danger-soft); }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty .empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: #eff3f6;
  color: #97a5b4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty .empty-icon .ic { width: 26px; height: 26px; }
.empty h3 { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.empty p { margin-top: 4px; font-size: 12px; }
.empty .btn { margin-top: 16px; }

/* ------------------------------------------------------------ 详情 */
.detail-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
}
.detail-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: .55;
}
.detail-amount {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.detail-sub { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.meta-item span { display: block; font-size: 11px; color: var(--muted); }
.meta-item b { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 550; word-break: break-all; }

.item-list { display: flex; flex-direction: column; }
.item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.item-row:last-child { border-bottom: 0; }
.item-date { width: 62px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.item-body { flex: 1; min-width: 0; }
.item-cat { font-weight: 550; color: var(--ink); }
.item-desc { color: var(--muted); margin-top: 2px; word-break: break-word; }
.item-amount { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.item-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  font-size: 13px;
  font-weight: 600;
}
.item-total .num { font-size: 15px; }

.file-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.file-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #f5f8fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ic { width: 22px; height: 22px; color: var(--ink-2); }
.file-thumb .file-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 27, 45, .72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.file-thumb .file-del .ic { width: 12px; height: 12px; color: #fff; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfd8e1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.tl-item.done .tl-dot { background: var(--primary); }
.tl-item.reject .tl-dot { background: var(--danger); }
.tl-item.current .tl-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tl-title { font-size: 13px; font-weight: 550; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-desc { margin-top: 3px; font-size: 11.5px; color: var(--muted); word-break: break-word; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); }
.log-time { width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.log-text { flex: 1; color: var(--ink-2); word-break: break-word; }

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(244, 246, 248, .95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.action-bar .btn { flex: 1; }
.has-actionbar { padding-bottom: 104px; }

/* 审批 / 单据操作浮层：玻璃拟态底部操作坞 */
.action-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 26;
  width: calc(100% - 24px);
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 16px;
  border-radius: 16px;
  border: 1px solid rgba(226, 233, 240, .95);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 18px 40px -18px rgba(15, 27, 45, .35), 0 1px 2px rgba(15, 27, 45, .06);
  animation: dock-in .28s var(--ease);
}
@keyframes dock-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.dock-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dock-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.dock-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dock-no { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .2px; }
.dock-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dock-link {
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.dock-link:hover { background: rgba(15, 27, 45, .05); color: var(--ink-2); }
.dock-link.danger { color: var(--danger); }
.dock-link.danger:hover { background: var(--danger-soft); color: var(--danger); }
.action-dock .btn { height: 38px; padding: 0 18px; border-radius: 9px; font-size: 13.5px; }
@media (max-width: 430px) {
  .action-dock { padding: 8px; gap: 8px; }
  .dock-info { display: none; }
  .dock-actions { width: 100%; gap: 4px; }
  .dock-link { padding: 0 8px; }
  .action-dock .btn { flex: 1; padding: 0 12px; }
}

/* ------------------------------------------------------------ 表单 */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.form-card + .form-card { margin-top: 12px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field .hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

.input, textarea.input, select.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fbfcfd;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 42px;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--primary-line); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: #a8b3bf; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 49%, #93a1b0 50%), linear-gradient(-45deg, transparent 49%, #93a1b0 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.form-row { display: flex; gap: 10px; }
.form-row > .field { flex: 1; }

.item-editor {
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.item-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.item-editor .form-row + .form-row { margin-top: 10px; }
.item-editor .field { margin-bottom: 0; }
.item-editor .input { height: 38px; font-size: 13px; background: #fff; }
.remove-item {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 3px 5px;
  border-radius: 6px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.remove-item:hover { color: var(--danger); background: var(--danger-soft); }
.remove-item .ic { width: 14px; height: 14px; }

.add-item {
  width: 100%;
  height: 42px;
  border: 1px dashed #d5e4e1;
  border-radius: var(--radius-btn);
  background: #fcfdfd;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.add-item:hover { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-dark); }
.add-item .ic { width: 16px; height: 16px; }

.total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.total-line span { font-size: 12px; color: var(--muted); }
.total-line b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

.upload-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.upload-btn {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 1px dashed #d5e4e1;
  background: #fcfdfd;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.upload-btn:hover { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-dark); }
.upload-btn .ic { width: 20px; height: 20px; }

/* ------------------------------------------------------------ 设置 */
.settings-section + .settings-section { margin-top: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-size: 13px; }
.setting-label small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.setting-row .input { width: 150px; height: 36px; flex: none; }
.setting-row select.input { width: 150px; }

.category-row, .member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.category-row:last-child, .member-row:last-child { border-bottom: 0; }
.category-row .name, .member-row .name { flex: 1; font-size: 13px; min-width: 0; }
.member-row .name small { display: block; font-size: 11px; color: var(--muted); }
.member-row select.input { width: 100px; height: 32px; flex: none; font-size: 12px; }
.tag-off { font-size: 11px; color: var(--muted); background: #f1f4f7; border-radius: 5px; padding: 1px 6px; }
.tag-on { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 1px 6px; }

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 12px;
  border: 0;
  background: #dfe5ea;
  padding: 0;
  flex: none;
  transition: background .18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(16px); }

.integration-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 11px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa7b4; flex: none; }
.status-dot.ok { background: var(--primary); }
.status-dot.warn { background: #d18b21; }

/* ------------------------------------------------------------ 模态 / 提示 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 27, 45, .42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fade .18s ease;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: slide-up .24s cubic-bezier(.2, .8, .2, 1);
  max-height: 86vh;
  overflow-y: auto;
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.toast-root {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: rgba(15, 27, 45, .94);
  color: #fff;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(15, 27, 45, .25);
  animation: toast-in .2s ease;
  line-height: 1.5;
}
.toast.warn { background: #8a4b06; }
.toast.error { background: #8f2b26; }
.toast.success { background: #0b5c56; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.skeleton {
  background: linear-gradient(90deg, #eef2f5 25%, #f7f9fb 37%, #eef2f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.loading-block { display: flex; flex-direction: column; gap: 12px; }
.loading-block .skeleton { height: 92px; }

/* ------------------------------------------------------------ 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(1000px 420px at 100% -10%, rgba(15, 118, 110, .12), transparent 60%),
    radial-gradient(700px 360px at 0% 110%, rgba(15, 27, 45, .06), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(15, 27, 45, .08);
  padding: 30px 24px 24px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.login-brand h1 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.login-brand p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-intro { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.login-users { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.login-user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.login-user:hover {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  box-shadow: 0 4px 12px -8px rgba(15, 118, 110, .5);
}
.login-user .role-tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  background: #f1f4f7;
  padding: 2px 7px;
  border-radius: 5px;
}
.login-foot { margin-top: 22px; font-size: 11px; color: #a1adb9; text-align: center; line-height: 1.6; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 650;
  flex: none;
  letter-spacing: .5px;
}
.brand-mark.logo {
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.brand-mark.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ------------------------------------------------------------ PC / 企微桌面端 */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    position: static;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 16px 18px;
    background: #fff;
    border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 20px; }
  .brand-text strong { display: block; font-size: 16px; letter-spacing: -.3px; }
  .brand-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-size: 13.5px;
    text-align: left;
  }
  .side-item .ic { width: 18px; height: 18px; color: var(--muted); }
  .side-item:hover { background: #f6f8fa; }
  .side-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
  .side-item.active .ic { color: var(--primary); }
  .side-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
  }
  .side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
  .side-user { display: flex; align-items: center; gap: 9px; padding: 8px 6px; }
  .side-user .avatar { width: 32px; height: 32px; font-size: 12px; }
  .side-user strong { font-size: 12.5px; font-weight: 600; }
  .side-user small { display: block; font-size: 11px; color: var(--muted); }
  .side-note { font-size: 10.5px; color: #a4b0bc; padding: 6px; }

  .main { height: 100%; min-height: 0; padding-bottom: 0; }
  .tabbar { display: none; }
  .topbar {
    padding: 28px 40px 14px;
    background: transparent;
    backdrop-filter: none;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
  }
  .topbar-title h1 { font-size: 24px; letter-spacing: -.5px; }
  .topbar-title p { font-size: 13px; margin-top: 4px; }
  .view {
    padding: 12px 40px 40px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
  }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .kpi { padding: 16px 18px; min-height: 104px; }
  .kpi-value { font-size: 26px; }
  .dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
  .dash-grid .card + .card, .dash-grid .section + .section { margin-top: 0; }
  .card { padding: 20px; }
  .action-bar {
    position: static;
    padding: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    margin-top: 14px;
    justify-content: flex-end;
  }
  .action-bar .btn { flex: 0 0 auto; min-width: 120px; }
  .has-actionbar { padding-bottom: 104px; }
  .action-dock {
    left: 236px;
    right: 24px;
    transform: none;
    bottom: 22px;
    width: auto;
    max-width: 660px;
    margin: 0 auto;
    padding: 10px 12px 10px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 22px 50px -24px rgba(15, 27, 45, .4), 0 1px 2px rgba(15, 27, 45, .05);
    animation: fade-up .24s var(--ease);
  }
  .action-dock .btn { height: 40px; }
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .form-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .form-layout .form-card + .form-card { margin-top: 0; }
  .modal-mask { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; padding: 22px 22px 20px; animation: modal-in .2s ease; }
  @keyframes modal-in {
    from { transform: scale(.97); opacity: .5; }
    to { transform: none; opacity: 1; }
  }
  .report-list { display: flex; flex-direction: column; }
  .empty { padding: 60px 24px; }
}

@media (min-width: 1180px) {
  .ledger-row { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 380px) {
  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .view { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
}

/* ------------------------------------------------------------ 工资明细与工资条 */
.pay-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fbfcfc;
}
.pay-row-head { display: flex; align-items: center; gap: 8px; }
.pay-index {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #e8f4f1;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}
.pay-select { flex: 1; min-width: 0; }
.pay-position { width: 116px; flex: none; }
.pay-del {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.pay-del:hover { background: #fdecea; color: var(--danger); }
.pay-del .ic { width: 14px; height: 14px; }
.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 10px;
}
.pay-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pay-cell label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.pay-cell .input { height: 36px; padding: 0 8px; font-size: 12.5px; text-align: right; }
.pay-net {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-width: 78px;
  text-align: right;
}
.pay-net label { font-size: 10.5px; color: var(--muted); }
.pay-net b { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }

.pay-table { margin-top: 12px; border-top: 1px solid var(--line); }
.pay-table-head,
.pay-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 1fr 1fr 1.1fr;
  gap: 8px;
  align-items: center;
}
.pay-table-head {
  padding: 8px 0;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.pay-table-head span:nth-child(n+2),
.pay-table-row .num { text-align: right; }
.pay-table-row {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pay-table-row:last-child { border-bottom: 0; }
.pay-emp b { font-weight: 600; }
.pay-emp small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.pay-table-row .num.strong { font-weight: 650; }

.payslip-card { border: 1px solid #dfe8f6; background: linear-gradient(180deg, #f7faff 0%, #ffffff 62%); }
.payslip-lines { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.payslip-line {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.payslip-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.payslip-total b { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.payslip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.payslip-name { font-size: 15px; font-weight: 650; }
.payslip-sum { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .pay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-net { grid-column: span 2; flex-direction: row; align-items: baseline; justify-content: space-between; }
  .pay-position { width: 88px; }
  .pay-table-head, .pay-table-row { grid-template-columns: minmax(0, 1.3fr) 1fr 1fr 1fr; gap: 6px; }
  .pay-table-row { font-size: 12.5px; }
}

/* ------------------------------------------------------------ 审批规则（按单据类型） */
.rule-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  background: #fbfcfc;
}
.rule-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rule-head .ledger-icon { width: 30px; height: 30px; border-radius: 9px; }
.rule-head .ledger-icon .ic { width: 16px; height: 16px; }
.rule-head b { font-size: 13.5px; font-weight: 600; }
.rule-tag {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
}
.rule-grid { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 10px; }
.rule-grid .field { margin: 0; }
.rule-grid .input { height: 38px; font-size: 12.5px; }
@media (max-width: 640px) {
  .rule-grid { grid-template-columns: 1fr 1fr; }
  .rule-grid .field:last-child { grid-column: span 2; }
}
.settings-section > .hint { margin: 10px 2px 16px; }

/* ------------------------------------------------------------ 单据概览（看板） */
.kind-stats { display: flex; flex-direction: column; }
.kind-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}
.kind-stat:last-child { border-bottom: 0; }
.kind-stat .ledger-icon { width: 34px; height: 34px; border-radius: 10px; }
.kind-stat .ledger-icon .ic { width: 17px; height: 17px; }
.kind-stat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kind-stat-main b { font-size: 13px; font-weight: 600; color: var(--ink); }
.kind-stat-main small { font-size: 11px; color: var(--muted); }
.kind-stat-amount { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.kind-stat:hover .kind-stat-main b { color: var(--primary); }
.salary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.salary-line b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.salary-line .section-link { margin-left: auto; }

/* ------------------------------------------------------------ 消息中心 */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  transition: border-color .16s ease;
}
.msg-item:hover { border-color: var(--line-strong); }
.msg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  margin-top: 6px;
  flex: none;
}
.msg-item.unread .msg-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg-main b { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.msg-item.unread .msg-main b { color: var(--ink); }
.msg-main span { font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.msg-main small { font-size: 11px; color: var(--muted); }
.msg-tag {
  flex: none;
  font-size: 10.5px;
  color: #a9741a;
  background: #fbf1e0;
  border-radius: 6px;
  padding: 1px 6px;
}
@media (max-width: 420px) {
  .tab-item { padding: 6px 8px; font-size: 11px; }
}

/* ------------------------------------------------------------ 数据维护 */
.danger-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #f3d9d6;
  background: #fdf8f7;
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
}
.danger-panel b { font-size: 13px; font-weight: 600; }
.danger-panel p { margin: 4px 0 0; line-height: 1.6; }
.danger-panel .btn { flex: none; }
@media (max-width: 560px) {
  .danger-panel { flex-direction: column; }
  .danger-panel .btn { width: 100%; }
}

/* ------------------------------------------------------------ 成员管理 */
.member-del {
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.member-del:hover { background: #fdecea; color: var(--danger); }
.member-del .ic { width: 15px; height: 15px; }
.member-row.removed { opacity: .72; }
.role-row {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.role-row:last-child { border-bottom: 0; }
.role-row .name { flex: 1; min-width: 88px; font-size: 13px; }
.role-row .name small { display: block; font-size: 11px; color: var(--muted); }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.perm-pill.on {
  background: rgba(15, 118, 110, .08);
  border-color: rgba(15, 118, 110, .35);
  color: var(--primary);
}
.perm-pill.static { cursor: default; }
@media (max-width: 430px) {
  .role-perms { width: 100%; }
}
.section-subhead {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
