:root {
  --bg0: #eef6f3;
  --bg1: #e8f2f8;
  --surface: #ffffff;
  --line: rgba(28, 70, 62, 0.10);
  --text: #1a2f2a;
  --muted: #5f7a72;
  --accent: #1f8f7a;
  --accent-soft: rgba(31, 143, 122, 0.12);
  --warn: #c47a3a;
  --danger: #c45b66;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(30, 70, 60, 0.07);
  --el-color-primary: #1f8f7a;
  --el-color-primary-light-3: #4da894;
  --el-color-primary-light-5: #7ac0b1;
  --el-color-primary-light-7: #a7d7cd;
  --el-color-primary-light-8: #bfe3db;
  --el-color-primary-light-9: #d7efe9;
  --el-color-primary-dark-2: #197261;
  --el-border-radius-base: 10px;
  --el-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-family: var(--el-font-family);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(920px 420px at 0% 0%, rgba(90, 180, 160, 0.22), transparent 55%),
    radial-gradient(780px 380px at 100% 8%, rgba(120, 180, 210, 0.18), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 60%, #f6fbf9);
}
#app { min-height: 100vh; }
[v-cloak] { display: none !important; }

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.mb { margin-bottom: 12px; }
.data-table tbody tr.clickable-row { cursor: pointer; }
.data-table tbody tr.clickable-row:hover { background: var(--surface-2, rgba(0,0,0,.03)); }
.mt { margin-top: 12px; }

/* ---- login ---- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 24px;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 360px at 15% 20%, rgba(70, 170, 150, 0.22), transparent 60%),
    radial-gradient(640px 320px at 85% 75%, rgba(110, 170, 200, 0.18), transparent 55%);
  pointer-events: none;
}
.glass {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  border-radius: 20px;
}
.login-card {
  position: relative;
  width: min(400px, 92vw);
  padding: 28px 28px 22px;
}
.brand-hero h1 {
  margin: 0 0 4px;
  font-size: 1.7rem;
  font-weight: 700;
  color: #14352e;
}
.brand-hero { margin-bottom: 18px; }
.captcha-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.captcha-img {
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
}
.login-btn { width: 100%; margin-top: 14px; }
.tip { margin-top: 14px; margin-bottom: 0; }

/* ---- shell ---- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 212px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(10px);
}
.brand {
  font-weight: 700;
  font-size: 17px;
  padding: 6px 10px 10px;
  color: #14352e;
}
.side-group-label {
  margin: 10px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.9;
}
.side-group-label:first-of-type { margin-top: 2px; }
.side-menu .el-menu-item-group__title {
  padding: 10px 12px 4px !important;
  font-size: 11px !important;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted) !important;
  line-height: 1.4 !important;
  height: auto !important;
}
.side-menu {
  border-right: none !important;
  background: transparent !important;
  flex: 1;
  overflow: auto;
}
.side-menu .el-menu-item {
  border-radius: 10px;
  margin: 2px 0;
  height: 40px;
}
.side-menu .el-menu-item.is-active {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 18px 22px 48px;
  overflow: auto;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px 24px;
  box-shadow: var(--shadow);
  max-width: 1080px;
  border: 1px solid rgba(255, 255, 255, 0.95);
}
.card.card-wide {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.page-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head-actions { flex-wrap: wrap; }
.summary-line { margin: 0 0 8px; }
.side-foot {
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-line { font-size: 12px; color: var(--muted); line-height: 1.35; }

#quick-page .page-lead {
  max-width: none;
}
#quick-page .detail-table {
  min-width: 0;
  width: 100%;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 1.28rem;
  color: #14352e;
  letter-spacing: 0.01em;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: #14352e;
  font-weight: 650;
}
.page-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 46em;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  align-items: center;
}
.row.actions { margin-top: 14px; }
.row.between { justify-content: space-between; align-items: flex-start; }
.row > .el-input,
.row > .el-select,
.row > .el-input-number,
.row > .el-date-editor {
  flex: 0 1 auto;
  min-width: 128px;
}
.stack-form .el-form-item { margin-bottom: 10px; }

.section-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.form-grid .field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-grid .field .el-input,
.form-grid .field .el-select,
.form-grid .field .el-input-number { width: 100%; }
.form-grid .field .native-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.form-grid .field .native-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
/* Element Plus 日期面板勿被业务表格样式污染；本仓对账改用原生 date */
.el-picker__popper,
.el-date-picker,
.el-picker-panel {
  z-index: 4000 !important;
}
.ai-config-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 4px;
}
.engine-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.engine-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(165deg, #fff, #f5faf8);
}

