.ledger-page .ledger-scroll { width: 100%; max-height: 68vh; overflow: auto; border: 1px solid #dce4ed; border-radius: 10px; background: #fff; }
.ledger-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.ledger-table th, .ledger-table td { border-bottom: 1px solid #e5ebf1; border-right: 1px solid #edf1f5; padding: 10px 12px; max-width: 280px; min-width: 115px; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
.ledger-table th { position: sticky; top: 0; z-index: 2; background: #edf2f8; white-space: nowrap; color: #23415f; }
.ledger-table td { background: var(--ledger-cell, var(--ledger-row, #fff)); }
.ledger-table .ledger-name { position: sticky; left: 0; min-width: 160px; z-index: 1; box-shadow: 2px 0 3px #1b344510; }
.ledger-table th.ledger-name { z-index: 3; }
.ledger-table .ledger-sort { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; }
.ledger-table td:first-child, .ledger-table th:first-child { min-width: 48px; }
.ledger-table input[type="checkbox"] { width: 17px; height: 17px; }
/* 12 色（2026-10-20）：整行用浅色底，单个格子用同色更深一点，叠在整行上也看得出 */
.ledger-table tr.ledger-color-red { --ledger-row: #ffe1de80; }
.ledger-table td.ledger-cell-red { --ledger-cell: #ffe1de; }
.ledger-swatch-red { background: #e5484d; }
.ledger-table tr.ledger-color-orange { --ledger-row: #ffe8d480; }
.ledger-table td.ledger-cell-orange { --ledger-cell: #ffe8d4; }
.ledger-swatch-orange { background: #f76b15; }
.ledger-table tr.ledger-color-amber { --ledger-row: #fff3c480; }
.ledger-table td.ledger-cell-amber { --ledger-cell: #fff3c4; }
.ledger-swatch-amber { background: #e2a300; }
.ledger-table tr.ledger-color-lime { --ledger-row: #eaf7c880; }
.ledger-table td.ledger-cell-lime { --ledger-cell: #eaf7c8; }
.ledger-swatch-lime { background: #7cb518; }
.ledger-table tr.ledger-color-green { --ledger-row: #dcf3e380; }
.ledger-table td.ledger-cell-green { --ledger-cell: #dcf3e3; }
.ledger-swatch-green { background: #30a46c; }
.ledger-table tr.ledger-color-teal { --ledger-row: #d3f2ee80; }
.ledger-table td.ledger-cell-teal { --ledger-cell: #d3f2ee; }
.ledger-swatch-teal { background: #12a594; }
.ledger-table tr.ledger-color-cyan { --ledger-row: #d6f1fb80; }
.ledger-table td.ledger-cell-cyan { --ledger-cell: #d6f1fb; }
.ledger-swatch-cyan { background: #05a2c2; }
.ledger-table tr.ledger-color-blue { --ledger-row: #dce9ff80; }
.ledger-table td.ledger-cell-blue { --ledger-cell: #dce9ff; }
.ledger-swatch-blue { background: #3e63dd; }
.ledger-table tr.ledger-color-indigo { --ledger-row: #e3e3ff80; }
.ledger-table td.ledger-cell-indigo { --ledger-cell: #e3e3ff; }
.ledger-swatch-indigo { background: #5b5bd6; }
.ledger-table tr.ledger-color-purple { --ledger-row: #efe1fb80; }
.ledger-table td.ledger-cell-purple { --ledger-cell: #efe1fb; }
.ledger-swatch-purple { background: #8e4ec6; }
.ledger-table tr.ledger-color-pink { --ledger-row: #fde0ef80; }
.ledger-table td.ledger-cell-pink { --ledger-cell: #fde0ef; }
.ledger-swatch-pink { background: #d6409f; }
.ledger-table tr.ledger-color-gray { --ledger-row: #e9ebee80; }
.ledger-table td.ledger-cell-gray { --ledger-cell: #e9ebee; }
.ledger-swatch-gray { background: #8b8d98; }
.ledger-row-actions { display: flex; gap: 8px; flex-wrap: wrap; min-width: 130px; }
.ledger-row-actions button { padding: 3px 7px; font-size: 12px; }
.ledger-column-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; padding-top: 10px; }
.ledger-columns .business-check { margin: 5px 0; }
.ledger-page > .business-actions select { width: auto; max-width: 200px; }
.ledger-page .business-filters > * { flex-basis: 140px; }
@media (max-width:600px) { .ledger-table th, .ledger-table td { padding: 8px; } .ledger-table .ledger-name { min-width: 125px; max-width: 150px; } }
.ledger-column-group { border-top: 1px solid #e5ebf1; padding-top: 6px; margin-top: 6px; }
.ledger-column-group:first-child { border-top: 0; margin-top: 0; }
.ledger-group-toggle { border: 0; background: none; padding: 4px 0; font: inherit; color: #23415f; cursor: pointer; text-align: left; }
.ledger-head-finance { background: #eaf2ec; }
.ledger-head-system { background: #f0f0f3; }
.ledger-head-custom { background: #fdf4e6; }
.ledger-field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ledger-field-row .actions { margin-left: auto; }
/* 财务需要注意的格子：客户还欠钱、亏本、多收待退（2026-10-19） */
.ledger-table td.ledger-alert { color: #b42318; font-weight: 600; }

/* Excel 式选择、就地编辑、列头筛选（2026-10-20） */
.ledger-scroll:focus { outline: 2px solid #c5a05980; outline-offset: 1px; }
.ledger-table td { cursor: cell; user-select: none; }
.ledger-table td.ledger-name a { user-select: text; }
.ledger-table td.is-selected { box-shadow: inset 0 0 0 9999px #3e63dd1f; }
.ledger-table td.is-active { outline: 2px solid #3e63dd; outline-offset: -2px; }
.ledger-table td.ledger-editing { padding: 2px; background: #fff; outline: 2px solid #3e63dd; outline-offset: -2px; cursor: auto; user-select: auto; }
.ledger-table td.is-saving { opacity: .55; }
.ledger-editor { display: flex; gap: 4px; flex-direction: column; min-width: 140px; }
.ledger-editor input, .ledger-editor select, .ledger-editor textarea { width: 100%; padding: 4px 6px; font-size: 13px; }
.ledger-table tr.is-checked td { box-shadow: inset 3px 0 0 #c5a059; }
.ledger-table tr.is-checked td.is-selected { box-shadow: inset 0 0 0 9999px #3e63dd1f; }
.ledger-check-col { min-width: 40px !important; width: 40px; text-align: center; }
.ledger-th { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.ledger-table th { position: sticky; }
.ledger-table th.is-filtered { background: #fbeccd; }
.ledger-filter-btn { border: 1px solid #c8d3df; background: #fff; border-radius: 4px; padding: 0 5px; font-size: 11px; line-height: 18px; color: #23415f; cursor: pointer; }
.ledger-table th.is-filtered .ledger-filter-btn { background: #c5a059; color: #fff; border-color: #c5a059; }
.ledger-resize { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 4; }
.ledger-filter-pop { position: fixed; z-index: 1000; width: 320px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid #dce4ed; border-radius: 10px;
  box-shadow: 0 10px 30px #0d2a4733; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ledger-filter-pop select, .ledger-filter-pop input:not([type=checkbox]) { width: 100%; }
.ledger-filter-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ledger-filter-range input, .ledger-filter-range select { flex: 1 1 110px; }
.ledger-filter-head { display: flex; gap: 6px; align-items: center; }
.ledger-filter-head input { flex: 1; }
.ledger-filter-list { max-height: 220px; overflow: auto; border: 1px solid #edf1f5; border-radius: 6px; padding: 4px 8px; }
.ledger-filter-list .business-check { margin: 4px 0; }
.ledger-filter-colors { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ledger-filter-foot { position: sticky; bottom: -12px; background: #fff; padding: 8px 0 0; }
.ledger-link { border: 0; background: none; color: #3e63dd; padding: 2px 4px; font-size: 12px; cursor: pointer; }
.ledger-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.ledger-chip { display: inline-flex; align-items: center; gap: 4px; background: #fbeccd; color: #6b4e12; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; }
.ledger-chip button { border: 0; background: none; font-size: 15px; line-height: 1; padding: 0 6px; cursor: pointer; color: inherit; }
.ledger-palette { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0; }
.ledger-palette select { width: auto; }
.ledger-swatch { width: 22px; height: 22px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 0 0 1px #c8d3df; padding: 0; cursor: pointer; }
.ledger-swatch:hover, .ledger-swatch:focus-visible { box-shadow: 0 0 0 2px #0d2a47; }
.ledger-statusbar { font-size: 12px; color: #475569; background: #f1f4f8; border: 1px solid #dce4ed; border-top: 0; border-radius: 0 0 10px 10px; padding: 6px 12px; min-height: 18px; }
.ledger-page .ledger-scroll { border-radius: 10px 10px 0 0; }
.ledger-viewbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ledger-viewbar .business-note { flex-basis: 100%; margin: 0; }
.ledger-view-label { display: flex; gap: 8px; align-items: center; }
.ledger-view-select { min-width: 220px; width: auto; }
.ledger-group-tools { margin-left: 8px; }
.ledger-offscreen { position: fixed; left: -9999px; top: 0; }
/* 键盘移动时格子不要躲到固定的表头、申请人列后面 */
.ledger-page .ledger-scroll { scroll-padding: 44px 0 0 210px; }

/* 年度 / 项目管理列表（2026-10-21） */
.ledger-year-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.ledger-year-row > b { min-width: 6em; }
.ledger-year-select { font-weight: 600; }
.ledger-copy-text { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; white-space: pre-wrap; }
/* 签证进度弹窗（2026-10-24） */
.vp-dialog { display: flex; flex-direction: column; gap: 10px; }
.vp-person { border: 1px solid #dfe3e8; border-radius: 8px; padding: 10px 12px; }
.vp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.vp-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #5b6573; }
.vp-grid input { width: 100%; padding: 4px 6px; font-size: 13px; }
.vp-status { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vp-actions { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.vp-actions textarea { flex: 1; min-width: 220px; font-size: 13px; }
.vp-result { font-size: 13px; }
.vp-help p { margin: 4px 0; }
@media (max-width: 760px) { .vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 横向/纵向滚动条一直显示（macOS 默认不滚动时隐藏，用户以为没有滚动条，2026-11-03） */
.ledger-page .ledger-scroll { scrollbar-gutter: stable; }
.ledger-page .ledger-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.ledger-page .ledger-scroll::-webkit-scrollbar-track { background: #f1f4f8; }
.ledger-page .ledger-scroll::-webkit-scrollbar-thumb { background: #b7c3d0; border-radius: 6px; border: 2px solid #f1f4f8; }
.ledger-page .ledger-scroll::-webkit-scrollbar-thumb:hover { background: #8fa0b2; }
.ledger-page .ledger-scroll::-webkit-scrollbar-corner { background: #f1f4f8; }
/* 护照信息列：多人案件每人一行，等宽好对齐 */
.ledger-table td.ledger-pp { white-space: pre; font-variant-numeric: tabular-nums; }

/* 英国/澳洲/新西兰/加拿大专用列：其他国家灰掉（2026-11-10） */
.ledger-table td.ledger-na { color: #b8b8b8; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.025) 6px 12px); text-align: center; }

/* 2026-11-17 整理：视图 + 筛选 + 显示列 + 上色收成一块工具区，表格尽量占满屏幕 */
.ledger-toolbox { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
.ledger-toolrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ledger-toolrow > .ledger-viewbar { flex: 0 0 auto; gap: 8px; }
.ledger-toolrow > .business-filters { flex: 1 1 520px; }
.ledger-toolbox .ledger-view-select { min-width: 180px; }
.ledger-help { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid #c8d3df; background: #fff; color: #64748b; font-size: 12px; line-height: 1; cursor: help; }
.ledger-toolrow-2 { font-size: 13px; }
.ledger-toolrow-2 .ledger-palette { margin: 0; }
.ledger-toolrow-2 > .business-note { margin: 0 0 0 auto; }
.ledger-toolbox .ledger-columns { padding: 0; border: 0; background: none; box-shadow: none; }
.ledger-toolbox .ledger-columns > summary { padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 400; gap: 4px; }
.ledger-toolbox .ledger-columns > summary::before { font-size: 15px; }
.ledger-toolbox .ledger-columns[open] { flex-basis: 100%; }
.ledger-toolbox .ledger-columns[open] > summary { display: inline-flex; margin-bottom: 4px; }
.ledger-toolbox .ledger-chips { margin: 0; }
.ledger-toolbox .ledger-chips:empty { display: none; }
.ledger-page > * + * { margin-top: 12px; }
.ledger-page .ledger-scroll { max-height: max(380px, calc(100vh - 330px)); }
.ledger-page > .ledger-statusbar { margin-top: 0; }
.ledger-table td > .m-pill { vertical-align: middle; }
.ledger-toolbox .business-filters > * { flex: 1 1 120px; }
.ledger-toolbox .business-filters > input[type="search"] { flex: 2 1 200px; }
.ledger-toolbox .business-filters > button { flex: 0 0 auto; }
