:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e6f4f1;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --topbar: 64px;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fff5f5; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
textarea { min-height: 84px; resize: vertical; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
label.field { display: block; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
label.field em { color: var(--danger); font-style: normal; margin-left: 2px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar);
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}
.brand-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 图片未就绪时必须真的隐藏：上面的 display:block 会盖掉 [hidden]，不补这条浏览器会画出破图与 alt 文字。 */
.brand-mark img[hidden] { display: none; }
/* 占位字：LOGO 还没加载出来时先显示“帐”，避免出现空白方块。 */
.brand-mark-fallback { font-size: 16px; line-height: 1; color: inherit; }
.brand-mark.has-logo .brand-mark-fallback,
.super-admin-brand .brand-mark.has-logo .brand-mark-fallback { display: none; }
.team-logo-row { display: flex; align-items: center; gap: 18px; }
.team-logo-preview {
  width: 88px; height: 88px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border); background: #f8fafc;
  display: grid; place-items: center; color: var(--muted); font-size: 12px;
  flex: 0 0 auto;
}
.team-logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.brand-text strong { display: block; font-size: 16px; letter-spacing: 0.3px; }
.brand-text small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; }

.team-switcher { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-switcher select { width: auto; max-width: 230px; min-height: 34px; padding: 5px 9px; font-size: 14px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-0 { background: var(--ok-soft); color: var(--ok); }
.status-1 { background: var(--amber-soft); color: var(--amber); }
.status-2 { background: var(--danger-soft); color: var(--danger); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ===== 顶部 header 团队区改造 ===== */
.header-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-logo {
  width: 32px; height: 32px; border-radius: 9px; overflow: hidden; flex: 0 0 auto;
  background: linear-gradient(135deg, #0f766e, #0ea5e9); color: #fff;
  display: grid; place-items: center;
}
.header-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-logo-default { font-weight: 700; font-size: 15px; }
.header-team-wrap { position: relative; min-width: 0; }
.header-team-name {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0.2px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-caret { color: var(--muted); font-size: 12px; }
.team-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 210px; max-width: 280px; padding: 6px;
  display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.team-menu[hidden] { display: none; }
.team-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: none; background: none; cursor: pointer;
  border-radius: 7px; font-size: 13px; color: var(--text); text-align: left;
}
.team-menu-item:hover { background: var(--hover); }
.team-menu-item.active { color: var(--primary); font-weight: 600; }
.team-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-menu-check { flex: 0 0 auto; }
.team-menu-join { border-top: 1px solid var(--line); border-radius: 0; margin-top: 2px; padding-top: 10px; color: var(--muted); }
.team-menu-create { color: var(--muted); }

/* ===== 用户头像下拉面板 ===== */
.user-menu-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px; max-width: 200px;
  padding: 4px 6px; background: none; border: none; cursor: pointer; border-radius: 8px;
}
.user-trigger:hover { background: var(--hover); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0f766e, #0ea5e9); color: #fff;
  font-size: 13px; font-weight: 700;
}
.user-avatar-lg { width: 52px; height: 52px; font-size: 20px; }
#user-trigger-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  width: 260px; max-width: calc(100vw - 24px); padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.user-menu[hidden] { display: none; }
.user-menu-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.user-menu-name-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.user-menu-display-name { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }
.user-menu-divider { height: 1px; background: var(--line); }
.user-menu-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.user-menu .btn { align-self: flex-start; }
.user-menu-logout {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--danger); font-size: 13px; cursor: pointer;
}
.user-menu-logout:hover { background: var(--hover); }

/* ===== 推荐注册页横幅 ===== */
.referral-banner { padding: 0; overflow: hidden; margin-bottom: 14px; }
.referral-banner img { display: block; width: 100%; height: auto; }
.referral-banner-text { padding: 14px 16px; font-size: 14px; line-height: 1.7; text-align: center; color: var(--text); }
.header-version, .header-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.header-status-0 { color: var(--ok); }
.header-status-1 { color: var(--amber); }
.header-status-2 { color: var(--danger); }
.header-upgrade {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--amber-soft); border-radius: 999px;
  background: var(--amber-soft); color: var(--amber);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.header-upgrade:hover { filter: brightness(0.97); }
.header-upgrade-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.icon-btn {
  position: relative;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}
.badge-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.user-chip { color: var(--muted); font-size: 13px; }
.user-center-entry { border: 0; background: transparent; padding: 5px 7px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.user-center-entry:hover { background: #f1f5f9; color: var(--ink); }
.user-center-entry:focus-visible { outline: 2px solid #99f6e4; outline-offset: 1px; }

.layout { flex: 1; display: flex; min-height: 0; align-items: flex-start; }
.sidebar {
  position: sticky;
  top: var(--topbar);
  align-self: flex-start;
  width: 212px;
  flex: 0 0 212px;
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 16px 12px 28px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 10;
}
.nav-title { font-size: 11px; color: var(--muted); letter-spacing: 1px; padding: 0 10px 8px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 12px;
}
.sidebar-toggle .nav-icon { width: 16px; height: 16px; }
.nav-scroll { display: block; }
.nav-tree {
  display: block;
  --nav-indent-step: 16px;
}
.nav-icons { display: none; }
.nav-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px 9px 0;
  margin: 2px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
}
.nav-parent:hover { background: var(--surface-2); color: var(--ink); }
.nav-parent.has-active { color: var(--brand-dark); background: rgba(15, 118, 110, 0.06); }
.nav-parent .nav-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.16s ease;
}
.nav-parent.is-open .nav-caret { transform: rotate(0deg); }
.nav-parent:not(.is-open) .nav-caret { transform: rotate(-90deg); }
.nav-children { margin-left: 0; padding-left: 0; border-left: 0; box-shadow: inset 1px 0 0 var(--line); }
.nav-children[hidden] { display: none; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--brand-dark); }
.nav-node-dot { width: 5px; height: 5px; margin: 0 6px 0 7px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.nav-label { flex: 1; min-width: 0; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: break-word; line-height: inherit; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 9px 12px 9px 0;
  margin: 2px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-tree .nav-item.level-1,
.nav-tree .nav-parent.level-1,
.nav-tree .nav-group.level-1 > .nav-parent { padding-left: 0; }
.nav-tree .nav-item.level-2,
.nav-tree .nav-parent.level-2,
.nav-tree .nav-group.level-2 > .nav-parent { padding-left: var(--nav-indent-step); }
.nav-tree .nav-item.level-3,
.nav-tree .nav-parent.level-3,
.nav-tree .nav-group.level-3 > .nav-parent { padding-left: calc(var(--nav-indent-step) + var(--nav-indent-step)); }
.nav-tree .nav-item.level-4,
.nav-tree .nav-parent.level-4,
.nav-tree .nav-group.level-4 > .nav-parent { padding-left: calc(var(--nav-indent-step) + var(--nav-indent-step) + var(--nav-indent-step)); }
.nav-tree .nav-parent .nav-caret { display: inline-flex; align-items: center; line-height: 1; }
.nav-badge { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.content { flex: 1; min-width: 0; padding: 24px 26px 64px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: 0.2px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.card-pad { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card { padding: 17px 19px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: 0.3px; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.section { margin-top: 20px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 16px; }
.section-head span { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
td { color: var(--ink); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 列表内跳转链接：保持表格布局，仅 hover 变色提示可点击 */
.cell-jump-link { cursor: pointer; color: var(--brand-dark); }
a.cell-jump-link.ellipsis, .cell-jump-link.ellipsis { display: inline-block; vertical-align: middle; }
.cell-jump-link:hover { color: var(--brand); text-decoration: underline; }
.doc-no.cell-jump-link { font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag-green { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.tag-red { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.tag-amber { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }
.tag-gray { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
/* 业务数据下拉：字段从手写文字改成下拉后，旧值原样显示并标注未关联 */
.bizref-legacy-hint { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #f8fafc; border: 1px dashed var(--line); font-size: 12px; color: #334155; line-height: 1.7; }
.bizref-legacy-hint b { color: #0f172a; }
.bizref-legacy-hint .tag { margin: 0 6px; }
.bizref-legacy-hint small { display: block; color: var(--muted); }
/* 搜索下拉弹层里的分类分组标题（多分类数据源） */
.search-select-group-label { padding: 6px 12px 4px; font-size: 12px; font-weight: 600; color: #64748b; background: #f8fafc; border-top: 1px solid var(--line); }
.search-select-group-label:first-child { border-top: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.toolbar .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.toolbar .field-wide { flex: 2 1 240px; max-width: 360px; }
.toolbar .field span { margin-bottom: 4px; }
.toolbar .spacer { flex: 1; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.alert-warn { background: var(--amber-soft); border-color: #fde68a; color: var(--amber); }
.alert-danger { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
.alert-ok { background: var(--ok-soft); border-color: #bbf7d0; color: var(--ok); }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.temp-perm-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.temp-perm-block h3 { margin: 0 0 8px; font-size: 14px; }
.temp-perm-block .muted { margin-bottom: 10px; }
.temp-duration-row { display: flex; gap: 8px; align-items: center; }
.temp-duration-row input { flex: 1 1 auto; min-width: 0; }
.temp-duration-row select { flex: 0 0 auto; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 22px;
}
.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal-head { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; cursor: move; user-select: none; touch-action: none; }
.modal-head h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.modal-head-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; row-gap: 4px; gap: 4px; flex: 0 1 auto; min-width: 0; }
.modal-head-actions .btn { white-space: nowrap; }
.modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.modal-fullscreen { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 7px; padding: 5px 9px; font-size: 12px; cursor: pointer; }
.modal-fullscreen:hover { border-color: #99f6e4; background: #f0fdfa; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 18px 20px 22px; overflow: auto; }
.modal-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; }
/* 弹窗内嵌操作栏：吸附在内容区底部，滚动时始终可见（不改动 DOM 与事件） */
.modal-body .form-actions,
.modal-body .customer-form-actions,
.modal-body .business-detail-actions,
.modal-body .business-dependency-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
  padding-top: 10px;
  padding-bottom: 2px;
  border-top: 1px solid var(--line);
}
.modal-body .customer-form-actions { margin-top: 18px; }
.cashier-apply-dialog .cashier-apply-field { display: flex; flex-direction: column; gap: 7px; }
.cashier-apply-dialog .cashier-apply-field label { font-weight: 600; color: var(--text); }
.cashier-apply-dialog .cashier-apply-field input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--text); background: #fff; }
.cashier-apply-dialog .cashier-apply-field input:focus { outline: none; border-color: #99f6e4; box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12); }
.cashier-apply-dialog .cashier-apply-meta { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 13px; line-height: 1.7; }
.cashier-apply-dialog .cashier-apply-error { min-height: 20px; margin: 10px 0 0; color: #dc2626; font-size: 13px; }
.cashier-apply-dialog .cashier-apply-error.is-hidden { visibility: hidden; }
.cashier-apply-dialog .cashier-apply-submit { min-width: 96px; min-height: 46px; padding: 8px 18px; line-height: 1.2; }
.cashier-apply-dialog .cashier-apply-btn-label { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.2; white-space: nowrap; }
.cashier-status-detail { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.cashier-list-apply-btn { white-space: nowrap; }
.cashier-records-card { margin-top: 18px; }
.business-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 2px 12px; }
.business-section-head h2 { margin: 0; font-size: 16px; }
.business-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.cashier-record-amount { font-weight: 600; white-space: nowrap; }
.cashier-cap-summary { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.cashier-cap-summary strong { color: var(--text); font-weight: 600; }
.row-select-head, .row-select-cell { width: 42px; text-align: center; white-space: nowrap; }
.row-select-cell input, .row-select-head input { cursor: pointer; }
.business-section-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 公共弹窗容器：全屏、标题栏拖动、右下角拉伸 */
.modal.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  transform: none !important;
  z-index: 70;
}
.modal.is-fullscreen .modal-head { cursor: default; }
.modal.is-fullscreen .modal-resize-handle { display: none; }
.modal.is-window-top { box-shadow: 0 26px 70px rgba(15, 23, 42, 0.34); }

.modal-preview {
  width: min(1040px, calc(100vw - 44px));
  height: min(82vh, 900px);
  max-height: none;
}
.modal-preview .modal-body { display: flex; flex-direction: column; }
.modal-preview .file-preview-body { flex: 1 1 auto; min-height: 120px; max-height: none; overflow: auto; }
.modal-preview .file-preview-image { max-height: none; max-width: 100%; }
.modal-preview .file-preview-frame { height: 100%; min-height: 220px; }
.modal-preview .xlsx-preview { flex: 1 1 auto; min-height: 0; }
.modal-preview .xlsx-table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
.modal-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 0 44%, var(--line) 45% 52%, transparent 53% 64%, var(--line) 65% 72%, transparent 73%);
}
.file-preview-word { padding: 6px 2px; font-size: 14px; line-height: 1.8; color: var(--text); word-break: break-word; }
.file-preview-word h1, .file-preview-word h2, .file-preview-word h3, .file-preview-word h4, .file-preview-word h5, .file-preview-word h6 { margin: 16px 0 8px; line-height: 1.45; color: #0f172a; }
.file-preview-word h1 { font-size: 22px; }
.file-preview-word h2 { font-size: 19px; }
.file-preview-word h3 { font-size: 17px; }
.file-preview-word h4, .file-preview-word h5, .file-preview-word h6 { font-size: 15px; }
.file-preview-word p { margin: 0 0 10px; }
.file-preview-word ul, .file-preview-word ol { margin: 0 0 10px 22px; padding: 0; }
.file-preview-word table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.file-preview-word table td, .file-preview-word table th { border: 1px solid #dbe3ef; padding: 6px 8px; vertical-align: top; }
.file-preview-word img { max-width: 100%; height: auto; }
.file-preview-word a { color: var(--brand-dark); }
.file-preview-word .word-preview-message { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 80;
  min-width: 220px;
  max-width: min(520px, 90vw);
  padding: 11px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #991b1b; }
.toast.ok { background: #14532d; }

.folder-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.folder-card { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.folder-card:hover { border-color: #99f6e4; background: #f0fdfa; }
.folder-icon { width: 34px; height: 28px; border-radius: 6px; background: var(--brand-soft); position: relative; flex: 0 0 auto; }
.folder-icon::before { content: ""; position: absolute; left: 5px; top: -4px; width: 13px; height: 8px; background: var(--brand-soft); border-radius: 4px 4px 0 0; }
.folder-name { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-meta { color: var(--muted); font-size: 11px; }
.folder-desc { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-current-desc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 12px; }
.folder-current-desc[hidden] { display: none; }
.folder-current-desc span { flex: 1; min-width: 200px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumb { border: 0; background: transparent; color: var(--brand-dark); padding: 2px 4px; border-radius: 6px; }
.crumb:hover { background: var(--brand-soft); }

.move-breadcrumb { display: flex; align-items: center; gap: 4px; overflow-x: auto; white-space: nowrap; padding: 4px 0 10px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); -webkit-overflow-scrolling: touch; }
.move-breadcrumb .crumb { flex: 0 0 auto; }
.move-breadcrumb .crumb.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.move-current { padding: 9px 12px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.move-folder-list { display: flex; flex-direction: column; gap: 7px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.move-folder-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; cursor: pointer; }
.move-folder-row:hover { border-color: #99f6e4; background: #f0fdfa; }
.move-folder-row .folder-name { flex: 1; min-width: 0; }
.move-arrow { flex: 0 0 auto; color: var(--muted); font-size: 18px; line-height: 1; }
.move-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 13px; text-align: center; }

.quota { margin: 12px 0 0; }
.quota-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.quota-fill { height: 100%; background: linear-gradient(90deg, #0f766e, #0ea5e9); width: 0; }
.quota-text { color: var(--muted); font-size: 12px; margin-top: 5px; }

.role-checks { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.perm-group h4 { margin: 0 0 8px; font-size: 13px; }

/* 角色弹窗：一行一个表单分类，操作/数据共用，带阴影边框与拖拽手柄 */
.role-category-rows { display: flex; flex-direction: column; gap: 10px; }
.category-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  background: var(--surface-2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.category-card.perm-inactive { opacity: 0.55; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; user-select: none; flex: 0 0 auto; }
.drag-handle:active { cursor: grabbing; }
.category-card-name { flex: 0 0 108px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.category-card-options { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.category-card-options .check-row { white-space: nowrap; }
.category-data-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.category-data-options .radio-stack { display: flex; align-items: center; gap: 18px; flex: 1 1 auto; }
.category-data-options .radio-stack .check-row { flex: 0 0 auto; }
.category-card .check-row input { width: 14px; min-height: 14px; }
.check-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.check-row input { width: 14px; min-height: 14px; accent-color: var(--brand); flex: 0 0 auto; }
.customer-form .field .check-row input[type="checkbox"] { width: 14px; min-height: 14px; }

.attachment-box { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.attachment-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.attachment-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.attachment-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row .muted { font-size: 11px; }
.file-preview-body { min-height: 180px; max-height: 68vh; overflow: auto; display: grid; place-items: stretch; }
.file-preview-image { max-width: 100%; max-height: 66vh; margin: 0 auto; object-fit: contain; border-radius: 8px; }
.file-preview-frame { width: 100%; height: 66vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.file-preview-text { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13px; line-height: 1.65; }
.xlsx-preview { display: flex; flex-direction: column; min-height: 180px; }
.xlsx-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.xlsx-tab { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 7px; padding: 6px 12px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.xlsx-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.xlsx-meta { color: var(--muted); font-size: 12px; padding: 8px 0; }
.xlsx-table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.xlsx-table { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.xlsx-table td { border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; padding: 5px 8px; white-space: nowrap; vertical-align: top; }
.xlsx-table td:empty::after { content: ' '; }
.file-editor { width: 100%; min-height: 52vh; padding: 12px; border: 1px solid var(--line); border-radius: 9px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.6; resize: vertical; }

.pill-tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.pill-tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.pill-tabs button.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }

.msg-list { display: flex; flex-direction: column; }
.msg-row { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; cursor: pointer; transition: background 0.15s ease; }
.msg-row:hover, .msg-row:focus-visible { background: var(--surface-2); outline: none; }
.msg-row:last-child { border-bottom: 0; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: 0 0 auto; margin-top: 7px; }
.msg-dot.read { background: transparent; border: 1px solid var(--line); }
.msg-body { flex: 1; min-width: 0; }
.msg-text { font-size: 14px; }
.msg-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.msg-sys-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.push-detail-content { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.msg-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; }
.list-sub { color: var(--muted); font-size: 12px; }
.list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.item-more { position: relative; display: inline-flex; }
.item-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 112px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}
.item-more-menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; }
.item-more-menu button:hover { background: var(--brand-soft); color: var(--brand-dark); }
.xlsx-edit-hint { color: var(--muted); font-size: 12px; padding: 0 0 8px; }
.xlsx-table td.xlsx-editable { min-width: 72px; cursor: text; }
.xlsx-table td.xlsx-editable:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #f0fdfa; }
.permission-table-wrap { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.permission-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.permission-table th, .permission-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f7; text-align: center; white-space: nowrap; }
.permission-table th { position: sticky; top: 0; background: #f8fafc; z-index: 1; font-weight: 600; }
.permission-table th:first-child, .permission-table td:first-child { text-align: left; }
.permission-table td[data-perm-cell] { cursor: pointer; }
.permission-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.permission-table input:disabled { cursor: not-allowed; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.pc-section { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.pc-section:first-child { padding-top: 0; }
.pc-section:last-child { border-bottom: 0; padding-bottom: 0; }
.pc-label { color: var(--muted); font-size: 12px; }
.pc-value { color: var(--ink); font-size: 16px; font-weight: 700; }
.pc-sub { color: var(--muted); font-size: 12px; line-height: 1.7; }
.pc-action { align-self: flex-start; margin-top: 4px; }
.pc-trial-note { color: #8a5a00; background: #fff7e6; border: 1px solid #f5d38a; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.6; }
.referral-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
.referral-main { min-width: 0; }
.referral-link-row { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.referral-link-row input { flex: 1; min-width: 0; }
.referral-qr { text-align: center; }
.referral-qr .btn { margin-top: 4px; }
.qr-box { width: 200px; height: 200px; margin: 10px auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; }
.qr-box img { width: 184px; height: 184px; display: block; }
.qr-hint { color: var(--muted); font-size: 11px; text-align: center; line-height: 1.4; }
.invite-row { align-items: flex-start; flex-wrap: wrap; }
.invite-row .list-main { flex: 1; min-width: 0; }
.invite-row .list-actions { flex: 0 0 auto; }
.invite-section-head { justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.invite-section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
#invite-tabs { flex-wrap: wrap; }
.invite-history-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 13px 15px; border: 0; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; flex-wrap: wrap; }
.invite-history-head:hover { background: #eef4f2; }
.invite-history-head.open { background: #eef4f2; }
.invite-history-arrow { display: inline-block; color: var(--muted); transition: transform 0.15s ease; }
.invite-history-head.open .invite-history-arrow { transform: rotate(90deg); }
.invite-history-title { font-weight: 700; }
.invite-history-note { margin-left: auto; color: var(--muted); font-size: 12px; }
.invite-history-body { background: #fbfcfc; }
.invite-history-body[hidden] { display: none; }
.invite-history-body .list-row { padding-left: 27px; }
.invite-history-row { align-items: flex-start; }
.invite-readonly { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.invite-link-wrap { display: flex; align-items: flex-start; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.invite-link-text { flex: 0 1 auto; min-width: 0; word-break: break-all; padding-top: 6px; }
.invite-qr { flex: 0 0 132px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0 0 12px; border-left: 1px dashed var(--line); }
.invite-qr .pc-label { font-size: 12px; }
.invite-qr img { width: 112px; height: 112px; display: block; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.invite-qr .btn { padding: 4px 10px; font-size: 12px; }
.qr-error { width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; text-align: center; }
#password-error { color: var(--danger); font-size: 12px; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --topbar: auto; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .brand { min-width: 0; flex: 1; }
  .brand-text small { display: none; }
  .team-switcher { order: 3; width: 100%; padding-top: 8px; border-top: 1px solid var(--line); }
  .team-switcher select { max-width: none; flex: 1; }
  .topbar-right { margin-left: auto; gap: 8px; }
  .header-version, .header-status { display: none; }
  .header-team-name { max-width: 180px; font-size: 15px; }
  .user-chip { display: inline-block; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .referral-grid { grid-template-columns: 1fr; }
  .referral-link-row { flex-wrap: wrap; }
  .referral-link-row input { flex: 1 1 100%; }
  .layout { flex-direction: column; align-items: stretch; }
  .sidebar { position: static; height: auto; width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; overflow: visible; }
  .sidebar-head { min-height: 32px; }
  .sidebar-toggle { display: inline-flex; margin-left: auto; }
  .nav-title { display: none; }
  .nav-scroll { display: block; min-width: 0; }
  .sidebar .nav-tree { max-height: 56vh; overflow-y: auto; padding-right: 2px; -webkit-overflow-scrolling: touch; }
  .sidebar .nav-item { width: 100%; margin: 2px 0; padding: 9px 12px; font-size: 13px; }
  .sidebar .nav-parent { font-size: 13px; }
  .nav-icons { display: none; gap: 8px; overflow-x: auto; padding: 4px 2px 2px; }
  .sidebar.is-collapsed .nav-tree { display: none; }
  .sidebar.is-collapsed .nav-icons { display: flex; }
  .sidebar.is-collapsed .sidebar-toggle { padding: 6px 8px; }
  .sidebar.is-collapsed .sidebar-toggle span { display: none; }
  .nav-icon-btn {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--brand-dark);
  }
  .nav-icon-btn .nav-icon { width: 19px; height: 19px; }
  .nav-icon-btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
  .nav-icon-btn span { display: none; }
  .content { padding: 16px 14px 52px; }
  .page-head h1 { font-size: 19px; }
  .page-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
  .form-grid, .role-checks { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .business-contract-form { grid-template-columns: 1fr; column-gap: 0; row-gap: 14px; }
  .business-contract-form .contract-docno-field,
  .business-contract-form .contract-name-field,
  .business-contract-form .contract-party-field,
  .business-contract-form .contract-owner-field,
  .business-contract-form .contract-term-field,
  .business-contract-form .contract-date-field,
  .business-contract-form .contract-parent-field,
  .business-contract-form .contract-amount-field,
  .business-contract-form .contract-settlement-field,
  .business-contract-form .contract-payment-field,
  .business-contract-form .contract-remark-field,
  .business-contract-form .contract-attachment-field,
  .business-contract-form .contract-default-field,
  .business-contract-form .customer-form-actions { grid-column: 1 / -1; }
  .business-contract-form .contract-term-field .date-range-trigger,
  .business-contract-form .contract-date-field input {
    min-height: 38px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .toolbar .field, .toolbar .field-wide { max-width: none; flex: 1 1 46%; min-width: 0; }
  .toolbar .field-wide { flex-basis: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 88px 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100vw; height: 92vh; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-preview { width: 100vw; height: 92vh; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal.is-fullscreen { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-resize-handle { display: none; }
  .modal-head { padding: 12px 14px; gap: 8px; }
  .modal-head h2 { font-size: 15px; }
  .xlsx-editor-modal .modal-head { flex-wrap: wrap; align-items: flex-start; }
  .xlsx-editor-modal .modal-head h2 { flex: 1 1 100%; }
  .xlsx-editor-modal .modal-head-actions { width: 100%; }
  .modal-fullscreen { padding: 4px 7px; font-size: 11px; }
  .modal-body { padding: 14px 14px 18px; }
  .permission-table-wrap { max-height: 52vh; }
  .move-folder-list { max-height: 40vh; }
  table { min-width: 560px; }
}

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background:
  radial-gradient(1100px 500px at 10% 0%, #e6f4f1 0%, rgba(230, 244, 241, 0) 60%),
  radial-gradient(900px 480px at 100% 100%, #e0f2fe 0%, rgba(224, 242, 254, 0) 55%),
  var(--bg);
}
.login-card { width: min(940px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 22px 60px rgba(15, 23, 42, 0.13); border: 1px solid var(--line); }
.login-brand { padding: 40px 38px; background: linear-gradient(150deg, #0f766e 0%, #115e59 55%, #0f172a 100%); color: #fff; display: flex; flex-direction: column; gap: 18px; }
.login-brand .brand-mark { background: rgba(255, 255, 255, 0.16); width: 44px; height: 44px; font-size: 20px; }
.login-brand h1 { margin: 12px 0 0; font-size: 26px; line-height: 1.35; letter-spacing: 0.4px; }
.login-brand p { margin: 0; color: rgba(255, 255, 255, 0.76); font-size: 14px; line-height: 1.8; }
.login-feature { display: flex; gap: 9px; align-items: flex-start; color: rgba(255, 255, 255, 0.86); font-size: 13px; }
.login-feature i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; flex: 0 0 auto; font-size: 11px; }
.login-form-wrap { padding: 38px 40px; }
.login-form-wrap h2 { margin: 0 0 4px; font-size: 22px; }
.login-form-wrap > p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 20px; }
.login-tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.login-tabs button.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08); }
.login-fields { display: grid; gap: 14px; }
.login-fields .hint { font-size: 12px; color: var(--muted); margin-top: -6px; }
.login-alert { margin-bottom: 14px; }
.login-foot { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-foot code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* 注册页协议勾选：复选框居左、缩小到与文字匹配、垂直居中 */
.agreement-check { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.agreement-check input[type="checkbox"] { width: 14px; height: 14px; min-height: 0; margin: 0; flex: 0 0 auto; cursor: pointer; }
.agreement-check span { flex: 1 1 auto; }

/* 邀请链接确认加入弹层 */
.join-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
}
.join-confirm-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.join-confirm-card h2 { margin: 0 0 8px; font-size: 22px; }
.join-confirm-card > p { margin: 0 0 18px; line-height: 1.7; color: var(--muted); }
.join-confirm-error { color: #c0392b; font-size: 13px; min-height: 18px; }

@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; max-width: 520px; }
  .login-brand { padding: 24px 24px; }
  .login-brand h1 { font-size: 22px; }
  .login-brand p, .login-feature { display: none; }
  .login-form-wrap { padding: 26px 22px 30px; }
}

/* ===== 独立超级管理员后台 ===== */
.super-admin-body {
  min-height: 100vh;
  background:
    radial-gradient(960px 380px at 8% 0%, #e6f4f1 0%, rgba(230, 244, 241, 0) 62%),
    var(--bg);
}
.super-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a 0%, #115e59 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.super-admin-brand { display: flex; align-items: center; gap: 12px; }
.super-admin-brand .brand-mark { background: rgba(255, 255, 255, 0.16); border-color: transparent; color: #fff; }
.super-admin-brand strong { display: block; font-size: 16px; letter-spacing: 0.4px; }
.super-admin-brand span { display: block; color: rgba(255, 255, 255, 0.66); font-size: 12px; }
/* 顶栏占位字要按方块内文字排版，别被上面的副标题样式（12px、半透明灰）带走。 */
.super-admin-brand .brand-mark .brand-mark-fallback { display: inline-block; color: #fff; font-size: 16px; line-height: 1; }
.super-admin-account { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.super-admin-account .btn { color: #fff; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); }
.super-admin-page { width: 100%; margin: 0; padding: 0; }
.admin-login { display: grid; place-items: center; min-height: calc(100vh - 130px); }
.admin-login-card { width: min(520px, 100%); }
.admin-login-card .page-head { margin-bottom: 16px; }
.admin-total { margin-left: auto; padding: 7px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; }
.form-template-summary-item { display: inline-block; margin-left: 8px; padding-left: 8px; border-left: 1px solid rgba(15, 118, 110, 0.24); }
#form-template-total { white-space: normal; }
.form-template-summary-item.is-enabled { color: var(--ok); }
.form-template-summary-item.is-disabled { color: var(--danger); }
.form-template-summary-item b { font-weight: 800; }
.admin-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.admin-head-actions .admin-total { margin-left: 0; }
.admin-logs-dialog { width: min(920px, 100%); }
.admin-log-table { min-width: 760px; }
.admin-team-logs-dialog { width: min(1040px, 100%); }
.admin-table.admin-team-log-table { min-width: 900px; }
.admin-team-log-team { margin: 0 0 12px; font-weight: 600; color: var(--text); }
.admin-team-log-filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.admin-team-log-filters .field { min-width: 150px; flex: 1 1 160px; margin: 0; }
.admin-team-log-filters input { min-height: 34px; }
.admin-team-log-filter-actions { display: flex; gap: 8px; margin-left: auto; }
.admin-team-log-summary { margin: 0 2px 8px; }
.admin-team-log-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.admin-log-desc { white-space: normal; min-width: 240px; max-width: 420px; }
.admin-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; }
.admin-team-table { min-width: 1440px; }
.admin-admins-table { min-width: 880px; }
.admin-role-badge { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); font-size: 12px; white-space: nowrap; }
.admin-status-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.admin-status-badge.is-enabled { background: #e8f7ef; color: #16794b; }
.admin-status-badge.is-disabled { background: #fdecec; color: #b42318; }
.admin-inviter { white-space: normal; min-width: 120px; }
.admin-remaining { white-space: nowrap; font-weight: 600; }
.admin-remaining.is-free { color: var(--brand-dark); }

/* 团队管理表：剩余天数、操作两列 sticky 固定在最右侧，横向滚动时悬浮不跟随。 */
.admin-team-table .admin-sticky-head,
.admin-team-table .admin-sticky-cell { position: sticky; z-index: 1; }
.admin-team-table .admin-sticky-head { z-index: 2; }
.admin-team-table th:last-child,
.admin-team-table td:last-child { right: 0; min-width: 150px; }
.admin-team-table th:nth-last-child(2),
.admin-team-table td:nth-last-child(2) { right: 150px; min-width: 96px; box-shadow: -1px 0 0 var(--line); }
.admin-team-table .admin-sticky-head { background: var(--surface-2); }
.admin-team-table tbody tr:nth-child(odd) > .admin-sticky-cell { background: #FFFFFF; }
.admin-team-table tbody tr:nth-child(even) > .admin-sticky-cell { background: #FAFAFA; }
.admin-team-table tbody tr:hover > .admin-sticky-cell { background: #EDF4F1; }
.admin-team-table tbody tr:active > .admin-sticky-cell { background: #E4EFEA; }

/* 附件已用容量：实时统计只读展示，灰色文字。 */
.admin-attachment-used { color: var(--muted); }

/* 左侧四列固定居左：统一 100px 宽，内容自动换行。 */
.admin-team-table th:nth-child(-n+4),
.admin-team-table td:nth-child(-n+4) {
  position: sticky; width: 100px; min-width: 100px; max-width: 100px;
  white-space: normal; word-break: break-word; z-index: 1;
}
.admin-team-table th:nth-child(-n+4) { z-index: 2; }
.admin-team-table th:nth-child(1), .admin-team-table td:nth-child(1) { left: 0; }
.admin-team-table th:nth-child(2), .admin-team-table td:nth-child(2) { left: 100px; }
.admin-team-table th:nth-child(3), .admin-team-table td:nth-child(3) { left: 200px; }
.admin-team-table th:nth-child(4), .admin-team-table td:nth-child(4) { left: 300px; box-shadow: 1px 0 0 var(--line); }
.admin-team-table thead tr > th:nth-child(-n+4) { background: var(--surface-2); }
.admin-team-table tbody tr:nth-child(odd) > td:nth-child(-n+4) { background: #FFFFFF; }
.admin-team-table tbody tr:nth-child(even) > td:nth-child(-n+4) { background: #FAFAFA; }
.admin-team-table tbody tr:hover > td:nth-child(-n+4) { background: #EDF4F1; }
.admin-team-table tbody tr:active > td:nth-child(-n+4) { background: #E4EFEA; }

/* 套餐版本文字按钮：点击弹出无搜索下拉。 */
.admin-version-text {
  background: none; border: 0; padding: 0; color: var(--brand-dark);
  font: inherit; font-weight: 600; text-align: left; cursor: pointer; word-break: break-word;
}
.admin-version-text:hover { text-decoration: underline; }
.admin-version-popover .search-select-options { max-height: 240px; }
.admin-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-admin-actions .btn-sm { min-height: 28px; }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-row-actions .btn-sm { min-height: 28px; }
.form-template-name-line { display: flex; align-items: flex-start; gap: 8px; }
.form-template-drag {
  flex: 0 0 auto;
  width: 24px;
  min-height: 34px;
  padding: 2px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}
.form-template-drag:active { cursor: grabbing; }
.form-template-name-text { min-width: 0; }
.form-template-row { cursor: grab; }
.form-template-row:active { cursor: grabbing; }
.form-template-row.is-dragging { opacity: .55; }
.form-template-row.is-drop-target { background: rgba(13, 148, 136, .06); box-shadow: inset 3px 0 0 var(--brand); }
.form-template-row .admin-row-actions,
.form-template-row .form-template-status { cursor: default; }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-table th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.admin-table td { font-size: 13px; }
.admin-table tr:last-child td { border-bottom: 0; }
/* 超管全部列表：与业务端统一的纯 CSS 斑马纹与整行悬停/触摸高亮 */
.admin-table tbody tr:nth-child(odd) > td { background: #FFFFFF; }
.admin-table tbody tr:nth-child(even) > td { background: #FAFAFA; }
@media (hover: hover) {
  .admin-table tbody tr:hover > td { background: #EDF4F1; }
}
@media (hover: none) {
  .admin-table tbody tr:active > td { background: #E4EFEA; }
}
.admin-table tbody tr.is-drop-target > td { background: rgba(13, 148, 136, .06); }
.admin-table tbody tr.is-dragging > td { opacity: .55; }
.admin-table .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-table .btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.admin-version-select { min-height: 32px; padding: 4px 26px 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; color: var(--text); }
.admin-table .empty { padding: 46px 20px; text-align: center; color: var(--muted); white-space: normal; }
.admin-table thead .table-status-head,
.admin-table thead .business-action-head { background: var(--surface-2); }
.admin-total { white-space: nowrap; }
.admin-modal[hidden], #admin-login[hidden], #admin-shell[hidden], #admin-dashboard[hidden], #admin-list-page[hidden], #admin-list-card[hidden], #admin-list-denied[hidden], #enterprise-page[hidden], #admin-logs-page[hidden], #admin-manage-link[hidden], #admin-account[hidden] { display: none !important; }
@media (max-width: 760px) {
  .super-admin-topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .super-admin-account { width: 100%; justify-content: space-between; }
  .admin-total { margin-left: 0; }
  .admin-head-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .admin-team-log-filters .field { flex-basis: 100%; min-width: 0; }
  .admin-team-log-filter-actions { width: 100%; margin-left: 0; }
}

/* 超管后台外层布局：侧边栏贴浏览器最左边缘且占满高度，内容区占满剩余宽度，不再居中限宽。 */
.admin-layout { display: flex; align-items: stretch; width: 100%; }
.admin-sidebar {
  flex: 0 0 188px; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; overflow-y: auto;
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: var(--surface); box-shadow: none;
}
.admin-nav { display: flex; flex-direction: column; padding: 12px 8px; }
.admin-nav-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  margin: 2px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.admin-nav-item:hover { background: var(--surface-2); }
.admin-nav-parent { justify-content: space-between; font-weight: 600; }
.admin-nav-caret { color: var(--muted); transition: transform .18s ease; }
.admin-nav-group.is-open .admin-nav-caret { transform: rotate(180deg); }
.admin-nav-children { display: flex; flex-direction: column; padding: 2px 0 4px; }
.admin-nav-sub { padding-left: 26px; font-size: 12.5px; color: var(--muted); }
.admin-nav-item.is-active { background: var(--brand-soft); color: var(--brand-dark); border-color: rgba(15, 118, 110, 0.22); font-weight: 700; }
.admin-nav-children[hidden], .admin-nav-group .admin-nav-children[hidden] { display: none; }
.admin-content { flex: 1 1 auto; min-width: 0; padding: 24px 26px 60px; }
.admin-login { padding: 28px 22px; }

/* 企业管理：两列等宽卡片，窄屏自动堆叠；LOGO 预览复用 brand-mark。 */
.enterprise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.enterprise-card { min-width: 0; }
.enterprise-card-title { margin: 0 0 14px; font-size: 15px; color: var(--brand-dark); }
.enterprise-logo-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.enterprise-logo-preview { flex: 0 0 auto; width: 52px; height: 52px; font-size: 22px; }
.enterprise-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.enterprise-file-btn { position: relative; cursor: pointer; }
.enterprise-hint { flex-basis: 100%; margin: 2px 0 0; }
.enterprise-save-bar { margin-top: 16px; }

/* 设置备份与恢复：概览用一排小标签，数字加粗便于一眼看出配了多少东西。 */
.settings-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.settings-chip strong { color: var(--ink); font-weight: 700; }
.settings-chip-file { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }

/* 登录页配置：左侧预览模拟登录品牌深色区，右侧表单复用现有 field/input。 */
.login-config-preview {
  background: linear-gradient(160deg, #0f766e, #0369a1);
  color: #fff;
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
}
.login-config-preview .brand-mark { background: rgba(255, 255, 255, 0.16); }
.login-config-english { font-size: 14px; letter-spacing: 2px; opacity: .75; }
.login-config-preview h3 { margin: 6px 0 0; font-size: 22px; line-height: 1.35; }
.login-config-preview p { margin: 0; font-size: 13px; line-height: 1.7; opacity: .9; }
.login-config-preview .login-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.login-config-preview .login-feature i {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18); display: grid; place-items: center; font-style: normal; font-size: 12px;
}
.login-config-preview .login-feature span { opacity: .92; }

/* 管理员弹窗：短信验证码输入 + 获取按钮并排，复用现有 input/btn，不写固定宽度。 */
.admin-sms-row { display: flex; gap: 8px; align-items: center; }
.admin-sms-row input { flex: 1 1 auto; min-width: 0; }
.admin-sms-btn { flex: 0 0 auto; }
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { flex: none; width: 100%; position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav-group { width: 100%; }
  .admin-content { padding: 18px 16px 48px; }
  .enterprise-grid { grid-template-columns: 1fr; }
}

/* 审批设置 */
.approval-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.approval-row { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.approval-row[hidden] { display: none; }
.approval-row.is-draggable { cursor: default; }
.approval-row.dragging { opacity: 0.55; border-style: dashed; }
.approval-list.saving { pointer-events: none; opacity: 0.7; }
.drag-handle-disabled { opacity: 0.35; cursor: not-allowed; }
.approval-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.approval-form-name { font-size: 14px; font-weight: 700; color: var(--text); }
.approval-form-no { margin-top: 4px; font-size: 12px; color: var(--muted); }
.approval-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; position: relative; }
.approval-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.approval-switch-track { position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; background: #d8dde5; transition: background .18s ease; }
.approval-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .22); transition: transform .18s ease; }
.approval-switch input:checked + .approval-switch-track { background: var(--brand); }
.approval-switch input:checked + .approval-switch-track .approval-switch-thumb { transform: translateX(18px); }
.approval-switch input:focus-visible + .approval-switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.approval-switch-text { font-size: 13px; color: var(--text); white-space: nowrap; }
.approval-role-cell[hidden] { display: none; }
.approval-role-label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.approval-role-select { width: 100%; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.approval-role-note { margin-top: 5px; font-size: 12px; color: var(--muted); }
.approval-role-warning { margin-top: 5px; font-size: 12px; color: #b42318; }
.approval-action-cell { display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.approval-switch-cell { white-space: nowrap; }
.approval-action-cell .btn { white-space: nowrap; }
.approval-list-head { display: none; }
.approval-type-badge { display: inline-flex; align-items: center; padding: 2px 7px; margin-bottom: 6px; border-radius: 5px; font-size: 11px; line-height: 18px; font-weight: 600; }
.approval-type-badge.builtin { background: #e9f4f0; color: #1f6b5c; border: 1px solid #cfe5dd; }
.approval-type-badge.custom { background: #eef2f8; color: #40526d; border: 1px solid #d8e0ec; }
.approval-type-badge.warn { background: #fff4e5; color: #9a5b00; border: 1px solid #f2d3a3; }
.approval-status-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: #f1f3f6; color: #64748b; font-size: 12px; white-space: nowrap; }
.approval-status-pill.enabled { background: #e7f3ee; color: #1f6b5c; }
.approval-flow-summary { font-size: 13px; font-weight: 600; color: var(--text); }
.approval-flow-approvers { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.approval-clear { color: #a4382b; border-color: #e4c9c5; }
.approval-editor { display: flex; flex-direction: column; gap: 14px; }
.approval-editor-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.approval-editor-head strong { font-size: 15px; }
.approval-node-list { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.approval-node-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2, #f8fafb); padding: 12px; }
.approval-node-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.approval-node-remove { width: 26px; height: 26px; border: 1px solid #e4c9c5; border-radius: 6px; background: #fff; color: #a4382b; font-size: 16px; line-height: 1; cursor: pointer; }
.approval-node-fields { display: grid; grid-template-columns: 1fr 180px; gap: 10px; }
.approval-node-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.approval-node-fields input, .approval-node-fields select { min-height: 34px; padding: 5px 9px; font-size: 13px; }
.approval-node-approvers { margin-top: 10px; }
.approval-node-approver-label { margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.approval-member-grid { display: none; }
.approval-member-option { display: none; }
.approver-multi { position: relative; width: 100%; }
.approver-multi-trigger {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 5px 30px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.approver-placeholder { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.approver-placeholder[hidden] { display: none; }
.approver-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.approver-tags { display: flex; flex-wrap: wrap; gap: 4px; max-height: 48px; overflow: hidden; align-content: flex-start; }
.approver-tags[hidden] { display: none; }
.approver-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12px; line-height: 1.3; color: var(--text);
  white-space: nowrap;
}
.approver-tag button {
  width: 15px; height: 15px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: 13px; line-height: 15px; cursor: pointer;
}
.approver-tag button:hover { background: var(--line); color: var(--text); }
.approver-tag-more { cursor: pointer; color: var(--brand); background: #fff; }
.approver-multi-panel {
  position: absolute; z-index: 40;
  left: 0; top: calc(100% + 4px);
  width: 100%; min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.approver-multi-panel[hidden] { display: none; }
.approver-multi.drop-up .approver-multi-panel { top: auto; bottom: calc(100% + 4px); }
.approver-multi-search { padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.approver-multi-search input { width: 100%; min-height: 28px; padding: 5px 9px; font-size: 12.5px; }
.approver-multi-options { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow: auto; padding: 4px; }
.approver-option {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12.5px; color: var(--text);
  white-space: nowrap; cursor: pointer;
}
.approver-option:hover { background: var(--surface-2); }
.approver-option input { width: 14px; min-height: 14px; flex: 0 0 auto; accent-color: var(--brand); margin: 0; }
.approver-option[hidden] { display: none; }
.approval-editor-toolbar { display: flex; justify-content: flex-start; }
.approval-editor .form-actions { margin-top: 0; }
.approval-empty { padding: 44px 20px; text-align: center; }
.approval-empty-mark { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--brand); font-size: 24px; font-weight: 700; }
.approval-empty h2 { margin: 0 0 8px; font-size: 18px; }
.approval-empty p { margin: 0 0 8px; color: var(--muted); }
.approval-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.approval-search { width: 280px; max-width: 100%; }
.approval-search input { min-height: 36px; }
.approval-search-empty { padding: 36px 20px; text-align: center; }
.approval-search-empty h2 { margin: 0 0 8px; font-size: 16px; }
.approval-search-empty p { margin: 0; color: var(--muted); }
@media (max-width: 1199px) {
  .approval-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .approval-list { grid-template-columns: 1fr; }
  .approval-row { gap: 12px; padding: 14px; }
  .approval-card-head { flex-direction: column; }
  .approval-toolbar { justify-content: stretch; }
  .approval-search { width: 100%; }
  .approval-action-cell { justify-content: flex-start; }
  .approval-action-cell .btn { flex: 1 1 auto; }
  .approval-switch-cell { white-space: normal; }
  .approval-switch-text { font-size: 14px; }
  .approval-node-fields { grid-template-columns: 1fr; }
  .approval-node-list { max-height: none; }
  .approval-editor-head { flex-direction: column; }
  .approval-editor-dialog .modal { width: min(720px, 94vw); }
}

/* 超管后台：表单模板管理 */
.admin-table.admin-form-template-table { min-width: 860px; }
.form-template-status {
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.form-template-status.is-enabled:hover { border-color: #86efac; background: #dcfce7; }
.form-template-status.is-disabled { border-color: #fecaca; background: #fef2f2; color: #b42318; }
.form-template-status.is-disabled:hover { border-color: #fca5a5; background: #fee2e2; }
.admin-form-template-dialog { width: min(1000px, calc(100vw - 44px)); min-width: 0; height: auto; max-height: 85vh; }
.admin-form-template-dialog .modal-head-actions { min-height: 32px; align-items: center; }
.admin-form-template-dialog .modal-fullscreen { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 10px; }
.admin-form-template-dialog .modal-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 7px; font-size: 20px; }
.admin-form-template-dialog .modal-close:hover { color: var(--danger); background: #fff5f5; }
.admin-form-template-dialog .modal-body.form-template-modal-body { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-width: 0; padding: 0; overflow: hidden; }
.admin-form-template-dialog #form-template-error:empty { display: none; }
.admin-form-template-dialog #form-template-error { flex: 0 0 auto; padding: 14px 20px 0; }
.admin-form-template-dialog .form-template-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 10px; }
.admin-form-template-dialog #form-template-form { min-width: 0; }
.form-template-base { flex: 0 0 auto; align-content: start; }
.form-template-base .field span em,
.form-preview-field span em { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-designer { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: flex-start; }
.form-designer-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.form-designer-head h3 { margin: 0 0 3px; font-size: 15px; }
.form-designer-head p { margin: 6px 0 0; font-size: 12px; line-height: 1.78; }
.form-field-rows { display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 1px; }
.form-field-empty { flex: 1 1 auto; min-height: 100px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; padding: 18px; }
.form-field-empty[hidden] { display: none; }
.form-field-row {
  display: grid;
  grid-template-columns: 24px minmax(140px, 1.2fr) 170px 64px minmax(150px, 1fr) 64px;
  grid-template-rows: 52px auto;
  gap: 6px;
  align-items: stretch;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.form-field-row.is-dragging { opacity: .55; }
.form-field-row.is-drop-target { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(13, 148, 136, .16); }
.form-field-drag { align-self: stretch; grid-row: 1 / span 2; border: 1px dashed var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1; cursor: grab; touch-action: none; }
.form-field-drag:active { cursor: grabbing; }
.form-field-row .field span { font-size: 11px; }
.form-field-row .field { min-width: 0; }
.form-field-row .field input,
.form-field-row .field select,
.form-field-row .field textarea { font-size: 12px; min-height: 30px; padding: 3px 8px; }
.form-field-row .search-select > select { padding-right: 58px !important; }
.form-field-row .search-select-btn { height: 30px; right: 3px; padding: 0 5px; }
.form-field-required { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 52px; font-size: 12px; color: var(--text); white-space: nowrap; padding-bottom: 0; align-self: stretch; }
.form-field-required-check { width: 16px; min-height: 16px; height: 16px; padding: 0; accent-color: var(--brand); flex: 0 0 auto; }
.form-field-name-wrap,
.form-field-type-wrap,
.form-field-required,
.form-field-placeholder-wrap { grid-row: 1; align-self: stretch; }
.form-field-remove { grid-column: 6; grid-row: 1; align-self: center; }
.form-field-options-wrap { grid-column: 2 / -1; grid-row: 2; }
.form-field-options-wrap[hidden] { display: none; }
.form-actions { flex: 0 0 auto; }
.form-template-footer { margin-top: 0; padding: 12px 20px 14px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 18px rgba(15, 23, 42, .06); }
.admin-form-preview-dialog { width: min(760px, calc(100vw - 44px)); height: min(82vh, 780px); max-height: none; }
.form-preview-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; margin-bottom: 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.form-preview-fields { display: grid; gap: 14px; }
.form-preview-field { display: grid; gap: 6px; }
.form-preview-field span { font-size: 13px; font-weight: 600; color: var(--text); }
.form-preview-field input,
.form-preview-field select,
.form-preview-field textarea { width: 100%; background: #f8fafc; color: var(--muted); }
.form-preview-amount { display: grid; gap: 5px; }
.form-preview-amount small { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-preview-docno { width: 100%; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 13px; }

/* 客户业务单据页 */
.customer-template-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text);
}
.customer-template-bar .muted { font-size: 12px; }
.customer-table { width: 100%; min-width: 880px; border-collapse: separate; border-spacing: 0; table-layout: auto; }
.customer-table thead th.col-business-100 { width: 100px; min-width: 100px; }
.customer-table thead th.col-business-180 { width: 180px; min-width: 180px; }
.customer-dialog { width: min(920px, calc(100vw - 44px)); }
.customer-form { align-items: start; }
.business-reimburse-form .reimburse-project-field,
.business-reimburse-form .reimburse-amount-field {
  grid-column: span 1;
  min-width: 0;
  align-self: start;
}
.business-invoice-form .invoice-party-field,
.business-invoice-form .invoice-contract-field {
  grid-column: span 1;
  min-width: 0;
  align-self: start;
}
.business-invoice-form .invoice-party-field .search-select,
.business-invoice-form .invoice-contract-field .search-select,
.business-invoice-form .invoice-party-field select,
.business-invoice-form .invoice-contract-field select {
  width: 100%;
}
/* 销售合同 / 采购合同弹窗：12 栅格按行填满，标签与控件统一节奏。
   行1 编号4/名称8 → 行2 对方单位6/负责人6 → 行3 合同金额4/结算4/已收付4
   → 行4 关联项目6/期限6 → 行5 签订日期6/参与人6 → 备注12 → 附件12 */
.business-contract-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 16px;
}
.business-contract-form > .field { min-width: 0; align-self: start; }
/* 标签固定 20px 行高：无论带不带必填星号、是下拉还是只读，控件上边缘都在同一条线上 */
.business-contract-form .field > span {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}
/* 说明文字统一 12px，与标签、控件保持同一节奏 */
.business-contract-form .field > small,
.business-contract-form .field .customer-field-hint,
.business-contract-form .field .customer-field-foot {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}
.business-contract-form .contract-docno-field { grid-column: span 4; }
.business-contract-form .contract-name-field { grid-column: span 8; }
.business-contract-form .contract-party-field,
.business-contract-form .contract-owner-field { grid-column: span 6; }
.business-contract-form .contract-amount-field,
.business-contract-form .contract-settlement-field,
.business-contract-form .contract-payment-field { grid-column: span 4; }
.business-contract-form .contract-parent-field,
.business-contract-form .contract-term-field,
.business-contract-form .contract-date-field,
.business-contract-form .contract-participant-field,
.business-contract-form .contract-default-field { grid-column: span 6; }
.business-contract-form .contract-remark-field,
.business-contract-form .contract-attachment-field,
.business-contract-form .customer-form-actions { grid-column: 1 / -1; }
/* 控件统一 38px 高：原生输入、下拉、日期、期限、负责人、只读金额都对齐 */
.business-contract-form .field input:not([type="hidden"]),
.business-contract-form .field select,
.business-contract-form .date-range-trigger,
.business-contract-form .member-multi-trigger {
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}
.business-contract-form .field input[type="date"] { padding: 0 11px; }
.business-contract-form .business-readonly-field .readonly-value {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 14px;
}
.business-contract-form .business-readonly-field > small { margin-top: 4px; font-size: 12px; color: var(--muted); }
/* 供应商列的数据源说明与「查看供应商列表」纵向排在下方，不跨列 */
.business-contract-form .contract-party-field .customer-field-foot {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.business-contract-form .contract-remark-field textarea { min-height: 84px; }
@media (max-width: 768px) {
  .business-contract-form { grid-template-columns: 1fr; column-gap: 0; row-gap: 14px; }
  .business-contract-form .contract-docno-field,
  .business-contract-form .contract-name-field,
  .business-contract-form .contract-party-field,
  .business-contract-form .contract-owner-field,
  .business-contract-form .contract-term-field,
  .business-contract-form .contract-date-field,
  .business-contract-form .contract-parent-field,
  .business-contract-form .contract-amount-field,
  .business-contract-form .contract-settlement-field,
  .business-contract-form .contract-payment-field,
  .business-contract-form .contract-participant-field,
  .business-contract-form .contract-remark-field,
  .business-contract-form .contract-attachment-field,
  .business-contract-form .contract-default-field,
  .business-contract-form .customer-form-actions { grid-column: 1 / -1; }
  .business-contract-form .field input:not([type="hidden"]),
  .business-contract-form .field select,
  .business-contract-form .date-range-trigger,
  .business-contract-form .member-multi-trigger { height: auto; padding: 8px 11px; }
}
.customer-form .field input,
.customer-form .field select,
.customer-form .field textarea { width: 100%; }
.customer-docno {
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}
.customer-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 2px 0; }
.customer-checks .check-row { flex: 0 0 auto; white-space: nowrap; }
.member-multi-select { position: relative; width: 100%; }
.member-multi-trigger {
  width: 100%;
  min-height: 38px;
  padding: 7px 34px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.member-multi-trigger.has-value { color: var(--text); }
.member-multi-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.member-multi-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-multi-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.member-multi-panel {
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 4px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.member-multi-panel[hidden] { display: none; }
.member-multi-search { padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.member-multi-search input { width: 100%; min-height: 28px; padding: 5px 9px; font-size: 12.5px; }
.member-multi-panel .customer-checks {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 1px;
  min-width: 0;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
}
.member-multi-panel .check-row { width: 100%; max-width: 100%; min-width: 0; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.member-multi-panel .check-row span { overflow: hidden; text-overflow: ellipsis; }
.member-multi-panel .check-row:hover { background: var(--surface-2); }
.member-multi-panel .check-row[hidden] { display: none; }
.customer-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.customer-detail { display: grid; gap: 16px; }
.customer-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.customer-detail-meta strong { color: var(--text); }
.customer-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.customer-detail-field { display: grid; gap: 5px; min-width: 0; }
.customer-detail-field span { font-size: 13px; font-weight: 600; color: var(--text); }
.customer-detail-field div { min-height: 38px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.customer-date-range { display: flex; align-items: center; gap: 8px; }
.customer-date-range input { flex: 1 1 0; min-width: 0; }
.customer-date-range span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.customer-period-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.customer-period-field select { flex: 1 1 0; min-width: 0; }
.customer-period-field .customer-period-mode { flex: 0 0 96px; }
.customer-period-field .customer-period-year { flex: 0 0 112px; }
.customer-period-field small { flex-basis: 100%; margin-top: 2px; }
.customer-field-hint { display: block; margin-top: 5px; font-size: 12px; }
.customer-attachment-field { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.customer-attachment-list { display: grid; gap: 6px; }
.customer-attachment-empty { padding: 8px 2px; color: var(--muted); font-size: 12px; }
.customer-attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.customer-attachment-item.is-invalid { border-color: #fecaca; background: #fff7f7; }
.customer-attachment-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.customer-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.customer-attachment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 0 0 auto; }
.customer-attachment-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.customer-attachment-add small { font-size: 11px; }
.customer-detail-attachments { display: grid; gap: 5px; }
.customer-detail-attachments .customer-attachment-item { background: #fff; }
.join-mode-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 10px; background: var(--surface-2); margin-bottom: 14px; }
.join-mode-tab { flex: 1 1 0; min-height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.join-mode-tab:hover { color: var(--text); }
.join-mode-tab.is-active { border-color: var(--line); background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.join-mode-panel[hidden] { display: none; }
.join-team-form .alert { margin: 0 0 12px; }
.form-field-attachment-multiple-wrap,
.form-field-biz-category-wrap { grid-column: 4 / -1; grid-row: 2; }
.form-field-link-wrap { grid-column: 2 / -1; grid-row: 2; }
.form-field-period-wrap { grid-column: 2 / -1; grid-row: 2; }
.form-field-period-wrap[hidden],
.form-field-attachment-multiple-wrap[hidden],
.form-field-biz-category-wrap[hidden],
.form-field-link-wrap[hidden] { display: none; }
.form-field-period-line { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.form-field-period-wrap small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; }
.form-field-link-wrap .form-field-inline-check { white-space: normal; line-height: 1.35; }
.form-field-link-wrap small { display: block; font-size: 11px; }
.form-field-attachment-multiple-wrap span:first-child { display: block; margin-bottom: 4px; font-size: 11px; }
.form-field-inline-check { display: flex; align-items: center; gap: 6px; min-height: 32px; font-size: 12px; white-space: nowrap; }
.form-field-inline-check input { width: 16px; min-height: 16px; height: 16px; padding: 0; accent-color: var(--brand); }
.form-preview-range { display: flex; align-items: center; gap: 8px; }
.form-preview-range input { flex: 1 1 0; min-width: 0; }
.form-preview-range span { color: var(--muted); font-size: 12px; }
.form-preview-range small { display: block; width: 100%; color: var(--muted); font-size: 11px; }
.form-preview-period { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.form-preview-period select { flex: 1 1 0; min-width: 120px; }
.form-preview-period-modes { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.form-preview-period-modes span { padding: 3px 8px; border-radius: 6px; color: var(--muted); font-size: 12px; }
.form-preview-period-modes span:first-child { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.form-preview-period small { display: block; flex-basis: 100%; color: var(--muted); font-size: 11px; }
.form-preview-attachment { display: grid; gap: 6px; }
.form-preview-chip { display: inline-flex; width: fit-content; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; background: var(--surface-2); }
@media (max-width: 620px) {
  .customer-dialog { width: calc(100vw - 28px); }
  .customer-detail-grid { grid-template-columns: 1fr; }
  .customer-form-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 900px) {
  .form-field-row { grid-template-columns: 24px minmax(0, 1fr) 120px; }
  .form-field-drag { grid-row: 1 / span 3; }
  .form-field-name-wrap { grid-column: 2 / 3; grid-row: 1; }
  .form-field-type-wrap { grid-column: 3 / 4; grid-row: 1; }
  .form-field-required { grid-column: 2 / 3; grid-row: 2; }
  .form-field-placeholder-wrap { grid-column: 2 / -1; grid-row: 3; }
  .form-field-options-wrap { grid-column: 2 / -1; grid-row: 4; }
  .form-field-attachment-multiple-wrap,
  .form-field-biz-category-wrap { grid-column: 2 / -1; grid-row: 4; }
  .form-field-link-wrap { grid-column: 2 / -1; grid-row: 5; }
  .form-field-period-wrap { grid-column: 2 / -1; grid-row: 5; }
  .form-field-remove { grid-column: 3 / 4; grid-row: 2; justify-self: end; }
}
@media (max-width: 760px) {
  .admin-table.admin-form-template-table { min-width: 0; }
  .admin-form-template-table thead { display: none; }
  .admin-form-template-table,
  .admin-form-template-table tbody,
  .admin-form-template-table tr,
  .admin-form-template-table td { display: block; width: 100%; }
  .admin-form-template-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }
  .admin-form-template-table tbody tr:last-child { border-bottom: 0; }
  .admin-form-template-table tbody tr:nth-child(odd) { background: #FFFFFF; }
  .admin-form-template-table tbody tr:nth-child(even) { background: #FAFAFA; }
  .admin-form-template-table tbody tr > td { background: transparent; }
  @media (hover: hover) {
    .admin-form-template-table tbody tr:hover > td { background: transparent; }
  }
  .admin-form-template-table tbody tr:active { background: #E4EFEA; }
  .admin-form-template-table td { padding: 0; border: 0; white-space: normal; }
  .admin-form-template-table td:nth-child(1) { grid-column: 1 / -1; }
  .admin-form-template-table td:nth-child(2) { grid-column: 1; color: var(--muted); font-size: 12px; }
  .admin-form-template-table td:nth-child(3) { grid-column: 2; justify-self: end; }
  .admin-form-template-table td:nth-child(4) { grid-column: 1 / -1; font-size: 12px; }
  .admin-form-template-table td:nth-child(5) { grid-column: 1 / -1; margin-top: 4px; }
  .admin-form-template-table .admin-row-actions { justify-content: flex-start; }
  .admin-form-template-table tr td[colspan] { display: block; grid-column: 1 / -1; text-align: center; }
}
@media (max-width: 620px) {
  .form-field-row { grid-template-columns: 24px minmax(0, 1fr); }
  .form-field-drag { grid-row: 1 / span 6; }
  .form-field-name-wrap,
  .form-field-type-wrap,
  .form-field-required,
  .form-field-placeholder-wrap,
  .form-field-options-wrap,
  .form-field-period-wrap,
  .form-field-link-wrap,
  .form-field-remove { grid-column: 2 / 3; grid-row: auto; }
  .form-field-remove { justify-self: stretch; }
  .form-template-base { grid-template-columns: 1fr; }
  .form-template-base .span-2 { grid-column: span 1; }
  .admin-form-template-dialog { width: calc(100vw - 44px); max-width: calc(100vw - 44px); height: auto; max-height: 85vh; }
  .form-designer { min-width: 0; }
}

/* ===== 通用业务页面：统计卡、固定表头、固定操作列、H5 ===== */
.business-page-card { padding: 18px; overflow: hidden; }
.business-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.business-summary-card { border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 16px 18px; background: #fff; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.business-summary-card.primary { background: linear-gradient(135deg, #eff6ff, #f8fbff); border-color: #bfdbfe; }
.business-summary-card span { color: #64748b; font-size: 13px; }
.business-summary-card strong { font-size: 24px; line-height: 1.2; color: #0f172a; word-break: break-all; }
.business-summary-card small { color: #94a3b8; font-size: 12px; }
.business-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.business-search-row.invoice-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; width: 100%; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 2px; scrollbar-width: thin; }
.business-search-row.invoice-filter-row .business-search { flex: 0 1 380px; max-width: 380px; min-width: 260px; }
.business-search-row.invoice-filter-row .business-search input { flex: 1 1 auto; max-width: none; min-width: 120px; }
.invoice-tax-summary { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.invoice-tax-summary-title { color: #64748b; font-size: 13px; font-weight: 600; white-space: nowrap; }
.invoice-tax-summary-value { color: #1f5f38; font-size: 20px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.invoice-tax-field { display: flex; align-items: center; gap: 5px; color: #475569; font-size: 13px; white-space: nowrap; }
.invoice-tax-field select { min-width: 115px; max-width: 160px; }
.invoice-tax-field #invoice-tax-period-mode { min-width: 100px; max-width: 120px; }
.invoice-tax-field #invoice-tax-period-value { min-width: 105px; max-width: 135px; }
.business-search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.business-search { display: flex; align-items: center; gap: 8px; flex: 0 1 410px; max-width: 410px; min-width: 240px; }
.business-search input { flex: 0 1 230px; min-width: 140px; max-width: 230px; }
.business-search #ledger-account { flex: 0 0 200px; max-width: 200px; }
.business-toolbar select { min-width: 150px; max-width: 190px; }
.business-filter-active { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 8px 10px; margin: 0 0 12px; border: 1px solid #dbe5de; border-radius: 10px; background: #f4f9f5; }
.business-filter-badge { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; background: #e3f0e7; color: #256b3b; font-size: 12px; font-weight: 600; }
.business-filter-chip-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.business-filter-chip { padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid #dbe5de; color: #43524a; font-size: 12px; }
.customer-toolbar { margin: 0; padding: 18px 18px 14px; }
.advanced-filter-modal { width: min(880px, calc(100vw - 44px)); }
.advanced-filter-dialog-body { display: flex; flex-direction: column; gap: 12px; }
.advanced-filter-tip { color: var(--muted); font-size: 13px; }
.advanced-filter-rows { display: flex; flex-direction: column; gap: 10px; max-height: min(46vh, 420px); overflow: auto; padding-right: 2px; }
.advanced-filter-row { display: grid; grid-template-columns: minmax(150px, 1fr) 120px minmax(190px, 1.4fr) auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid #e4e9e5; border-radius: 10px; background: #fafcfb; }
.advanced-filter-row select, .advanced-filter-row input { width: 100%; min-width: 0; }
.advanced-filter-values { display: flex; align-items: center; gap: 6px; min-width: 0; }
.advanced-filter-values > * { flex: 1 1 0; min-width: 0; }
.advanced-filter-values .advanced-filter-sep { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.advanced-filter-tools { display: flex; align-items: center; gap: 10px; }
.advanced-filter-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; border-top: 1px solid #eef1ee; }

/* 通用多选下拉 */
.multi-select { position: relative; display: inline-flex; }
.multi-select-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.multi-select-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.multi-select-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 200px; max-width: 280px; padding: 8px; border: 1px solid #e4e9e5; border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(20, 40, 30, 0.14); }
.multi-select-options { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.multi-select-option { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.multi-select-option:hover { background: #f2f6f3; }
.multi-select-option input[type="checkbox"] { width: 14px; height: 14px; min-height: 0; margin: 0; flex: 0 0 auto; }
.multi-select-tools { display: flex; justify-content: flex-end; margin-top: 6px; padding-top: 6px; border-top: 1px solid #eef1ee; }

/* 高级筛选弹窗内多选 */
.advanced-filter-multi { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 200px; overflow: auto; padding: 6px; border: 1px solid #e4e9e5; border-radius: 8px; background: #fff; }
.advanced-filter-multi-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }

/* 出纳筛选弹窗 */
/* 出纳筛选弹窗：紧凑、按内容自适应 */
.cashier-filter-modal { width: min(720px, calc(100vw - 40px)); }
.cashier-filter-dialog { display: flex; flex-direction: column; gap: 10px; }
.cashier-filter-body { display: flex; flex-direction: column; gap: 10px; max-height: min(60vh, 520px); overflow: auto; padding-right: 2px; }
.cashier-filter-section { border: 1px solid #eef1ee; border-radius: 10px; padding: 8px 10px; }
.cashier-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cashier-filter-head h4 { margin: 0; font-size: 13px; }
.cf-group-clear { background: none; border: none; padding: 0; color: var(--primary); font-size: 12px; cursor: pointer; }
.cf-group-clear.is-disabled { color: var(--muted); cursor: not-allowed; }
.cashier-filter-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; max-height: 168px; overflow: auto; }
.cashier-filter-opt { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 4px; font-size: 13px; line-height: 1.3; cursor: pointer; border-radius: 7px; }
.cashier-filter-opt:hover { background: #f2f6f3; }
.cashier-filter-opt input { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; accent-color: var(--primary); }
.cf-opt-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cashier-filter-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid #eef1ee; }

/* 统一筛选面板：字段勾选 + 下拉多选（去字段卡片、加宽弹窗、更紧凑） */
.unified-filter-modal { width: min(345px, calc(100vw - 28px)); }
.unified-filter { display: flex; flex-direction: column; gap: 4px; }
.unified-filter-head { display: flex; align-items: center; justify-content: space-between; }
.unified-filter-body { display: flex; flex-direction: column; gap: 0; max-height: min(60vh, 520px); overflow: auto; }
.uf-empty { padding: 6px 2px; }
.uf-field { display: flex; align-items: center; gap: 4px; padding: 2px 2px; border-bottom: 1px solid #f1f3f1; }
.uf-field:last-child { border-bottom: none; }
.uf-field-head { display: flex; align-items: center; gap: 3px; font-size: 12px; cursor: pointer; flex: 0 0 auto; white-space: nowrap; max-width: 62%; }
.uf-field-head input { width: 12px; height: 12px; margin: 0; accent-color: var(--primary); }
.uf-field-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-select { position: relative; flex: 1 1 auto; min-width: 0; }
.uf-trigger { display: flex; align-items: center; gap: 3px; width: 100%; min-height: 18px; padding: 1px 4px; border: 1px solid #d7ddda; border-radius: 5px; background: #fff; cursor: pointer; }
.uf-tags { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.uf-placeholder { color: var(--muted); font-size: 12px; }
.uf-caret { color: var(--muted); flex: 0 0 auto; }
.uf-float { position: absolute; z-index: 1200; min-width: 200px; max-width: 360px; max-height: min(60vh, 360px); display: flex; flex-direction: column; gap: 4px; border: 1px solid #d7ddda; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 6px; }
.uf-float[hidden] { display: none; }
.uf-float .uf-options { max-height: min(46vh, 280px); }
.uf-search { width: 100%; padding: 2px 5px; border: 1px solid #d7ddda; border-radius: 4px; margin-bottom: 3px; font-size: 12px; }
.uf-options { display: flex; flex-direction: column; gap: 1px; max-height: 200px; overflow: auto; }
.uf-option { display: flex; align-items: center; gap: 4px; padding: 1px 2px; font-size: 12px; border-radius: 4px; cursor: pointer; }
.uf-option:hover { background: #f2f6f3; }
.uf-option input { width: 12px; height: 12px; margin: 0; accent-color: var(--primary); }
.uf-option-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-tag { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0 3px 0 5px; background: #eef4f0; border-radius: 4px; font-size: 11px; color: var(--primary); }
.uf-tag-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-tag-x { border: none; background: none; padding: 0 2px; color: var(--primary); cursor: pointer; font-size: 12px; line-height: 1; }
.business-table-shell { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.business-table-wrap { width: 100%; max-height: calc(100vh - 330px); overflow: auto; overscroll-behavior: contain; }
.business-table { width: 100%; min-width: 940px; border-collapse: separate; border-spacing: 0; table-layout: auto; background: #fff; }
.business-table th, .business-table td { white-space: nowrap; vertical-align: middle; }
.business-table thead th { position: sticky; top: 0; z-index: 4; background: #f8fafc; box-shadow: inset 0 -1px 0 #e2e8f0; }
.business-table thead th.col-business-100 { width: 100px; min-width: 100px; }
.business-table thead th.col-business-180 { width: 180px; min-width: 180px; }
.business-table thead .table-status-head { z-index: 6; }
.business-table thead .business-action-head { z-index: 7; }
/* 最右侧两列固定为「状态 | 操作」：宽度随内容自适应、不换行；状态列左边缘与操作列同款阴影。 */
.table-status-head, .table-status-cell,
.business-action-head, .business-action-cell {
  width: auto;
  min-width: max-content;
  white-space: nowrap;
  box-shadow: -8px 0 14px -12px rgba(15, 23, 42, .45);
}
/* 让状态列左侧相邻的数据列吸收表格余量，使「状态 | 操作」两列贴合内容宽度、不留空白。 */
.business-table thead th.col-grow,
.data-table thead th.col-grow,
.admin-table thead th.col-grow,
thead th.col-grow { width: 100%; }
/* PC 业务表格：状态列冻结在操作列左侧。 */
.business-table .table-status-head,
.business-table .table-status-cell {
  position: sticky;
  right: var(--action-width, 0px);
  background: #fff;
  z-index: 5;
}
.business-table .business-action-head,
.business-table .business-action-cell {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 6;
}
.business-table thead .table-status-head,
.business-table thead .business-action-head { background: #f8fafc; }
/* 客户列表操作列固定在最右侧：与业务表同一套 sticky 实现，仅作用于 .customer-table。
   宽度真正内容自适应：auto 表格布局下 width:1% + nowrap 使列压到按钮组内容最小宽度，
   按钮数量增减时列宽自动跟随，不写死 px。 */
.customer-table thead th.business-action-head,
.customer-table tbody td.business-action-cell {
  position: sticky;
  right: 0;
  z-index: 6;
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  text-align: left;
}
.customer-table thead th.business-action-head { background: #f8fafc; z-index: 7; }
/* 客户列表状态列：冻结在操作列左侧，与操作列同口径内容自适应，右偏移量取操作列实测宽度。 */
.customer-table thead th.table-status-head,
.customer-table tbody td.table-status-cell {
  position: sticky;
  right: var(--action-width, 0px);
  z-index: 5;
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  text-align: left;
}
.customer-table thead th.table-status-head { background: #f8fafc; z-index: 6; }
/* 客户操作列按钮组：inline-flex 按内容收缩，靠左、不换行；仅作用于客户表，不影响公共 .list-actions。 */
.customer-table tbody td.business-action-cell .list-actions {
  display: inline-flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}
/* 项目统计页「项目名称」列：取消强制不换行，长文本自动折行，仅作用于带标记的列。 */
.business-table tbody td.project-name-cell .project-name-text {
  max-width: 260px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 全站业务列表文本列通用换行类：与项目名称列同口径，公共 CSS 定义一次，各列表文本列挂载。
   可作用于单元格内 span，也可直接作用于 td；短内容仍单行，行高随内容自适应。 */
.col-long-text-wrap {
  max-width: 260px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 合同结算弹窗结算记录表：状态标签靠右，与操作列按钮组右边缘对齐；仅作用于该表。 */
.settlement-table-wrap .table-status-head,
.settlement-table-wrap .table-status-cell {
  text-align: right;
}
.settlement-table-wrap .table-status-cell .doc-status {
  margin-left: auto;
}
@media (max-width: 760px) {
  .table-status-head, .table-status-cell,
  .business-action-head, .business-action-cell {
    position: static;
    box-shadow: none;
  }
  .business-action-group, .admin-row-actions, .admin-admin-actions, .approval-action-cell { flex-wrap: wrap; }
}
.business-action-group { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.business-action-group .btn { padding: 5px 9px; }
@media (min-width: 761px) {
  .business-action-cell .business-action-group,
  .business-action-cell .list-actions,
  .business-action-cell .admin-row-actions,
  .business-action-cell .admin-admin-actions { flex-wrap: nowrap; }
}
/* 业务列表斑马纹：表头不参与，数据行按当前展示顺序交替；固定操作列同步底色。 */
.business-table tbody tr:nth-child(odd) td,
.customer-table tbody tr:nth-child(odd) td { background-color: #FFFFFF; }
.business-table tbody tr:nth-child(even) td,
.customer-table tbody tr:nth-child(even) td { background-color: #FAFAFA; }
@media (hover: hover) and (pointer: fine) {
  .business-table tbody tr:hover td,
  .customer-table tbody tr:hover td { background-color: #EDF4F1; }
}
@media (hover: none), (pointer: coarse) {
  .business-table tbody tr:active td,
  .customer-table tbody tr:active td { background-color: #E4EFEA; }
}
.doc-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.doc-status.status-pending { background: #fff7ed; color: #c2410c; }
.doc-status.status-progress { background: #ecfeff; color: #0e7490; }
.doc-status.status-completed { background: #ecfdf5; color: #047857; }
.doc-status.status-rejected { background: #fef2f2; color: #b91c1c; }
.doc-status.status-draft { background: #f1f5f9; color: #475569; }
.doc-status.status-canceled { background: #f1f5f9; color: #64748b; }
.business-empty { padding: 36px 20px; text-align: center; }
.business-empty strong { display: block; font-size: 16px; margin-bottom: 6px; }
.business-empty p { margin: 0; color: #64748b; }
.business-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.business-pager > div { display: flex; gap: 8px; }
.business-detail { display: flex; flex-direction: column; gap: 16px; }
.business-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: #475569; padding: 12px 14px; background: #f8fafc; border-radius: 10px; }
/* 出纳社保/个税只读弹窗：固定主体名称，下方保留员工明细。 */
.cashier-main-subject { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #cfe3da; border-radius: 10px; background: #f0f8f5; }
.cashier-main-subject-label { color: #64748b; font-size: 13px; }
.cashier-main-subject-name { font-size: 18px; color: #0f766e; letter-spacing: 1px; }
.business-detail-parent { display: flex; align-items: center; gap: 8px; }
.business-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.business-detail-field { border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px; min-width: 0; }
.business-detail-field > span { display: block; color: #64748b; font-size: 13px; margin-bottom: 4px; }
.business-detail-field > div { word-break: break-word; }
.business-detail-field small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; line-height: 1.5; }
.settlement-detail-field strong { color: var(--brand-dark, #0f766e); font-size: 15px; }
.th-subnote { display: block; margin-top: 2px; color: #94a3b8; font-size: 10px; font-weight: 400; line-height: 1.3; white-space: nowrap; }
.settlement-amount-cell small { display: block; margin-top: 2px; color: #94a3b8; font-size: 10px; font-weight: 400; line-height: 1.3; white-space: nowrap; }
.settlement-amount-value { font-variant-numeric: tabular-nums; }
.business-readonly-field .readonly-value { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; color: #0f766e; font-weight: 700; font-variant-numeric: tabular-nums; }
.business-readonly-field > small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; line-height: 1.5; }
.business-detail-block h3 { margin: 0 0 8px; font-size: 15px; }
.business-change-list { display: flex; flex-direction: column; gap: 8px; }
.business-change-item { border-left: 3px solid #bfdbfe; padding: 8px 12px; background: #f8fbff; border-radius: 6px; }
.business-detail-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.business-detail-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
.business-detail-tabs .tab-btn { padding: 6px 16px; border: none; background: transparent; cursor: pointer; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.business-detail-tabs .tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.change-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.change-orders-table th, .change-orders-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; text-align: left; }
.change-order-tag { display: inline-block; font-size: 12px; color: #b45309; background: #fef3c7; border-radius: 4px; padding: 1px 8px; }
.business-object-hint { color: #64748b; font-size: 13px; }
.business-dependency-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.settlement-panel { display: flex; flex-direction: column; gap: 16px; }
.settlement-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.settlement-summary .business-summary-card strong { font-size: 20px; line-height: 1.25; white-space: nowrap; word-break: normal; letter-spacing: -0.2px; }
.settlement-create { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; align-items: end; }
.settlement-create label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.settlement-create label span { font-size: 13px; color: #475569; }
.settlement-create button { height: 38px; }
.settlement-table-wrap { max-height: 360px; }
.settlement-hint { margin: 0; font-size: 12px; }
.settlement-create .settlement-remark-field { grid-column: span 2; }
.settlement-create .settlement-remark-field textarea { width: 100%; min-height: 76px; resize: vertical; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: 13px; }
.settlement-create .settlement-file-field small { color: #94a3b8; font-size: 11px; }
.settlement-detail { display: flex; flex-direction: column; gap: 16px; }
.settlement-detail-block { border-top: 1px solid #e2e8f0; padding-top: 12px; }
.settlement-detail-label { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #334155; }
.settlement-detail-actions { display: flex; justify-content: flex-end; border-top: 1px solid #e2e8f0; padding-top: 12px; margin-top: 4px; }
.installment-detail-block { margin-top: 14px; }
.installment-table-shell { width: 100%; overflow-x: auto; }
.installment-table { width: 100%; min-width: 0; table-layout: fixed; }
.installment-table th, .installment-table td { padding: 4px 6px; }
.installment-table .num { text-align: right; white-space: nowrap; }
.installment-time-head, .installment-time-cell { width: 140px; }
.installment-table th:nth-child(2), .installment-table td:nth-child(2),
.installment-table th:nth-child(3), .installment-table td:nth-child(3),
.installment-table th:nth-child(4), .installment-table td:nth-child(4) { width: 90px; }
.installment-time-cell { white-space: normal; word-break: break-word; }
.installment-time { font-size: 12px; line-height: 1.4; }
.installment-dir-head, .installment-dir-cell {
  width: 50px; min-width: 50px; text-align: center; white-space: nowrap;
}
.installment-money-head { white-space: normal; word-break: break-word; line-height: 1.3; }
.installment-state-head, .installment-state-cell {
  width: 68px; min-width: 68px; text-align: center; white-space: nowrap;
}
.installment-state-cell .doc-status { font-size: 12px; padding: 1px 5px; }
.installment-table th:nth-child(7), .installment-table td:nth-child(7) {
  min-width: 60px; text-align: right; white-space: nowrap;
  position: sticky; right: 0; background: #ffffff; z-index: 1;
}
.installment-table th:nth-child(7) { background: #f8fafc; z-index: 5; }
/* 已作废 / 已驳回的历史记录整行淡出，避免和待确认记录混成一片。 */
.installment-row-dead td { color: #94a3b8; background: #fafafa; }
.installment-row-dead td:nth-child(7) { background: #fafafa; }
.installment-action-cell .btn { padding: 3px 8px; }
.settlement-remark-text { white-space: normal; word-break: break-word; line-height: 1.7; color: #334155; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.settlement-attachment-list { display: flex; flex-direction: column; gap: 6px; }
.settlement-attachment { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #334155; text-decoration: none; font-size: 13px; }
.settlement-attachment span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settlement-attachment small { color: #94a3b8; flex: 0 0 auto; }
.settlement-attachment b { color: var(--brand); font-weight: 600; flex: 0 0 auto; }
.settlement-attachment-row { display: flex; align-items: center; gap: 8px; }
.settlement-attachment-row .settlement-attachment { flex: 1; min-width: 0; }
.settlement-attachment-row .btn { flex: 0 0 auto; }
.project-doc-cell { display: flex; align-items: center; gap: 7px; }
.project-expand-toggle { width: 22px; height: 22px; flex: 0 0 auto; padding: 0; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #475569; font-size: 13px; line-height: 1; cursor: pointer; }
.project-expand-toggle:hover { background: #f1f5f9; }
.project-summary-amount { color: transparent; }
.project-child-detail td { padding: 0 !important; background: #f8fafc !important; }
.project-child-panel { padding: 10px 14px 12px 34px; }
.project-child-table { width: 100%; border-collapse: collapse; table-layout: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.project-child-table th, .project-child-table td { padding: 8px 10px; font-size: 12px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.project-child-table thead th.col-business-100 { width: 100px; min-width: 100px; }
.project-child-table thead th.col-business-180 { width: 180px; min-width: 180px; }
.project-child-table th { background: #f1f5f9; color: #475569; font-weight: 600; text-align: left; }
.project-child-table tr:last-child td { border-bottom: 0; }
.project-child-table tbody tr:nth-child(odd) td { background: #ffffff; }
.project-child-table tbody tr:nth-child(even) td { background: #fafafa; }
.project-child-table tbody tr:hover td { background: #edf4f1; }
.project-child-indent { display: inline-block; width: 14px; height: 1px; margin-right: 6px; border-top: 1px solid #94a3b8; vertical-align: middle; }
.project-child-empty, .project-child-loading { padding: 10px 12px; font-size: 12px; }
/* 项目统计两张统计表内容很短、无需内部滚动：解除 wrap 高度限制与滚动捕获，
   滚轮事件直接冒泡给页面，不再出现悬浮表格时页面滚轮失效。仅作用于统计区，不影响业务列表。 */
.project-stats-area .business-table-shell { overflow: hidden; border-radius: 8px; margin-bottom: 12px; }
.project-stats-area .business-table-wrap { max-height: none; overflow: visible; overscroll-behavior: auto; }

/* 标题并入首列、全表居中、内块略深底色（浅灰绿同色系，外层大容器保持更浅）。 */
.project-table-title { font-weight: 700; font-size: 1.08em; white-space: nowrap; }
.project-stats-area .business-table th,
.project-stats-area .business-table td { text-align: center; }
.project-stats-area .business-table,
.project-stats-area .business-table-shell,
.project-stats-area .business-table-wrap,
.project-child-table { background-color: #edf1ee; }
.project-stats-area .business-table thead th,
.project-child-table thead tr th { background-color: #e3eae5; }
.project-stats-area .business-table tbody td { background-color: #edf1ee !important; }
.project-child-table tbody tr:nth-child(n) td { background-color: transparent; }
/* 子合同表状态/操作列固定最右，横向滚动始终可见（复用现有 sticky 类，仅在该面板补定位）。
   内容右对齐；表头补与其他表头一致的绿底、单元格补表体底色，sticky 滚动时不透底、无白块。 */
.project-child-table .table-status-head,
.project-child-table .table-status-cell { position: sticky; right: var(--action-width, 0px); z-index: 2; text-align: right; }
.project-child-table .business-action-head,
.project-child-table .business-action-cell { position: sticky; right: 0; z-index: 3; text-align: right; }
.project-child-panel .project-child-table thead th.table-status-head,
.project-child-panel .project-child-table thead th.business-action-head { background-color: #e3eae5; }
/* 合同明细表全部数据行统一为与状态/操作数据格一致的绿色 #edf1ee；
   用 !important 覆盖 .project-child-detail td 的 !important，作用域仅限本面板。 */
.project-child-panel .project-child-table tbody td { background-color: #edf1ee !important; }
/* 运行时 syncTableFreezeMetrics 会给状态列前一个 th（创建时间）动态加 col-grow 撑满余量；
   用更高优先级显式锁定该撑宽 th 为表头绿，保证整行绿色连续。作用域仅限本合同明细表，不影响其他页面 col-grow。 */
.project-child-table thead th.col-grow { background-color: #e3eae5; }
/* 操作列按钮组保持右对齐，不被居中规则影响。 */
.project-child-table .business-action-group { justify-content: flex-end; }
.approval-progress { display: flex; flex-direction: column; gap: 10px; }
.approval-progress-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-progress-nodes { display: flex; flex-direction: column; gap: 6px; }
.approval-progress-node { display: flex; flex-direction: column; gap: 3px; padding: 8px 11px; border: 1px solid #e2e8f0; border-left: 3px solid #cbd5e1; border-radius: 7px; background: #fff; font-size: 12px; }
.approval-progress-node strong { font-size: 13px; color: #334155; }
.approval-progress-node.active { border-left-color: var(--brand); background: #f3faf7; }
.approval-progress-node.done { border-left-color: #21a366; background: #f6fbf8; }
.approval-progress-node.waiting { opacity: .72; }
.approval-progress-actions { display: flex; flex-direction: column; gap: 6px; font-size: 12px; padding: 10px 0 0; border-top: 1px dashed #e2e8f0; }
.approval-progress-actions > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.text-danger { color: #b42318; font-weight: 600; }
.text-success { color: #1f6b5c; font-weight: 600; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-head h2 { margin: 0 0 3px; font-size: 17px; }
.section-head p { margin: 0; }
.business-doc-section-head { margin: 20px 2px 10px; }
.account-section { margin-bottom: 18px; }
.readonly-pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; }
.income-text { color: #047857; font-weight: 700; }
.expense-text { color: #b91c1c; font-weight: 700; }
.business-dependency-dialog p { margin: 0 0 10px; }
.cashier-account-select { min-width: 180px; height: 32px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 8px; background: #fff; font-size: 13px; }
.account-empty-hint { font-size: 12px; color: #b45309; line-height: 1.4; }
.account-empty-alert { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 8px; font-size: 13px; }
.account-flow-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.account-flow-dialog { width: min(1080px, calc(100vw - 44px)); }
.account-flow-summary div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.account-flow-summary span { font-size: 12px; color: #64748b; }
.account-flow-summary strong { font-size: 16px; }
@media (max-width: 760px) {
  .account-flow-summary { grid-template-columns: 1fr; }
  .business-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .business-summary-card { padding: 12px; }
  .business-summary-card strong { font-size: 18px; }
  .business-page-card { padding: 12px; }
  .customer-toolbar { padding: 12px; }
  .business-table-wrap { max-height: calc(100vh - 300px); }
  .business-table { min-width: 860px; }
  .business-action-head, .business-action-cell { min-width: max-content; }
  .cashier-table { min-width: 0; width: 100%; table-layout: fixed; }
  .cashier-table th:nth-child(2), .cashier-table td:nth-child(2),
  .cashier-table th:nth-child(3), .cashier-table td:nth-child(3),
  .cashier-table th:nth-child(7), .cashier-table td:nth-child(7) { display: none; }
  .cashier-table td:first-child { white-space: normal; }
  .cashier-table .cashier-account-select { width: 100%; min-width: 0; }
  .business-toolbar { align-items: stretch; }
  .business-search { flex: 1 1 100%; max-width: none; }
  .business-search input { flex: 1 1 auto; max-width: none; }
  .business-toolbar select { flex: 1 1 140px; max-width: none; }
  .advanced-filter-row { grid-template-columns: 1fr 1fr; }
  .advanced-filter-values { grid-column: 1 / -1; }
  .advanced-filter-row .btn-danger { justify-self: end; }
  .advanced-filter-modal { height: auto; max-height: 92vh; }
  .business-detail-grid { grid-template-columns: 1fr; }
  .settlement-summary { grid-template-columns: 1fr; }
  .settlement-create { grid-template-columns: 1fr; }
  .settlement-create .settlement-remark-field { grid-column: span 1; }
  .settlement-create button { width: 100%; }
  .business-detail-actions .btn { flex: 1 1 40%; }
}

/* ===== 下拉搜索与日期选择器增强 ===== */
.search-select { position: relative; display: block; width: 100%; min-width: 0; }
.search-select > select { padding-right: 58px !important; }
.search-select-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, .96);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.search-select-btn:hover { color: var(--brand); background: var(--surface-2); }
.search-select-glyph {
  position: relative;
  width: 11px;
  height: 11px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.search-select-glyph::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  right: -4px;
  bottom: -2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}
.search-select-label { white-space: nowrap; }
.team-switcher .search-select { display: inline-block; width: auto; max-width: 230px; }
.team-switcher .search-select > select { width: auto; min-width: 150px; }
.business-toolbar .search-select,
.business-search-row .search-select { display: inline-block; width: auto; max-width: 100%; }
.business-toolbar .search-select > select,
.business-search-row .search-select > select { min-width: 150px; }
.customer-period-field .search-select { flex: 1 1 0; width: auto; min-width: 0; }
.customer-period-field .search-select > select { width: 100%; }
.cashier-account-select { position: relative; }
.search-select-popover {
  position: fixed;
  z-index: 12000;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  overflow: hidden;
}
.search-select-popover.is-modal-scoped {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}
.search-select-popover.is-modal-scoped .search-select-popover-head {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: 0 0 auto;
  align-items: stretch;
}
.search-select-popover.is-modal-scoped .search-select-input {
  flex: 1 1 auto;
  min-width: 0;
}
.search-select-popover.is-modal-scoped .search-select-options {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}
.search-select-popover-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.search-select-input {
  min-height: 30px;
  height: 30px;
  padding: 4px 9px !important;
  font-size: 12px;
  border-radius: 7px !important;
}
.search-select-close {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.search-select-close:hover { color: var(--danger); background: #fff5f5; }
.search-select-options { max-height: 260px; overflow: auto; padding: 4px; }
.search-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.search-select-option:hover,
.search-select-option[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.search-select-check { color: var(--brand); font-weight: 700; }
.search-select-empty { padding: 14px 8px; color: var(--muted); font-size: 12px; text-align: center; }

.date-range-field { position: relative; }
.date-range-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.date-range-trigger:hover,
.date-range-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.date-range-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-range-value.is-empty { color: var(--muted); }
.date-range-caret {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
.date-range-popover {
  position: absolute;
  z-index: 80;
  left: 0;
  top: calc(100% + 6px);
  width: min(360px, 92vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}
.date-range-popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.date-range-popover-head strong { font-size: 13px; }
.date-range-close { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.date-range-close:hover { color: var(--danger); background: #fff5f5; }
.date-range-popover-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.date-range-calendar { width: 100%; }
.date-range-calendar .wb-dp { width: 100%; }

/* 通用中文月历（date-picker.js 渲染） */
.wb-dp-popover {
  position: fixed;
  z-index: 2100;
  width: 296px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .2);
}
.wb-dp { display: block; }
.wb-dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.wb-dp-quick-btn {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}
.wb-dp-quick-btn:hover { border-color: var(--brand); background: #fff; color: var(--brand); }
.wb-dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.wb-dp-title { font-size: 13px; font-weight: 600; color: var(--text); }
.wb-dp-nav {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.wb-dp-nav:hover { border-color: var(--line); background: #f8fafc; color: var(--brand); }
.wb-dp-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.wb-dp-week span { padding: 4px 0; text-align: center; font-size: 11px; color: var(--muted); }
.wb-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wb-dp-day {
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.wb-dp-day:hover { border-color: #cfe6e1; background: #eef6f4; }
.wb-dp-day.is-out { color: #b6c0bb; }
.wb-dp-day.is-today { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.wb-dp-day.is-in-range { background: #e8f4f1; color: var(--brand-dark); }
.wb-dp-day.is-start,
.wb-dp-day.is-end { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 600; }
.wb-dp-day.is-start:hover,
.wb-dp-day.is-end:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.wb-dp-day:disabled { border-color: transparent; background: transparent; color: #d6dcd8; cursor: not-allowed; }
.wb-dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f0;
}
.wb-dp-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.wb-dp-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.wb-dp-link { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; }
.wb-dp-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* 原生日期框的日历小图标隐藏，改由统一月历接管；右侧画一个日历图标作为提示 */
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; pointer-events: none; }
input[type="date"]::-webkit-inner-spin-button { display: none; }
input[type="date"] {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7280' stroke-width='1.4' stroke-linecap='round'%3E%3Crect x='2.2' y='3.3' width='11.6' height='10.3' rx='2'/%3E%3Cpath d='M2.2 6.6h11.6M5.4 1.9v2.5M10.6 1.9v2.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px 14px;
  padding-right: 28px;
}

@media (max-width: 760px) {
  .search-select-label { display: none; }
  .search-select > select { padding-right: 36px !important; }
  .search-select-btn { width: 30px; padding: 0 4px; }
  .date-range-popover { width: min(340px, calc(100vw - 24px)); }
  .wb-dp-popover { width: min(300px, calc(100vw - 16px)); }
}

.customer-field-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.customer-field-foot .customer-field-hint { margin: 0; min-width: 0; }
.bizref-jump-link { flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; cursor: pointer; text-decoration: underline; }
.bizref-jump-link:hover { color: var(--brand-dark); }

/* ===== 驳回弹窗与依赖拦截（z55 全站驳回统一改造） ===== */
.reject-comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
}
.reject-comment-form .form-error {
  margin: 6px 0 0;
  color: var(--danger, #d93025);
  font-size: 13px;
}
.btn-link {
  border: none;
  background: none;
  padding: 4px 2px;
  color: var(--primary, #2563eb);
  font-size: 14px;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
.reject-blocked-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  margin: 10px 0 4px;
}

/* ===== 顶部审批待办（z76 审批入口与待办弹窗） ===== */
.approval-todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(460px, 72vw);
}
.approval-todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.approval-todo-item:hover {
  border-color: var(--brand);
  background: #f8fafc;
}
.approval-todo-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.approval-todo-main strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approval-todo-main span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.approval-todo-sub {
  display: block;
}
.approval-todo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  font-size: 13px;
  white-space: nowrap;
}
/* 同一张单据驳回后重新提交：标出是第几次，避免同号单据堆在一起看不出差别。
   外层 div 占满一行（无底色），内层 inline-block 只包住文字，不会被 flex 拉伸成通栏。 */
.approval-repeat-row { display: block; width: 100%; }
.approval-repeat-tag {
  display: inline-block;
  width: auto;
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  white-space: nowrap;
}
.approval-form-actions {
  justify-content: flex-end;
  gap: 10px;
}

/* 审批详情弹窗内意见框：意见框在左自适应、按钮在右；窄屏自动换两行。 */
.approval-opinion-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.approval-opinion-input {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: #fff;
}
.approval-opinion-input:focus {
  outline: none;
  border-color: var(--brand);
}
.approval-opinion-invalid,
.approval-opinion-invalid:focus {
  border-color: var(--danger);
}
.approval-opinion-btns {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 640px) {
  .approval-opinion-bar {
    flex-wrap: wrap;
  }
  .approval-opinion-input {
    flex: 1 1 100%;
  }
  .approval-opinion-btns {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}

/* 弹窗内各级审批意见（只读）。 */
.approval-opinion-block {
  margin-top: 14px;
}
.approval-opinion-item + .approval-opinion-item {
  margin-top: 8px;
}
.approval-opinion-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 单据流程时间轴：默认展开，颜色仅引用系统变量，无硬编码色值。 */
.flow-timeline {
  margin-top: 14px;
}
.flow-round + .flow-round {
  margin-top: 14px;
}
.flow-round-head {
  font-weight: 600;
  margin-bottom: 8px;
}
.flow-round-reject .flow-round-head {
  color: var(--danger);
}
.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.flow-item {
  position: relative;
  padding: 0 0 14px 22px;
}
.flow-item:last-child {
  padding-bottom: 0;
}
.flow-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.flow-item:last-child::before {
  display: none;
}
.flow-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}
.flow-done {
  background: var(--ok);
}
.flow-active {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
.flow-waiting {
  background: var(--muted);
}
.flow-reject {
  background: var(--danger);
}
.flow-body {
  min-width: 0;
}
.flow-title {
  font-weight: 600;
}
.flow-action {
  margin-top: 4px;
}
.flow-hint {
  color: var(--amber);
}
@media (max-width: 640px) {
  .flow-item {
    padding-left: 20px;
  }
}
.approval-todo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* ===== 出纳确认弹窗（z77 申请-审批-确认链路） ===== */
.cashier-confirm-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  min-width: min(420px, 70vw);
}
.cashier-confirm-kv dt { color: var(--muted); font-size: 13px; }
.cashier-confirm-kv dd { margin: 0; font-size: 14px; }
.cashier-confirm-attachment { margin-top: 16px; }
.cashier-confirm-attachment-label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.cashier-confirm-file {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
}
.cashier-confirm-file-name { margin: 6px 0 0; font-size: 12px; }
/* 驳回重新提交：顶部只读驳回信息区 */
.reject-info-banner{background:#f6f8fb;border:1px solid #e2e8f0;border-left:3px solid #d9534f;border-radius:6px;padding:10px 12px;margin-bottom:14px}
.reject-info-title{font-weight:600;color:#b3403c;margin-bottom:6px}
.reject-info-row{display:flex;gap:10px;font-size:13px;line-height:1.7;color:#555}
.reject-info-row span{min-width:56px;color:#888}
.reject-info-row b{font-weight:500;color:#333;word-break:break-all}

/* ===== 报销借支核销面板 ===== */
.writeoff-panel{border:1px solid var(--line);border-radius:10px;background:#fafbfc;overflow:hidden}
.writeoff-header{display:flex;align-items:center;justify-content:space-between;padding:11px 14px;cursor:pointer;user-select:none}
.writeoff-title{font-weight:600;color:#333}
.writeoff-arrow{font-size:13px;color:var(--primary,#2563eb)}
.writeoff-body{padding:12px 14px 14px;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:12px}
.writeoff-body .field{display:flex;flex-direction:column;gap:6px}
.writeoff-body .field label{font-size:13px;color:#666}
.writeoff-body .field select,.writeoff-body .field input{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;font-size:14px}
.writeoff-info{grid-column:1 / -1;display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:10px 12px}
.writeoff-row{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#555}
.writeoff-row span{color:#888}
.writeoff-row b{font-weight:600;color:#333}
.writeoff-payable b{color:#b45309}
.writeoff-body .muted{grid-column:1 / -1}
.writeoff-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;margin-top:6px}
.writeoff-detail-block .writeoff-payable b{color:#b45309}
@media (max-width:640px){.writeoff-body,.writeoff-info,.writeoff-detail-grid{grid-template-columns:1fr}}

/* 出纳付款弹窗：未结清借支提示横幅与核销面板 */
.cashier-writeoff-banner{margin-bottom:12px;padding:10px 12px;border-radius:8px;background:#fffbeb;border:1px solid #fde68a;color:#b45309;font-size:13px;line-height:1.6;font-weight:600}
.cashier-writeoff-banner.is-hidden{display:none}
.cashier-writeoff-panel{margin-top:10px}
.cashier-writeoff-panel.is-hidden{display:none}
/* 表头上方独立汇总条：与表格列宽对齐（42% / 1fr / 1fr），只读、浅底强调 */
.cashier-writeoff-summary{display:grid;grid-template-columns:42% 1fr 1fr;align-items:center;background:#f1f5f9;border-radius:6px 6px 0 0;font-weight:700;color:#1f2937;font-size:13px}
.cashier-writeoff-summary-cell{padding:7px 8px}
.cashier-writeoff-summary-cell.num{text-align:right}
/* 紧凑三列表格：单据 / 剩余未还款 / 本次核销 */
.cashier-writeoff-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:fixed}
.cashier-writeoff-table th,.cashier-writeoff-table td{padding:6px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
.cashier-writeoff-table th{font-weight:600;color:#666;background:#f8fafc;text-align:left}
.cashier-writeoff-table th.num,.cashier-writeoff-table td.num{text-align:right}
.cashier-writeoff-table th:first-child,.cashier-writeoff-table td:first-child{width:42%}
.cashier-writeoff-sum-label{color:#64748b;font-weight:600;font-size:12px}
.cashier-writeoff-check{display:flex;align-items:center;gap:6px;font-weight:600;color:#333}
.cashier-writeoff-check input{width:15px;height:15px;flex:none}
.cashier-writeoff-amt-input{width:100%;padding:4px 8px;border:1px solid var(--line);border-radius:6px;background:#fff;font-size:13px;text-align:right}
.cashier-writeoff-amt-error{margin-top:3px;color:#dc2626;font-size:12px;font-weight:600;text-align:right;line-height:1.4}
.cashier-writeoff-amt-error.is-hidden{display:none}
.cashier-writeoff-payable-line{margin-top:8px;font-size:13px;color:#334155;text-align:right}
.cashier-writeoff-payable-line b{color:#0f766e}
.cashier-writeoff-emp-block{margin-top:10px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.cashier-writeoff-emp-head{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:8px 10px;background:#eef2f7;font-size:13px;color:#334155;border-bottom:1px solid var(--line)}
.cashier-writeoff-emp-name{font-weight:700;color:#0f172a}
.cashier-writeoff-emp-meta{color:#475569}
.cashier-writeoff-emp-meta b{color:#0f172a}
.cashier-writeoff-emp-sum{margin-left:auto;font-weight:700;color:#0f766e}
.cashier-writeoff-emp-block:last-child .cashier-writeoff-table tr:last-child td{border-bottom:0}
/* 迭代7：最低工资柔性黄字、核销行员工姓名标注 */
.cashier-writeoff-minwage{margin-top:8px;padding:8px 10px;border-radius:8px;background:#fffbeb;border:1px solid #fde68a;color:#b45309;font-size:12.5px;line-height:1.6}
.cashier-writeoff-minwage.is-hidden{display:none}
.cashier-writeoff-emp{margin-left:8px;padding:1px 7px;border-radius:10px;background:#eef2ff;color:#4338ca;font-size:12px;font-weight:600}
/* 审批弹窗：报销与核销明细只读区块、零元行标注 */
.reimbursement-writeoff-block{display:flex;flex-direction:column;gap:8px}
.reimbursement-kv{margin:0}
.reimbursement-no-writeoff{padding:6px 2px;font-size:13px}
.zero-pay-tag{display:inline-block;padding:2px 8px;border-radius:999px;background:#ecfeff;color:#0e7490;font-weight:700;font-size:12px;border:1px solid #a5f3fc}
.zero-pay-loans{margin-left:6px;color:#64748b;font-size:12px}
/* 申请弹窗：只读提交人、账户必选下拉 */
.cashier-apply-readonly .cashier-apply-submitter{padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#f8fafc;color:#333;font-size:14px}
#cashier-apply-account{width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;font-size:14px}
/* 出纳表合同/项目长文本：复用 col-long-text-wrap 换行口径，仅把最大宽度压到列声明值 180px */
.cashier-table a.cashier-col-180{display:block;max-width:180px}
/* 核销行生效/待生效标记 */
.writeoff-state-tag{display:inline-block;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid transparent}
.writeoff-state-tag.is-effective{background:#ecfdf5;color:#047857;border-color:#a7f3d0}
.writeoff-state-tag.is-pending{background:#fffbeb;color:#b45309;border-color:#fde68a}
/* 审批弹窗本次核销表：宽度内完整显示、不出现横向滚动条 */
.reimb-writeoff-shell{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}
.reimb-writeoff-table{width:100%;min-width:0;margin:0}
.reimb-writeoff-table th,.reimb-writeoff-table td{padding:8px 10px;white-space:normal;word-break:break-word;overflow-wrap:anywhere}
.reimb-writeoff-table td:nth-child(2),.reimb-writeoff-table td:nth-child(3){white-space:nowrap;text-align:right}
.reimb-writeoff-table th:nth-child(2),.reimb-writeoff-table th:nth-child(3){text-align:right}
/* 汇总区：标签列/数值列统一对齐，数值右对齐、小数点对齐 */
.reimb-summary-grid{margin-top:10px;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}
.reimb-summary-row{display:grid;grid-template-columns:minmax(110px,1fr) auto;align-items:baseline;gap:12px;padding:8px 12px}
.reimb-summary-row+.reimb-summary-row{border-top:1px solid #f1f5f9}
.reimb-summary-label{font-size:13px;font-weight:600;color:#475569}
.reimb-summary-value{font-size:14px;font-weight:600;color:#0f172a;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.reimb-summary-value.is-emphasis{color:#1d4ed8;font-weight:800}

/* 出纳顶部同排：紧凑金额卡 + 分类标签（仅展示层，不影响资金逻辑） */
.cashier-top-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;margin-bottom:14px}
.cashier-inline-amount{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border:1px solid #bfdbfe;border-radius:12px;background:linear-gradient(135deg,#eff6ff,#f8fbff);white-space:nowrap}
.cashier-inline-amount span{color:#64748b;font-size:13px}
.cashier-inline-amount strong{font-size:18px;line-height:1.2;color:#0f172a;font-variant-numeric:tabular-nums}
.cashier-top-bar .filter-tab-bar{flex:1 1 auto;margin-bottom:0;min-width:0}
.filter-tab-bar{display:flex;flex-wrap:wrap;gap:8px}
.filter-tab{position:relative;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid var(--border,#e5e7eb);border-radius:999px;background:#fff;color:#475569;font-size:13px;cursor:pointer;transition:all .15s ease}
.filter-tab:hover{border-color:#93c5fd;color:#1d4ed8}
.filter-tab.is-active{background:#2563eb;border-color:#2563eb;color:#fff}
.filter-tab-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--danger);color:#fff;font-size:11px;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}
.filter-tab.is-active .filter-tab-badge{background:rgba(255,255,255,.28)}
.cashier-nav-badge{margin-left:6px}

/* 工资表编辑器：列宽随内容自适应、不截断；金额右对齐；新增列按钮固定容器右侧不随横向滚动 */
.payroll-toolbar{display:flex;align-items:center;gap:8px;padding:10px 12px;flex-wrap:wrap}
.payroll-col-tags{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.payroll-col-add{margin-left:auto;flex-shrink:0}
/* 自动布局：表头与单元格不换行，列宽按表头文字与输入框内容自适应，内容完整不被裁切 */
.payroll-editor-table th,.payroll-editor-table td{white-space:nowrap}
.payroll-editor-table th.pay-seq,.payroll-editor-table td.pay-seq{text-align:center}
.payroll-editor-table .pay-input,.payroll-editor-table .pay-readonly{min-width:84px;box-sizing:border-box;text-align:right}
.payroll-editor-table .pay-readonly{background:#f5f5f5;color:#666;cursor:default}
/* 去掉数字输入框自带上下步进箭头，仅保留纯文本输入外观 */
.payroll-editor-table input[type="number"]{-webkit-appearance:none;-moz-appearance:none;appearance:none}
.payroll-editor-table input[type="number"]::-webkit-inner-spin-button,
.payroll-editor-table input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
@media (max-width:640px){.payroll-col-add{margin-left:0}}

/* 左右双向冻结：左侧 序号/员工/关联项目/账面实发 四列，右侧 操作 一列；阴影分隔，滚动持续可见 */
.payroll-editor-table th.pay-seq,.payroll-editor-table td.pay-seq{
  position:sticky;left:0;width:46px;min-width:46px;z-index:3;background:#fff}
.payroll-editor-table th.pay-emp,.payroll-editor-table td.pay-emp{
  position:sticky;left:46px;width:92px;min-width:92px;z-index:3;background:#fff}
.payroll-editor-table th.pay-proj,.payroll-editor-table td.pay-proj{
  position:sticky;left:138px;width:144px;min-width:144px;max-width:144px;z-index:3;
  background:#fff;overflow:hidden}
.payroll-editor-table th.pay-net,.payroll-editor-table td.pay-net{
  position:sticky;left:282px;width:111px;min-width:111px;z-index:3;background:#fff;
  box-shadow:6px 0 8px -6px rgba(0,0,0,0.28)}
/* 社保编辑器无“关联项目”列，账面实缴紧跟员工（46+92=138），避免按四列口径留出空挡 */
.payroll-editor-table.social-editor-table th.pay-net,
.payroll-editor-table.social-editor-table td.pay-net{left:138px}
.payroll-editor-table th.col-actions,.payroll-editor-table td.col-actions{
  position:sticky;right:0;width:74px;min-width:74px;z-index:3;background:#fff;
  box-shadow:-6px 0 8px -6px rgba(0,0,0,0.28)}
/* 冻结列表头必须与其余表头同色（统一 #f8fafc），否则整行表头会出现深浅断层 */
.payroll-editor-table thead th.pay-seq,.payroll-editor-table thead th.pay-emp,
.payroll-editor-table thead th.pay-proj,.payroll-editor-table thead th.pay-net,
.payroll-editor-table thead th.col-actions{z-index:5;background:#f8fafc}
/* 员工列：文字区完整显示 4 个汉字（13px*4=52），箭头与左右内边距额外预留，固定 92px 不随内容撑长 */
.payroll-editor-table .pay-emp select{width:92px;min-width:0;max-width:92px;box-sizing:border-box}
/* 关联项目列：文字区完整显示 8 个汉字（13px*8=104），固定 144px；超出省略号，完整名称由 title 悬浮提示 */
.payroll-editor-table .pay-proj select{
  width:144px;min-width:0;max-width:144px;box-sizing:border-box;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.payroll-editor-table td.pay-proj{text-overflow:ellipsis}

/* 表头信息区：月份/项目/备注 同一行；月份+项目占左半 50%，备注占右半 50%，三项等高对齐 */
.payroll-meta-grid{
  display:grid;gap:14px;grid-template-columns:1fr 1fr 2fr;align-items:end}
.payroll-meta-grid label{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0}
.payroll-meta-grid input,.payroll-meta-grid select{width:100%;box-sizing:border-box;height:36px}
.payroll-meta-grid #draft-remark{resize:none;white-space:nowrap;overflow:hidden}
@media(max-width:640px){
  .payroll-meta-grid{grid-template-columns:1fr}
  .payroll-meta-grid #draft-remark{white-space:normal}
}

/* 自定义月份选择器 */
.month-picker{position:relative}
.month-picker #draft-month{cursor:pointer;background:#fff}
.month-panel{
  display:none;position:absolute;z-index:30;top:calc(100% + 4px);left:0;width:264px;
  background:#fff;border:1px solid #e3e3e3;border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.14);padding:10px}
.month-panel.open{display:block}
.month-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.month-panel-head span{font-weight:600;font-size:14px}
.mp-year-btn{
  width:30px;height:30px;border:1px solid #e3e3e3;border-radius:6px;background:#fff;
  font-size:16px;line-height:1;cursor:pointer;color:#333}
.mp-year-btn:hover{border-color:#1677ff;color:#1677ff}
.mp-month-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.mp-month{
  height:32px;border:1px solid #eee;border-radius:6px;background:#fafafa;
  font-size:13px;cursor:pointer;color:#333}
.mp-month:hover{border-color:#1677ff;color:#1677ff}
.mp-month.mp-selected{background:#1677ff;border-color:#1677ff;color:#fff}

/* 工资表列表筛选条：同行、左对齐、统一间距，不影响其他页面 */
.filter-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:10px;margin-bottom:14px}
.filter-bar input[type="search"]{width:220px;max-width:40vw;flex:0 0 auto}
.filter-bar input[type="month"]{width:150px;flex:0 0 auto}
.filter-bar .btn{flex:0 0 auto;white-space:nowrap}
@media(max-width:640px){.filter-bar{flex-wrap:wrap}.filter-bar input[type="search"]{width:100%;max-width:none}}
/* 核销区员工下拉字段 */
.cashier-writeoff-emp-field{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.cashier-writeoff-emp-field select{height:34px;padding:4px 8px}
/* 审批弹窗工资核销分组（只读） */
.payroll-writeoff-groups{display:flex;flex-direction:column;gap:12px}
.payroll-writeoff-group-title{font-size:13px;color:#333;margin-bottom:6px;font-weight:600}
.payroll-writeoff-table{width:100%;font-size:13px}
.payroll-writeoff-table th,.payroll-writeoff-table td{padding:6px 8px}

/* ============ 工作台角色看板（wb-*）：只读看板，flex/grid 与百分比布局，不写固定 px 宽度 ============ */
.wb-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-bottom:16px}
.wb-board-title{font-size:20px;font-weight:800;color:var(--ink);margin:0}
.wb-dropdown{display:flex;align-items:center;gap:8px}
.wb-dropdown-label{color:var(--muted);font-weight:600;white-space:nowrap}
.wb-select{min-width:10em}
/* 快速新增：右侧文字按钮 + 自定义下拉；面板宽度自适应最长选项，名称完整不截断、不滚动裁切 */
.wb-quick{position:relative;flex:0 0 auto}
.wb-quick-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;width:max-content;min-width:12em;
  background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.12);
  padding:6px;display:flex;flex-direction:column}
.wb-quick-item{border:0;background:#fff;text-align:left;border-radius:8px;padding:8px 10px;
  color:var(--ink);min-height:0;white-space:nowrap}
.wb-quick-item:hover{background:var(--brand-soft);color:var(--brand-dark)}
.wb-quick-empty{padding:8px 10px;color:var(--muted);font-size:13px;white-space:nowrap}

/* 标题角色切换下拉 */
.wb-role{position:relative;flex:0 1 auto;min-width:0}
.wb-role-btn{border:0;background:transparent;font-size:20px;font-weight:800;color:var(--ink);
  padding:0;display:inline-flex;align-items:center;gap:6px;min-height:0}
.wb-caret{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;
  border-top:6px solid var(--muted)}
.wb-role-menu{position:absolute;left:0;top:calc(100% + 6px);z-index:20;width:max-content;min-width:10em;
  background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.12);
  padding:6px;display:flex;flex-direction:column}
.wb-role-item{border:0;background:#fff;text-align:left;border-radius:8px;padding:8px 10px;
  color:var(--ink);min-height:0;white-space:nowrap}
.wb-role-item:hover{background:var(--brand-soft);color:var(--brand-dark)}
.wb-role-empty{padding:8px 10px;color:var(--muted);font-size:13px;white-space:nowrap}
/* 修复：display:flex 类规则会覆盖 hidden 属性，显式让 hidden 菜单收起，杜绝常驻/重叠 */
.wb-role-menu[hidden],.wb-quick-menu[hidden]{display:none}
.wb-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,22em);gap:16px;align-items:start}
.wb-main{display:flex;flex-direction:column;gap:16px;min-width:0}
.wb-side{display:flex;flex-direction:column;gap:16px;min-width:0}
@media(max-width:960px){.wb-layout{grid-template-columns:minmax(0,1fr)}}
.wb-card{margin:0}
.wb-half-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
@media(max-width:760px){.wb-half-grid{grid-template-columns:minmax(0,1fr)}}

/* 月/季/年筛选 */
.wb-period{display:inline-flex;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.wb-period-btn{border:0;background:#fff;color:var(--muted);padding:6px 14px;min-height:auto;border-radius:0}
.wb-period-btn + .wb-period-btn{border-left:1px solid var(--line)}
.wb-period-btn.active{background:var(--brand);color:#fff}
.wb-period-btn:not(.active):hover{background:var(--brand-soft);color:var(--brand-dark)}

/* 资金情况 */
.wb-fund-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media(max-width:640px){.wb-fund-grid{grid-template-columns:minmax(0,1fr)}}
.wb-fund-box{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--surface-2);display:flex;flex-direction:column;gap:8px}
.wb-fund-balance{background:var(--brand-soft);border-color:var(--brand)}
.wb-fund-label{color:var(--muted);font-size:13px}
.wb-fund-value{font-size:18px;font-weight:700;color:var(--brand-dark);word-break:break-all}
.wb-income{color:var(--ok)}
.wb-expense{color:var(--ink)}

/* 利润表分组行 */
.wb-profit-table{width:100%}
.wb-group-row td{background:var(--brand-soft);font-weight:700;color:var(--brand-dark)}

/* 借款无往来口径的横杠 */
.wb-dash{color:var(--muted)}

/* 业绩柱状图：柱体高度为百分比，无第三方图表依赖 */
.wb-chart{display:flex;align-items:flex-end;gap:12px;min-height:16em;padding-top:10px;overflow-x:auto}
.wb-chart-col{flex:1 1 0;min-width:5em;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;height:16em}
.wb-chart-bar{width:60%;max-width:3.5em;border-radius:8px 8px 0 0;background:linear-gradient(180deg,var(--brand) 0%,var(--brand-dark) 100%)}
.wb-chart-name{font-size:13px;color:var(--ink);text-align:center;word-break:break-all}
.wb-chart-amount{font-size:12px;color:var(--muted);text-align:center;word-break:break-all}

/* 签单排行 TOP3：金色仅用于排行，不使用橙色 */
.wb-ranking{display:flex;flex-direction:column;gap:10px}
.wb-rank-item{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:12px;padding:10px 14px;background:var(--surface-2)}
.wb-rank-no{flex:0 0 auto;font-weight:800;color:#92660b;background:#f6e7bd;border-radius:999px;padding:2px 10px;font-size:13px}
.wb-rank-1{background:#fbf3dc;border-color:#e3cd8f}
.wb-rank-1 .wb-rank-no{background:linear-gradient(180deg,#e8c567,#caa144);color:#fff}
.wb-rank-rest{display:flex;flex-direction:column;gap:10px}
.wb-rank-name{flex:1 1 auto;font-weight:600;word-break:break-all}
.wb-rank-amount{flex:0 0 auto;color:var(--brand-dark);font-weight:700}

/* 右侧竖栏列表 */
.wb-list{display:flex;flex-direction:column}
.wb-list-row{display:flex;flex-direction:column;gap:2px;padding:10px 4px;border-radius:10px;color:var(--ink)}
.wb-list-row + .wb-list-row{border-top:1px solid var(--line)}
.wb-list-row:hover{background:var(--brand-soft);text-decoration:none}
.wb-list-title{font-weight:600;word-break:break-all}
.wb-list-sub{font-size:12px;color:var(--muted);word-break:break-all}

/* ===== 看板补充：表格收纳、利润横表、业绩时序、右侧固定高度内滚动 ===== */
.wb-card-body{min-width:0}
/* 表格统一收纳在卡片内，窄屏仅容器内部横向滚动，不撑破卡片边界 */
.wb-table-wrap{width:100%;min-width:0;overflow-x:auto}
.wb-table-wrap .business-table{width:100%}

/* 借款/发票/合同 compact：固定布局，列宽由表格均分，表头与金额逐列垂直对齐，禁止横向滚动 */
.wb-table-wrap .business-table.wb-compact{min-width:0;table-layout:fixed}
.wb-compact th,.wb-compact td{white-space:normal;word-break:break-word;line-height:1.3;
  font-size:12px;padding:6px 4px;text-align:center;box-sizing:border-box}
.wb-half-grid .wb-table-wrap{overflow-x:visible}

/* 利润两层分组表头：四个指标与分组合计统一绿色表头；合计名称与金额同一行 */
.wb-profit-horizontal.wb-compact,
.wb-table-wrap .business-table.wb-profit-horizontal{min-width:0}
.wb-profit-horizontal .wb-lead-head{background:var(--brand-soft);color:var(--brand-dark);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 第二行分项表头同样绿色，全表表头视觉统一，无白底残留 */
.wb-profit-horizontal .wb-sub-head{background:var(--brand-soft);color:var(--brand-dark)}
.wb-profit-horizontal tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wb-profit-horizontal .wb-group-head{background:var(--brand-soft);color:var(--brand-dark);
  text-align:center;vertical-align:middle;white-space:nowrap;
  border-bottom:1px solid var(--line)}
/* 两条竖向分界线：复用现有边框色，表头与数据行贯通 */
.wb-sep{border-left:1px solid var(--line)}
.wb-group-name,.wb-group-value{display:inline}
.wb-group-value{font-weight:700;margin-left:6px}

/* 业绩时序：顶部总金额，下方柱图+数轴；纯div，柱高为百分比，无第三方图表库 */
.wb-perf-total{margin-bottom:10px;font-weight:600;color:var(--brand-dark)}
.wb-perf-chart{display:flex;flex-direction:column;min-width:0}
.wb-perf-track{display:flex;align-items:flex-end;gap:10px;height:16em;padding-top:10px;
  border-bottom:2px solid var(--brand);overflow-x:auto}
.wb-perf-col{flex:1 1 0;min-width:4.5em;display:flex;flex-direction:column;align-items:center;
  justify-content:flex-end;gap:6px;height:100%}
.wb-perf-amount{font-size:12px;color:var(--muted);text-align:center;white-space:nowrap}
.wb-perf-bar{width:55%;max-width:3em;border-radius:8px 8px 0 0;
  background:linear-gradient(180deg,var(--brand) 0%,var(--brand-dark) 100%)}
.wb-perf-axis{display:flex;gap:10px;padding-top:6px}
.wb-perf-label{flex:1 1 0;min-width:4.5em;text-align:center;font-size:13px;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 右侧三卡：卡片高度固定为 5 行，内容超出仅在卡片内部竖向滚动 */
.wb-side-card{display:flex;flex-direction:column}
.wb-side-body{flex:1 1 auto;max-height:calc(2.6em * 5);overflow-y:auto;min-width:0}
/* 条目编号与备注强制同一行不换行，超长省略，不把卡片撑高；每行固定高度便于按 5 行收口 */
.wb-side-row{display:flex;align-items:center;gap:8px;height:2.6em;padding:0 4px;border-radius:8px;
  box-sizing:border-box;color:var(--ink);white-space:nowrap;overflow:hidden}
.wb-side-row + .wb-side-row{border-top:1px solid var(--line)}
.wb-side-row:hover{background:var(--brand-soft);text-decoration:none}
.wb-side-title{flex:0 1 auto;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wb-side-sub{flex:1 1 auto;font-size:12px;color:var(--muted);overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
/* 逾期与风险 · 项目超预算条目：已超红、接近预算黄；左侧竖条做类型区分，不影响行高 */
.wb-side-row.wb-side-risk{position:relative;padding-left:10px}
.wb-side-row.wb-side-risk::before{content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:1.4em;border-radius:2px}
.wb-side-row.wb-side-risk .wb-side-title{max-width:38%}
.wb-side-row.is-over::before{background:var(--danger)}
.wb-side-row.is-over .wb-side-sub{color:var(--danger);font-weight:600}
.wb-side-row.is-near::before{background:var(--amber)}
.wb-side-row.is-near .wb-side-sub{color:var(--amber);font-weight:600}

/* ===== 帮助中心：超管管理 + 租户只读预览 ===== */
/* 超管列表状态徽标 */
.help-status{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600}
.help-status-on{background:var(--brand-soft);color:var(--brand-dark)}
.help-status-off{background:#f1f2f4;color:var(--muted)}

/* 超管编辑弹窗：多图上传区 */
.help-uploader{margin-top:14px;border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--surface-2)}
.help-uploader-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.help-uploader-head h3{margin:0;font-size:15px}
.help-uploader-hint{margin:8px 0 12px;font-size:12px}
.help-thumb-list{display:flex;flex-wrap:wrap;gap:12px}
.help-thumb{position:relative;width:120px;height:120px;border-radius:10px;border:1px solid var(--line);overflow:hidden;
  background:#fff;cursor:grab;user-select:none}
.help-thumb img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.help-thumb.is-dragging{opacity:.45}
.help-thumb.is-drop-target{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.help-thumb-remove{position:absolute;top:4px;right:4px;width:22px;height:22px;border:none;border-radius:50%;
  background:rgba(229,72,77,.92);color:#fff;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.help-thumb-index{position:absolute;left:6px;bottom:4px;font-size:11px;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.6)}
.help-thumb-empty{color:var(--muted);font-size:13px;padding:10px 0}
.admin-help-dialog{width:720px;max-width:calc(100vw - 32px)}

/* 租户端帮助中心标题列表 */
.help-center-list{display:flex;flex-direction:column;gap:8px;min-width:320px}
.help-center-title{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;
  padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);
  font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;text-align:left}
.help-center-title:hover{border-color:var(--brand);background:var(--brand-soft)}
.help-center-arrow{font-size:18px;color:var(--muted)}

/* 租户端图片预览：弹窗与舞台均固定尺寸，不随图片拉伸 */
.help-preview-dialog{width:880px;max-width:calc(100vw - 24px);height:640px;max-height:calc(100vh - 24px);
  display:flex;flex-direction:column}
.help-preview-stage{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:#1d1f23;
  display:flex;align-items:center;justify-content:center}
.help-preview-stage img{max-width:100%;max-height:100%;transform-origin:center center;cursor:grab;
  will-change:transform;user-select:none}
.help-preview-stage img.is-grabbing{cursor:grabbing}
.help-preview-hint{position:absolute;left:12px;bottom:10px;font-size:12px;color:rgba(255,255,255,.65);
  pointer-events:none}
.help-preview-foot{display:flex;align-items:center;justify-content:center;gap:16px;padding:12px;border-top:1px solid var(--line)}
.help-preview-page{font-size:13px;font-weight:600;color:var(--ink);min-width:48px;text-align:center}
/* 预览弹窗全屏按钮：与关闭按钮风格统一 */
.modal-fullscreen-btn{border:1px solid var(--line);background:var(--surface-2);color:var(--ink);
  border-radius:8px;padding:4px 12px;font-size:13px;cursor:pointer}
.modal-fullscreen-btn:hover{border-color:var(--brand);background:var(--brand-soft)}
/* 原生全屏：弹窗铺满整个屏幕，缩放/拖拽/切换能力不变，状态由同一 DOM 保留 */
.help-preview-dialog:fullscreen{width:100%;height:100%;max-width:none;max-height:none;border-radius:0}
.help-preview-dialog:fullscreen .help-preview-stage{background:#1d1f23}
@media(max-width:640px){
  .help-preview-dialog{width:calc(100vw - 16px);height:70vh}
  .help-thumb{width:96px;height:96px}
}

/* 白名单导出按钮挂载容器：在搜索栏内靠右，不改动原有控件与样式 */
.export-trigger-holder { margin-left: auto; display: flex; align-items: center; flex-shrink: 0; }