/* ---- native data table (replaces broken el-table layout) ---- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 520px;
}
.data-table th {
  text-align: left;
  padding: 11px 12px;
  background: #f2f8f5;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td {
  background: rgba(31, 143, 122, 0.045);
}
.data-table .empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table .amt-out { color: #b42318; }
.data-table .amt-in { color: #027a48; }
.invite-code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  letter-spacing: 4px;
  font-weight: 700;
  text-align: center;
  color: #1f8f7a;
  background: rgba(31, 143, 122, 0.08);
  border: 1px dashed #1f8f7a;
  border-radius: 8px;
  padding: 14px 8px;
  margin: 8px 0;
}
.data-table .tx-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; color: #475569; }
.data-table .tx-remark { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; line-height: 1.4;
  border: 1px solid #d0d5dd; background: #f8fafc; color: #475569; white-space: nowrap;
}
.type-badge.type-out { border-color: #fda29b; background: #fef3f2; color: #b42318; }
.type-badge.type-in { border-color: #6ce9a6; background: #ecfdf3; color: #027a48; }
.type-badge.type-adj { border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.type-badge.type-other { border-color: #cbd5e1; background: #f8fafc; color: #334155; }

.person-list { display: flex; flex-direction: column; gap: 10px; }
.person-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f4faf7);
}
.person-name {
  font-size: 1.05rem;
  font-weight: 650;
  color: #14352e;
  margin-bottom: 2px;
}
.person-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

.member-subnav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3f7f5;
}
.member-subnav-item {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}
.member-subnav-item.active {
  background: #fff;
  color: #14352e;
  box-shadow: 0 1px 2px rgba(20, 53, 46, 0.08);
}
.member-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.member-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 110px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f4faf7);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.member-chip:hover { border-color: #7eb8a8; }
.member-chip.active {
  border-color: #2d8a74;
  box-shadow: 0 0 0 2px rgba(45, 138, 116, 0.18);
  background: linear-gradient(160deg, #f0faf6, #e5f5ef);
}
.member-chip.disabled { opacity: 0.72; }
.member-chip-name { font-weight: 650; color: #14352e; }
.member-chip-meta { font-size: 0.78rem; color: var(--muted); }
.member-workspace { margin-top: 4px; }
.member-workspace-head { margin-bottom: 4px; align-items: center; }
.member-wallet-forest {
  margin-top: 8px;
}
.member-wallet-forest .wallet-pack {
  border-left: 3px solid rgba(31, 143, 122, 0.4);
  background: linear-gradient(165deg, #fff, #f3faf7);
}
.member-wallet-forest .wallet-pack-body {
  margin-top: 4px;
  padding-left: 4px;
  border-left: 2px dashed rgba(31, 143, 122, 0.18);
  margin-left: 6px;
}
.member-wallet-forest .wallet-pack .wallet-child-row:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.member-profile-actions { flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.more-sections { display: flex; flex-direction: column; gap: 18px; }
.more-group h3 { margin-bottom: 10px; }
.more-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.numpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 72px));
  gap: 8px;
  max-width: 240px;
  margin: 8px 0 14px;
}
.numpad .el-button { margin: 0; min-height: 40px; }
.quick-bill-box {
  margin: 0 0 18px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(31, 143, 122, 0.18);
  border-radius: 14px;
  background: linear-gradient(165deg, #f7fcfa 0%, #ffffff 55%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.quick-bill-box .mt { margin-top: 8px; }
.hand-panel {
  margin-top: 6px;
  padding: 16px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  background: #fff;
}
.booking-rows-panel {
  margin-top: 8px;
}
.booking-row-card {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.booking-row-card.dup { border-color: #fca5a5; background: #fef2f2; }
.booking-row-card.err { border-color: #f87171; box-shadow: inset 0 0 0 1px #fecaca; }
.booking-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.booking-row-head .row-idx {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-width: 24px;
}
.booking-row-fields {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #e5e7eb);
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 14px;
}
.field-grid label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.row-img-cell.inline {
  flex-direction: row;
  align-items: center;
  min-width: auto;
}
.row-img-cell.inline.over {
  outline: 2px dashed var(--el-color-primary, #1f8f7a);
  outline-offset: 2px;
  border-radius: 8px;
}
.tag-warn {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 2px 8px;
  border-radius: 4px;
}
.row-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #b42318;
}
.empty-hint {
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.detail-table {
  width: 100%;
  min-width: 720px;
}
.row-img-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 56px;
}
.row-img-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--border, #e5e7eb);
  cursor: zoom-in;
}
.row-img-btn {
  font-size: 12px;
  color: var(--el-color-primary, #409eff);
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}
.row-img-btn:hover { text-decoration: underline; }
.row-img-clear {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  padding: 0;
  cursor: pointer;
}
.quick-ocr-drop {
  width: 100%;
  box-sizing: border-box;
  padding: 28px 16px;
  border: 1.5px dashed rgba(31, 143, 122, 0.35);
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.quick-ocr-drop:hover {
  border-color: var(--el-color-primary, #1f8f7a);
  background: rgba(31, 143, 122, 0.06);
  box-shadow: 0 0 0 3px rgba(31, 143, 122, 0.08);
}
.quick-ocr-drop.over {
  border-color: var(--el-color-primary, #1f8f7a);
  background: rgba(31, 143, 122, 0.12);
}
.quick-ocr-drop.full {
  cursor: not-allowed;
  opacity: 0.72;
}
.quick-ocr-drop-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: #14352e;
}
.section-sub {
  margin: 18px 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.img-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.img-thumb {
  position: relative;
  width: 88px;
}
.img-thumb-el {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  cursor: zoom-in;
}
.img-thumb-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  cursor: pointer;
  line-height: 20px;
  padding: 0;
}
.img-thumb-cap {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.order-id-input input, .order-id-cell {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.data-table.compact th, .data-table.compact td { padding: 6px 8px; font-size: 13px; }
.data-table tr.dup { background: #fff1f2; }
.text-danger { color: #dc2626; }
.text-ok { color: #16a34a; }
.refund-summary { font-size: 13px; color: #374151; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f3f4f6; }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}
.scenario-btn {
  appearance: none;
  border: 1px solid var(--border, #d8dee6);
  background: var(--surface-2, #f6f8fa);
  color: inherit;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
}
.scenario-btn:hover { border-color: var(--accent, #3d8b6e); }
.scenario-btn.active {
  border-color: var(--accent, #3d8b6e);
  background: color-mix(in srgb, var(--accent, #3d8b6e) 16%, white);
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 4px;
}
.dash-tile {
  background: linear-gradient(160deg, #fff, #f3faf8);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.dash-tile.warn { background: linear-gradient(160deg, #fff8f3, #fff); }
.dash-label { font-size: 12px; color: var(--muted); }
.dash-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #14352e;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 10px;
}
.todo-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfdfc;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.todo-chip:hover { border-color: var(--accent, #3d8b6e); }
.todo-chip.on { border-color: #e6a23c; background: #fff8f0; }
.todo-chip .todo-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: #14352e;
  font-variant-numeric: tabular-nums;
}
.todo-chip.on .todo-num { color: #b45309; }
.todo-chip .todo-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.wallet-grid, .debt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 4px 0 8px;
}
.wallet-forest {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 12px;
}
.wallet-forest.dock-open {
  padding-right: 4px;
}
.wallet-tree-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(165deg, #fff, #f5faf8);
  transition: border-color .15s, box-shadow .15s;
}
.wallet-tree-card.selected {
  border-color: rgba(31, 143, 122, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.wallet-tree-card.disabled { opacity: 0.55; }
.wallet-tree-card.ungrouped {
  background: #fafafa;
  border-style: dashed;
}
.wallet-tree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.wallet-tree-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wallet-tree-meta { white-space: nowrap; }
.wallet-child-row {
  border-top: 1px solid var(--line);
  padding: 8px 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wallet-child-row.selected {
  background: rgba(31, 143, 122, 0.06);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}
.wallet-child-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.wallet-child-name { font-weight: 600; }
.wallet-child-meta { white-space: nowrap; }
.wallet-child-main .wallet-bal {
  margin: 0 0 0 auto;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wallet-actions { flex-shrink: 0; }
.empty-hint { padding: 6px 0 2px; }
.wallet-child-row.disabled { opacity: 0.55; }
.pack-child-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--el-border-color-lighter, #ebeef5);
}
.pack-child-item:last-child { border-bottom: none; }
.pack-child-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-left: 22px;
}
.img-drop-zone {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 148px;
  min-height: 72px;
  padding: 8px 10px;
  border: 1.5px dashed rgba(31, 143, 122, 0.35);
  border-radius: 10px;
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.img-drop-zone:hover,
.img-drop-zone.over {
  border-color: var(--el-color-primary, #1f8f7a);
  background: rgba(31, 143, 122, 0.1);
}
.img-drop-zone.has-file {
  min-width: 120px;
  padding: 6px;
}
.img-drop-zone .drop-hint {
  font-size: 12px;
  color: #3d5c55;
  line-height: 1.35;
}
.img-drop-zone.inline-row {
  flex-direction: row;
  min-height: 40px;
  min-width: 0;
}
.wallet-card, .debt-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  background: linear-gradient(165deg, #fff, #f5faf8);
  transition: border-color .15s, box-shadow .15s;
}
.wallet-card.disabled { opacity: 0.55; }
.acc-preview-link {
  cursor: pointer;
  color: inherit;
}
.acc-preview-link:hover {
  color: var(--el-color-primary);
  text-decoration: underline;
}
.acc-preview-card {
  cursor: pointer;
}
.acc-preview-card:hover {
  border-color: var(--el-color-primary-light-5, #a0cfff);
  box-shadow: 0 4px 14px rgba(15, 60, 50, 0.08);
}
.acc-preview-summary {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.acc-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.acc-preview-name { font-size: 17px; }
.acc-preview-sub { margin-top: 4px; }
.acc-preview-metrics {
  display: flex;
  gap: 18px;
  align-items: flex-end;
}
.acc-metric { text-align: right; }
.acc-metric-val {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.acc-metric-val.sm { font-size: 18px; }
.acc-preview-actions { margin-top: 10px; flex-wrap: wrap; }
.acc-preview-tabs { margin-top: 8px; }
.acc-preview-bal {
  text-align: right;
}
.wallet-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.wallet-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wallet-card-meta { margin-top: 4px; }
.debt-card {
  cursor: pointer;
}
.debt-card.active {
  border-color: rgba(31, 143, 122, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.wallet-bal, .debt-bal {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 4px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.wallet-card-main .wallet-bal {
  margin: 0;
  flex-shrink: 0;
}
.acc-drawer-form {
  grid-template-columns: 1fr;
}
.acc-more-toggle {
  margin: 4px 0 12px;
}
.acc-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: #fff;
}
.debt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.debt-meta b { color: var(--text); font-weight: 600; }

.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.mobile-tab { display: none; }
.el-button + .el-button { margin-left: 0; }
.el-upload { display: inline-flex; }
.el-alert { border-radius: 10px; }

/* hide unused broken el-table remnants if any remain */
.el-table { width: 100% !important; }

/* ---- tables (PC friendly) ---- */
.table-wrap-scroll {
  overflow: auto;
  max-width: 100%;
}
.data-table-comfortable {
  width: 100%;
  min-width: 560px;
}
.data-table-comfortable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfa;
  box-shadow: 0 1px 0 var(--line);
}
.data-table-comfortable .tx-remark {
  max-width: 280px;
}
.acc-preview-drawer .data-table-comfortable {
  min-width: 0;
}
.acc-preview-drawer.is-docked {
  box-shadow: -8px 0 28px rgba(30, 70, 60, 0.08) !important;
}
.acc-preview-drawer.is-docked .el-drawer__header {
  margin-bottom: 12px;
}

/* ---- desktop / tablet shell ---- */
@media (min-width: 1100px) {
  .main > .card {
    max-width: none;
    width: 100%;
  }
  .main {
    padding: 20px 28px 56px;
    background: rgba(255, 255, 255, 0.28);
  }
  .card {
    box-shadow: 0 4px 18px rgba(30, 70, 60, 0.05);
    border-radius: 14px;
  }
  .page-lead {
    max-width: 56em;
    margin-bottom: 14px;
  }
  .wallet-grid, .debt-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (min-width: 1280px) {
  .side { width: 228px; }
  .card h2 { font-size: 1.35rem; }
  .data-table-comfortable .tx-remark { max-width: 360px; }
}

@media (max-width: 720px) {
  .layout { flex-direction: column; padding-bottom: 64px; }
  .side { display: none; }
  .mobile-tab {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-tab button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    padding: 8px 4px;
    border-radius: 10px;
  }
  .mobile-tab button.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
  }
  .main { padding: 14px; }
  .card { padding: 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .todo-grid { grid-template-columns: 1fr; }
  .person-card { flex-direction: column; align-items: flex-start; }
  .debt-meta { grid-template-columns: 1fr; }
  .wallet-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .wallet-card {
    padding: 12px 14px;
  }
  .wallet-card-main .wallet-bal {
    font-size: 18px;
  }
  .data-table-comfortable {
    min-width: 0;
  }
  .acc-drawer .el-drawer__body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ---- tablet: 721–1099px（E3 响应式断点）---- */
@media (min-width: 721px) and (max-width: 1099px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-grid, .debt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.source-badge{display:inline-block;padding:1px 6px;border-radius:4px;font-size:12px;line-height:1.4;border:1px solid #d0d5dd;background:#f8fafc;color:#475569}
.source-badge.src-ai{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}
.source-badge.src-adj{border-color:#fcd34d;background:#fffbeb;color:#b45309}
.source-badge.src-imp{border-color:#c4b5fd;background:#f5f3ff;color:#6d28d9}
.source-badge.src-manual{border-color:#cbd5e1;background:#f8fafc;color:#334155}
.due-chip{color:#b45309;font-weight:600}
.due-urgent{color:#b91c1c}
