/* ============================================================
   合同管理工作台（纯 UI 交互层）
   亮色 + 紫色主题 #6C3FF5，复用现有 CRM 视觉语言
   ============================================================ */

/* 视图切换 Tab */
.contract-view-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
    margin-top: 6px;
}
.cv-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 13px;
    color: #606266;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: color .15s;
}
.cv-tab:hover { color: #6C3FF5; }
.cv-tab.active { color: #6C3FF5; font-weight: 600; border-bottom-color: #6C3FF5; }

/* 工作台卡片容器：复用合同列表的卡片风格 */
.wb-workbench-card {
    background: #fff;
    border: 1px solid #D1D9E6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.wb-header-card { margin-bottom: 14px; }
.wb-table-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 合同进度与计划 / 合同计划 两个独立视图：整体作为 flex 列，使下卡片撑满剩余高度、上卡片固定 */
#wbDetailView,
#wbPlanWorkbenchView {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 工作台工具栏 */
.wb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid #ebeef5;
}
.wb-tool-title { font-size: 14px; font-weight: 600; color: #303133; }
.wb-tool-title.wb-title-lg { font-size: 22px; font-weight: 700; line-height: 1.3; }
.wb-tool-right { display: flex; gap: 8px; }
.wb-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.wb-tool-btn i { font-size: 13px; }
.wb-tool-btn:hover { color: #6C3FF5; border-color: #b5a3f0; }
.wb-tool-close:hover { color: #f56c6c; border-color: #f5b0b0; }

/* 筛选摘要条 */
.wb-filter-summary {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 10px 20px;
    background: transparent;
    font-size: 12px;
    color: #606266;
}
.wb-fs-item b { color: #303133; font-weight: 600; }

/* 表格区 + 合计 + 分页 = flex 容器，合计+分页固定底部 */
.wb-table-section { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wb-table-wrap { overflow: auto; flex: 1; min-height: 0; }
.wb-table-wrap > table { width: 100%; border-collapse: collapse; }
/* 工作台表格：列名与数据均居中。
   使用 .crm-table.wb-table 复合选择器提高优先级，
   覆盖 crm-new.css 动态注入的 .crm-table thead th / tbody td 规则 */
.crm-table.wb-table th, .crm-table.wb-table td {
    white-space: nowrap;
    font-size: 12px;
    border: 1px solid #ebeef5;
    text-align: center !important;
}

/* 合同列表表格：补充完整单元格边框（crm-new.css 只有 border-bottom） */
#contractTable th, #contractTable td {
    border: 1px solid #ebeef5;
}
.wb-table .wb-idx { width: 40px; text-align: center; }
.wb-table .wb-col-config-btn { font-size: 15px; color: var(--crm-text-secondary, #909399); transition: color 0.2s, transform 0.2s; }
.wb-table .wb-col-config-btn:hover { color: #6C3FF5; transform: rotate(45deg); }
.wb-table .wb-link { color: #6C3FF5; cursor: pointer; }
.wb-table .wb-link.wb-wb-attach { font-weight: 600; }
.wb-table .wb-link:hover { text-decoration: underline; }
/* 合同名称悬停下划线改为点线 */
.wb-table .wb-link.wb-contract-title { text-decoration: none; }
.wb-table .wb-link.wb-contract-title:hover {
    border-bottom: 1px dotted #6C3FF5;
    text-decoration: none;
}

/* 合计行：对齐「计划收款金额」「累计收款金额」两列 */
.wb-table tfoot .wb-tfoot { background: #fafbfc; }
.wb-table tfoot .wb-tfoot td {
    font-weight: 600;
    color: #303133;
    font-size: 12px;
    padding: 8px 12px;
    border-top: 2px solid #e2e8f0;
}
.wb-table tfoot .wb-tfoot-num {
    text-align: right;
    white-space: nowrap;
}
.wb-table tfoot .wb-tfoot-lead { text-align: left; }
.wb-table tfoot .wb-tfoot-lead .val { color: #909399; font-weight: 600; }
.wb-table tfoot .wb-tfoot-tail { background: #fafbfc; }

/* 工作台表格始终显示 pageSize 行，无数据时补齐空行保持高度 */
.wb-empty-row td { height: 40px; border-bottom: 1px solid #ebeef5; }

/* 底部 footer 仅放分页 */
.wb-table-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #ebeef5;
    font-size: 12px;
    color: #606266;
}
.wb-pager-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #606266;
    font-size: 12px;
}
.wb-page-size-select {
    width: auto;
    height: 28px;
    padding: 2px 24px 2px 8px;
    font-size: 12px;
    color: #303133;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}
.wb-page-size-select:focus { border-color: #6C3FF5; outline: none; }

/* 关联单据 Tab（全部 / 收款单 / 付款单） */
.wb-doc-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 8px 0 4px 4px;
}
.wb-doc-tabs span {
    font-size: 12px;
    color: #606266;
    cursor: pointer;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: color .18s, border-color .18s;
}
.wb-doc-tabs span:hover { color: #6C3FF5; }
.wb-doc-tabs span.active {
    color: #6C3FF5;
    font-weight: 600;
    border-bottom-color: #6C3FF5;
}

/* 详情视图顶部 TAB 栏：进度执行 / 工作计划 */
.wb-detail-tabs {
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid #ebeef5;
    margin-bottom: 4px;
}
.wb-detail-tabs span {
    font-size: 14px;
    color: #606266;
    cursor: pointer;
    padding: 12px 2px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .18s, border-color .18s;
}
.wb-detail-tabs span:hover { color: #6C3FF5; }
.wb-detail-tabs span.active {
    color: #6C3FF5;
    font-weight: 600;
    border-bottom-color: #6C3FF5;
}

/* 新建合同按钮（紫色实心） */
.wb-tool-btn.wb-tool-primary {
    background: #6C3FF5;
    border-color: #6C3FF5;
    color: #fff;
}
.wb-tool-btn.wb-tool-primary:hover {
    background: #5a32d1;
    border-color: #5a32d1;
    color: #fff;
}
.wb-tool-btn.wb-tool-danger { color: #f56c6c; border-color: #f5b0b0; }
.wb-tool-btn.wb-tool-danger:hover { color: #fff; background: #f56c6c; border-color: #f56c6c; }

/* 工具栏按钮禁用态：默认灰显 */
.wb-tool-btn:disabled,
.wb-tool-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f5f7fa;
    border-color: #dcdfe6;
    color: #a8abb2;
}
.wb-tool-btn.wb-tool-primary:disabled,
.wb-tool-btn.wb-tool-primary.disabled {
    background: #d3c9f5;
    border-color: #d3c9f5;
    color: #fff;
}
.wb-tool-btn.wb-tool-danger:disabled,
.wb-tool-btn.wb-tool-danger.disabled {
    background: #fde2e2;
    border-color: #fde2e2;
    color: #f9a8a8;
}

/* 删除按钮默认暗淡态（非真正 disabled，行 hover 时激活） */
.wb-tool-btn.wb-tool-danger.wb-tool-btn-dim {
    opacity: 0.45;
    cursor: default;
    background: #fafafa;
    border-color: #e4e7ed;
    color: #c0c4cc;
}
.wb-tool-btn.wb-tool-danger.wb-tool-btn-dim:hover {
    opacity: 0.45;
    cursor: default;
    background: #fafafa;
    border-color: #e4e7ed;
    color: #c0c4cc;
}

/* 工作计划表格行选中高亮（淡紫色底色） */
#wbPlanWbTableWrap tbody tr.wb-plan-row-selected {
    background-color: #f0e6ff !important;
}
#wbPlanWbTableWrap tbody tr.wb-plan-row-selected td {
    background-color: transparent;
}

/* 工作计划工具栏 */
.wb-plan-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* 合同工作计划附件管理弹窗 */
.wb-plan-attach-dropzone {
    border: 1px dashed #6C3FF5;
    border-radius: 6px;
    padding: 28px 20px;
    text-align: center;
    background: #faf8ff;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.wb-plan-attach-dropzone:hover,
.wb-plan-attach-dropzone.dragover {
    background: #f0eaff;
    border-color: #5a32d1;
}
.wb-plan-attach-dropzone i {
    font-size: 40px;
    color: #6C3FF5;
    display: block;
    margin-bottom: 8px;
}
.wb-plan-attach-drop-title {
    font-size: 14px;
    color: #303133;
    font-weight: 600;
    margin-bottom: 4px;
}
.wb-plan-attach-drop-tip {
    font-size: 12px;
    color: #909399;
}
.wb-plan-attach-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 10px;
    font-size: 13px;
}
.wb-plan-attach-count { color: #303133; font-weight: 600; }
.wb-plan-attach-count span { color: #6C3FF5; }
.wb-plan-attach-batch { display: flex; gap: 16px; }
.wb-plan-attach-batch .wb-link { color: #6C3FF5; text-decoration: none; font-size: 13px; }
.wb-plan-attach-batch .wb-link:hover { color: #5a32d1; }
.wb-plan-attach-batch .wb-link-danger { color: #f56c6c; }
.wb-plan-attach-batch .wb-link-danger:hover { color: #f23c3c; }
.wb-plan-attach-list-wrap {
    border: 1px solid #ebeef5;
    border-radius: 6px;
    overflow: hidden;
}
.wb-plan-attach-list-head {
    padding: 10px 12px;
    background: #f5f7fa;
    border-bottom: 1px solid #ebeef5;
    font-size: 13px;
    color: #606266;
}
.wb-plan-attach-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
}
.wb-plan-attach-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6C3FF5;
    cursor: pointer;
}
.wb-plan-attach-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}
.wb-plan-attach-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.wb-plan-attach-item:last-child { border-bottom: none; }
.wb-plan-attach-item:hover { background: #f9f9fb; }
.wb-plan-attach-item.selected { background: #f0eaff; }
.wb-plan-attach-item .wb-plan-attach-check { margin-right: 10px; flex-shrink: 0; }
.wb-plan-attach-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.wb-plan-attach-info i.bi-file-earmark {
    font-size: 22px;
    color: #6C3FF5;
    flex-shrink: 0;
}
.wb-plan-attach-meta { flex: 1; min-width: 0; }
.wb-plan-attach-name {
    color: #6C3FF5;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    margin-bottom: 4px;
}
.wb-plan-attach-name:hover { color: #5a32d1; text-decoration: underline; }
.wb-plan-attach-detail {
    font-size: 12px;
    color: #909399;
    line-height: 1.5;
}
.wb-plan-attach-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: 10px;
}
.wb-plan-attach-actions a,
.wb-plan-attach-actions button {
    color: #606266;
    font-size: 15px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}
.wb-plan-attach-actions a:hover { color: #6C3FF5; }
.wb-plan-attach-actions button:hover { color: #f56c6c; }
.wb-plan-attach-empty {
    text-align: center;
    padding: 40px 20px;
    color: #909399;
    font-size: 13px;
}
.wb-plan-attach-empty i { font-size: 32px; display: block; margin-bottom: 8px; color: #c0c4cc; }

/* 工作计划表格：选中/编辑行 */
.wb-plan-table tbody tr { cursor: pointer; transition: background .15s; }
.wb-plan-table tbody tr:hover { background: #f5f7fa; }
.wb-plan-table tbody tr.selected { background: #f0e6ff; }
.wb-plan-table tbody tr.editing { background: #fffbe6; }
.wb-plan-table tbody tr.editing td { vertical-align: middle; }
.wb-plan-edit-input {
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
}
.wb-plan-edit-input:focus { border-color: #6C3FF5; outline: none; }
.wb-plan-edit-input[type="number"] { text-align: right; }
.wb-plan-edit-input:disabled {
    background: #f5f7fa;
    color: #909399;
    border-color: #e4e7ed;
    cursor: not-allowed;
}
/* 工作台计划表格：所有输入框统一外观（消除负责人列与其他列的视觉差异） */
#wbPlanWbTableWrap .wb-plan-edit-input {
    color: inherit;
    background-color: #fff;
}
/* 工作台计划表格：负责人搜索容器重置（去除暗色主题残留样式） */
#wbPlanWbTableWrap .wb-plan-owner-search {
    position: static;
    background: transparent;
    border: none;
    padding: 0;
}
/* 已完成（已锁定）计划行：整行字体置灰，与禁用态上传按钮一致(#c0c4cc) */
#wbPlanWbTableWrap tr.row-disabled td { color: #c0c4cc; }
#wbPlanWbTableWrap tr.row-disabled .wb-plan-edit-input { color: #c0c4cc !important; }
#wbPlanWbTableWrap tr.row-disabled .badge-wb { color: #c0c4cc !important; border-color: #e4e7ed !important; background: #f5f7fa !important; }

/* 合同附件表格：序号列窄宽度 */
#contractAttTable th:first-child,
#contractAttTable td:first-child { width: 36px !important; min-width: 36px !important; text-align: center !important; }

/* 通用列宽拖拽手柄 */
.resize-handle { position: absolute; top: 0; right: -2px; bottom: 0; width: 6px; cursor: col-resize; z-index: 3; border-right: 2px solid transparent; pointer-events: auto; }
.resize-handle:hover, .resize-handle.active { border-right-color: #4f6cff; background: rgba(79,108,255,0.08); }
.colresize-active { user-select: none; }

/* 附件列显示态（只读 / 上传入口） */
.wb-plan-attach-readonly { color: #909399; font-size: 12px; }
.wb-plan-attach { color: #6C3FF5; font-size: 12px; }
.wb-plan-attach-count { color: #606266; font-size: 12px; margin-right: 4px; }
.wb-plan-upload { cursor: pointer; }
.wb-plan-upload.disabled {
    pointer-events: none;
    opacity: 0.5;
    color: #c0c4cc;
    cursor: not-allowed;
}

/* 新建/编辑合同表单 */
.wb-edit-content { padding: 20px; }
.wb-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 20px;
}
.wb-form-cell { display: flex; flex-direction: column; gap: 4px; }
.wb-form-cell label {
    font-size: 12px;
    color: #909399;
    font-weight: 500;
}
.wb-form-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 12px;
    color: #303133;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .18s;
}
.wb-form-input:focus {
    border-color: #6C3FF5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 63, 245, 0.1);
}
.wb-form-input.wb-form-readonly {
    background: #f5f7fa;
    color: #909399;
    cursor: not-allowed;
}
.wb-edit-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.wb-edit-actions .wb-btn {
    padding: 8px 22px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all .18s;
}
.wb-edit-actions .wb-btn:hover { color: #6C3FF5; border-color: #b5a3f0; }
.wb-edit-actions .wb-btn-primary {
    background: #6C3FF5;
    border-color: #6C3FF5;
    color: #fff;
}
.wb-edit-actions .wb-btn-primary:hover { background: #5a32d1; border-color: #5a32d1; color: #fff; }

/* 滚动条细一点 */
.wb-table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.wb-table-wrap::-webkit-scrollbar-thumb { background: #c8c9cc; border-radius: 4px; }
.wb-table-wrap::-webkit-scrollbar-track { background: #f0f1f2; }

/* 进度条 */
.wb-progress { display: flex; align-items: center; gap: 6px; min-width: 130px; }
.wb-progress .bar { flex: 1; height: 8px; border-radius: 4px; background: #ebeef5; overflow: hidden; }
.wb-progress .bar > i { display: block; height: 100%; background: #3a7afe; border-radius: 4px; }
.wb-progress.pay .bar > i { background: #ff9a3d; }
.wb-progress .pct { font-size: 11px; color: #606266; width: 46px; text-align: right; }

/* 状态徽标 */
.badge-wb { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; line-height: 18px; }
.badge-wb-warn { background: #fdf0e6; color: #e08a2b; }
.badge-wb-danger { background: #fde2e2; color: #f56c6c; }
.badge-wb-ok { background: #e6f7ec; color: #2faa5b; }

/* 工作台列表「状态」列徽标：进度完成 → 绿色「已完成」；终止 → 红色；其余 → 蓝色/灰色 */
.wb-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}
.wb-status-completed { background: rgba(16, 185, 129, 0.16); color: #10B981; }   /* 已完成：绿色 */
.wb-status-active   { background: rgba(58, 122, 254, 0.14); color: #3A7AFE; }      /* 进行中：蓝色 */
.wb-status-cancelled{ background: rgba(239, 68, 68, 0.15); color: #EF4444; }       /* 终止已完成：红色 */
.wb-status-default  { background: #f0f1f5; color: #a0a4ad; }                        /* 其它：灰色 */

/* 分页 */
.wb-sticky-bottom { position: sticky; bottom: 0; z-index: 5; background: #fff; }
.wb-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: 12px;
    color: #606266;
}
.wb-page-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--crm-radius-sm, 4px);
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}
.wb-page-btn:hover:not(:disabled):not(.disabled) { color: #6C3FF5; border-color: #b5a3f0; }
.wb-page-btn:disabled,
.wb-page-btn.disabled { opacity: .5; cursor: not-allowed; }
.wb-page-btn.active { background: #6C3FF5; border-color: #6C3FF5; color: #fff; }

/* ============== 弹窗（查询条件 / 详情） ============== */
.wb-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055;
}
.wb-modal {
    background: #fff;
    border-radius: 4px;
    width: 480px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.wb-modal-xl { width: 920px; max-width: 94vw; }
.wb-modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wb-modal-title { font-size: 15px; font-weight: 600; color: #303133; }
.wb-modal-close { cursor: pointer; color: #909399; font-size: 20px; line-height: 1; }
.wb-modal-close:hover { color: #6C3FF5; }
.wb-modal-body { padding: 20px 24px; overflow: auto; }
.wb-modal-footer { padding: 12px 20px; border-top: 1px solid #ebeef5; background: #fafbfc; display: flex; align-items: center; gap: 10px; }

.wb-form-row { display: flex; align-items: center; margin-bottom: 14px; }
.wb-form-row > label { width: 90px; color: #000000; font-size: 12px; flex-shrink: 0; text-align: right; padding-right: 10px; }
.wb-form-row > .wb-control { flex: 1; min-width: 0; }
.wb-save-query-row { margin-top: 4px; align-items: flex-start !important; }
.wb-save-query-row > label { padding-top: 2px; }
.wb-checkbox-label { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #333; cursor: pointer; user-select: none; line-height: 1.6; word-break: break-all; }
.wb-checkbox-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; margin-top: 1px; }
.wb-checkbox-label span { flex: 1; min-width: 0; }
.wb-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    font-size: 12px;
    background: #fff;
    color: #606266;
    height: 30px;
    box-sizing: border-box;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23909399' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 26px;
}
.wb-select:focus { border-color: #6C3FF5; outline: none; }
.wb-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    font-size: 12px;
    background: #fff;
    color: #606266;
    height: 30px;
    box-sizing: border-box;
    font-family: inherit;
}
.wb-input:focus { border-color: #c0c4cc; outline: none; }
.wb-input::placeholder { color: #c0c4cc; }

/* 搜索框自动完成下拉 */
.wb-autocomplete {
    position: relative;
    flex: 1;
    min-width: 0;
}
.wb-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 3px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    list-style: none;
    margin: 2px 0 0 0;
    padding: 4px 0;
}
.wb-ac-item {
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.5;
}
.wb-ac-item:hover,
.wb-ac-item.wb-ac-active {
    background: #f5f7fa;
    color: #6C3FF5;
}
.wb-ac-item .wb-ac-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-ac-item .wb-ac-sub { font-size: 10px; color: #c0c4cc; margin-left: 8px; flex-shrink: 0; }
.wb-date-readonly {
    background: #fafafa;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #606266;
    font-size: 12px;
    cursor: pointer;
}
.wb-cal { color: #c0c4cc; font-size: 13px; }

/* 自定义日期输入框 */
.wb-date-custom-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    display: none; /* 默认隐藏，选"自定义"时显示 */
}
.wb-date-custom-inputs .wb-date-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    font-size: 12px;
    color: #606266;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}
.wb-date-custom-inputs .wb-date-input:focus {
    border-color: #6C3FF5;
    box-shadow: 0 0 0 2px rgba(108,63,245,0.15);
}
.wb-date-sep {
    color: #909399;
    font-size: 12px;
    white-space: nowrap;
}
.wb-funnel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6C3FF5;
    font-size: 12px;
    font-weight: 500;
}
.wb-funnel::before {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'><path fill='%236C3FF5' d='M858.5 763.6H165.7c-25.4 0-45.9-20.5-45.9-45.9 0-9.4 2.7-18.4 7.6-26.1L458 379.4V161.1c0-14.4 11.7-26.1 26.1-26.1h55.7c14.4 0 26.1 11.7 26.1 26.1v218.3l330.5 312.1c4.8 4.5 7.5 10.8 7.5 17.4 0 25.4-20.5 45.9-45.4 45.9z'/></svg>") no-repeat center / contain;
}
.wb-setting { margin-left: 12px; color: #c0c4cc; font-size: 12px; cursor: pointer; }
.wb-setting:hover { color: #6C3FF5; }
.wb-divider { height: 1px; background: #ebeef5; margin: 18px -24px 16px; }
.wb-check { display: flex; align-items: center; gap: 6px; color: #606266; font-size: 12px; cursor: pointer; user-select: none; }
.wb-check input { accent-color: #6C3FF5; width: 14px; height: 14px; margin: 0; cursor: pointer; }
.wb-gap { display: inline-block; width: .5em; }
.wb-btn {
    padding: 7px 24px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
    min-width: 80px;
    height: 32px;
    line-height: 1;
}
.wb-btn + .wb-btn { margin-left: 8px; }
.wb-btn-primary { background: #6C3FF5; border-color: #6C3FF5; color: #fff; }
.wb-btn-primary:hover { background: #5a32d1; border-color: #5a32d1; }

/* ============== 详情（内嵌，3列：左信息+右信息+进度卡） ============== */
.wb-detail-content .wb-detail-grid { display: grid; grid-template-columns: 1fr 1fr 280px; gap: 16px; }
.wb-detail-content .wb-section-title { margin-top: 14px; }
.wb-detail-content .wb-timeline { margin-bottom: 12px; }
.wb-detail-content .wb-detail-table th,
.wb-detail-content .wb-detail-table td { padding: 7px 10px; font-size: 12px; }
.wb-info-card { border: 1px solid #ebeef5; border-radius: 6px; padding: 16px; background: #fff; }
.wb-info-card h4 { margin: 0 0 10px; font-size: 14px; color: #303133; font-weight: 600; }
.wb-info-row { display: flex; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed #f0f0f0; }
.wb-info-row:last-child { border-bottom: none; }
.wb-info-row .k { width: 72px; color: #909399; flex-shrink: 0; }
.wb-info-row .v { color: #303133; flex: 1; word-break: break-all; }
.wb-progress-cards { display: flex; flex-direction: column; gap: 12px; }
.wb-progress-cards .wb-plan-progress-card { width: 100%; box-sizing: border-box; }
/* 基本信息 3 列布局 */
.wb-info-3col { display: flex; flex-direction: column; gap: 6px; }
.wb-info-3row { display: flex; flex-direction: row; gap: 16px; padding-bottom: 8px; border-bottom: 1px dashed #f0f0f0; }
.wb-info-3row:last-child { border-bottom: none; padding-bottom: 0; }
.wb-info-cell { display: flex; flex: 1; flex-direction: row; gap: 6px; align-items: baseline; }
.wb-info-cell .k { color: #909399; font-size: 12px; flex-shrink: 0; width: 72px; }
.wb-info-cell .v { color: #303133; font-size: 12px; flex: 1; word-break: break-all; }
.wb-pcard { border: 1px solid #ebeef5; border-radius: 6px; padding: 14px 16px; background: #fff; }
.wb-pcard .t { font-size: 12px; color: #909399; margin-bottom: 6px; }
.wb-pcard .big { font-size: 22px; font-weight: 700; color: #303133; }
.wb-pcard.recv .big { color: #3a7afe; }
.wb-pcard.pay .big { color: #ff9a3d; }
.wb-pcard .sub { font-size: 11px; color: #909399; margin-top: 6px; line-height: 1.6; }
.wb-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #303133;
    margin: 18px 0 10px;
    padding-left: 8px;
}
.wb-timeline { display: flex; gap: 8px; margin-bottom: 14px; position: relative; }
.wb-tl-node { flex: 1; text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; }
.wb-tl-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #ebeef5;
    color: #909399;
    line-height: 24px;
    margin: 0 auto 2px;
    font-size: 12px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.wb-tl-node.done .wb-tl-dot { background: #6C3FF5; color: #fff; }
.wb-tl-node.cur .wb-tl-dot { background: #ff9a3d; color: #fff; }
.wb-tl-line { position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: #ebeef5; z-index: 1; }
.wb-tl-node:last-child .wb-tl-line { display: none; }
.wb-tl-label { font-size: 11px; color: #606266; }
.wb-tl-check {
    display: inline-block;
    width: 18px; height: 18px;
    line-height: 18px;
    border-radius: 50%;
    background: #52c41a;
    color: #fff;
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(82,196,26,0.35);
    z-index: 3;
    box-shadow: 0 1px 3px rgba(82,196,26,.35);
}
.wb-flowchart-row { display: flex; gap: 24px; flex-wrap: wrap; }
.wb-flowchart-col { flex: 1; min-width: 260px; }
.wb-flowchart-caption { font-size: 13px; font-weight: 600; margin: 6px 0 10px; padding-left: 8px; border-left: 3px solid #ccc; }
.wb-flowchart-rec { border-left-color: #6C3FF5; color: #6C3FF5; }
.wb-flowchart-pay { border-left-color: #2faa5b; color: #2faa5b; }
.badge-wb-na { background: #f0f1f5; color: #a0a4ad; }
.wb-muted { color: #b4b8bf; }
.wb-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wb-detail-table th, .wb-detail-table td { border: 1px solid #ebeef5; padding: 7px 10px; text-align: left; white-space: nowrap; }
.wb-detail-table th { background: #f7f8fa; color: #606266; font-weight: 600; }
.wb-mini-bar { height: 6px; background: #ebeef5; border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.wb-mini-bar > i { display: block; height: 100%; background: #3a7afe; }

/* 合同工作计划 - 基本信息卡片 */
.wb-plan-basic-card {
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
    margin-bottom: 16px;
}
.wb-plan-basic-card h4 {
    margin: 0 0 14px;
    font-size: 14px;
    color: #303133;
    font-weight: 600;
}
.wb-plan-basic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 20px;
}
.wb-plan-basic-cell {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
}
.wb-plan-basic-cell .k {
    color: #909399;
    flex-shrink: 0;
    white-space: nowrap;
}
.wb-plan-basic-cell .v {
    color: #303133;
    flex: 1;
    word-break: break-all;
    min-width: 0;
}

/* ============== 合同工作计划独立视图 ============== */
.wb-plan-wb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid #ebeef5;
}
.wb-plan-wb-header .wb-plan-view-title { margin-bottom: 0; }
.wb-plan-wb-actions { display: flex; gap: 8px; }
.wb-plan-wb-body { display: flex; gap: 16px; padding: 16px 20px; align-items: flex-start; }
.wb-plan-wb-main { flex: 1; min-width: 0; }
.wb-plan-view-title {
    font-size: 22px;
    font-weight: 700;
    color: #303133;
    margin: 0 0 16px;
    padding-left: 2px;
}
.wb-plan-wb-side { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.wb-plan-wb-calendar { width: 280px; flex-shrink: 0; align-self: start; border: 1px solid #ebeef5; border-radius: 6px; padding: 14px; background: #fff; display: flex; flex-direction: column; }
.wb-plan-calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wb-plan-calendar-header h4 { margin: 0; font-size: 14px; font-weight: 600; color: #303133; }
.wb-plan-calendar-nav { display: flex; gap: 6px; }
.wb-plan-calendar-nav button { background: #f5f7fa; border: 1px solid #e4e7ed; border-radius: 4px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #606266; font-size: 12px; padding: 0; }
.wb-plan-calendar-nav button:hover { background: #e4e7ed; }
.wb-plan-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wb-plan-calendar-weekday { text-align: center; font-size: 11px; color: #909399; padding: 4px 0; }
.wb-plan-calendar-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 4px; font-size: 12px; color: #303133; cursor: default; position: relative; min-height: 28px; }
.wb-plan-calendar-day.other-month { color: #c0c4cc; }
.wb-plan-calendar-day.today { background: #f0f7ff; color: #3a7afe; font-weight: 700; }
.wb-plan-calendar-day.has-event { cursor: pointer; background: #f6ffed; }
.wb-plan-calendar-day.has-event:hover { background: #d9f7be; }
.wb-plan-calendar-day .wb-plan-calendar-dot { width: 4px; height: 4px; border-radius: 50%; background: #52c41a; margin-top: 2px; }
.wb-plan-calendar-empty { color: #909399; font-size: 12px; text-align: center; padding: 20px 0; }
.wb-plan-calendar-tooltip { position: absolute; z-index: 1000; background: #fff; border: 1px solid #ebeef5; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); padding: 8px 12px; min-width: 160px; font-size: 12px; color: #303133; }
.wb-plan-calendar-tooltip::before { content: ''; position: absolute; top: -6px; left: 50%; margin-left: -5px; width: 10px; height: 10px; background: #fff; border-left: 1px solid #ebeef5; border-top: 1px solid #ebeef5; transform: rotate(45deg); }
.wb-plan-calendar-tooltip .wb-plan-calendar-tt-title { font-weight: 600; margin-bottom: 6px; border-bottom: 1px solid #f0f0f0; padding-bottom: 4px; }
.wb-plan-calendar-tooltip .wb-plan-calendar-tt-item { padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-plan-wb-project-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6C3FF5;
    cursor: pointer;
    border: 1px dashed #d3c8f5;
    border-radius: 3px;
    padding: 2px 8px;
    background: #f8f7ff;
}
.wb-plan-wb-project-selector:hover { background: #f0edff; }
.wb-plan-wb-project-selector i { font-size: 10px; }
/* 只读态：合同全名不可点击切换（未点「修改」前） */
.wb-plan-wb-project-selector-readonly {
    display: inline-block;
    color: #303133;
    cursor: default;
    padding: 2px 0;
}

/* 合同工作计划 - 顶部（基本信息 + 收款/付款进度卡） */
.wb-plan-top { display: flex; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.wb-plan-top .wb-plan-basic-card { flex: 1; margin-bottom: 0; }
.wb-plan-progress-card {
    width: 260px;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.wb-pcard-title { font-size: 13px; color: #303133; font-weight: 600; margin-bottom: 10px; }
.wb-pcard-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wb-pcard-bar { flex: 1; height: 10px; background: #ebeef5; border-radius: 5px; overflow: hidden; }
.wb-pcard-bar > div { height: 100%; background: #3a7afe; border-radius: 5px; transition: width .3s ease; }
.wb-pcard-pct { font-size: 20px; color: #e8a200; font-weight: 700; white-space: nowrap; }
.wb-pcard-amounts { margin-top: auto; }
.wb-pcard-amounts > div { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 7px 0; border-top: 1px dashed #f0f0f0; }
.wb-pcard-amounts > div:first-child { border-top: none; padding-top: 0; }
.wb-pcard-amounts .k { color: #909399; }
.wb-pcard-amounts .v { color: #303133; font-weight: 600; font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; }
.wb-plan-progress-card.pay .wb-pcard-bar > div { background: #ff9a3d; }

/* 合同工作计划 - 区块头部 */
.wb-plan-section {
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
}
.wb-plan-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.wb-plan-section-header .wb-section-title { margin: 0; }

/* 合同工作计划 - 表格 */
.wb-plan-table .empty-state {
    text-align: center;
    padding: 24px;
    color: #909399;
}
/* 空状态：暂无数据时居中显示图标+文字 */
.empty-state {
  text-align: center !important;
  padding: 28px 16px !important;
  color: #999 !important;
  vertical-align: middle !important;
}
.empty-state i {
  display: block;
  font-size: 26px;
  margin-bottom: 6px;
  color: #ccc;
}
.empty-state p {
  margin: 0;
  font-size: 13px;
  color: #999;
}
.wb-plan-table .empty-state i { font-size: 28px; margin-bottom: 8px; display: block; }
.wb-plan-upload { color: #6C3FF5; cursor: pointer; }

/* ============== 详情视图（内嵌，非弹窗） ============== */
.wb-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid #ebeef5;
}
.wb-detail-header-actions { display: flex; align-items: center; gap: 8px; }
.wb-detail-header-actions .wb-tool-btn { padding: 5px 10px; }
.wb-detail-content { padding: 20px; }
.wb-detail-content .wb-detail-grid { display: grid; grid-template-columns: 1fr 1fr 280px; gap: 16px; }
.wb-detail-content .wb-section-title { margin-top: 14px; }
.wb-detail-content .wb-timeline { margin-bottom: 12px; }
.wb-detail-content .wb-detail-table th,
.wb-detail-content .wb-detail-table td { padding: 7px 10px; font-size: 12px; }
.wb-detail-content .wb-info-card h4 { margin-bottom: 10px; }
.wb-info-row { display: flex; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed #f0f0f0; }
.wb-info-row:last-child { border-bottom: none; }
.wb-info-row .k { width: 72px; color: #909399; flex-shrink: 0; }
.wb-info-row .v { color: #303133; flex: 1; word-break: break-all; }

/* ============== 合同计划 - 选择合同弹窗 ============== */
.wb-plan-contract-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.wb-plan-contract-search > label:first-child {
    font-size: 12px;
    color: #909399;
    flex-shrink: 0;
}
.wb-plan-contract-search > .wb-form-input {
    flex: 1;
    min-width: 0;
}
.wb-plan-contract-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wb-plan-contract-table th,
.wb-plan-contract-table td { border: 1px solid #ebeef5; padding: 7px 10px; text-align: left; }
.wb-plan-contract-table th { background: #f7f8fa; color: #606266; font-weight: 600; }
.wb-plan-contract-table tbody tr { cursor: pointer; transition: background .15s; }
.wb-plan-contract-table tbody tr:hover { background: #f5f7fa; }
.wb-plan-contract-table tbody tr.selected { background: #f0e6ff; }
.wb-plan-contract-pager {
    text-align: right;
    font-size: 12px;
    color: #909399;
    margin-top: 10px;
}

/* 系统提示弹窗 */
.wb-system-alert-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    font-size: 13px;
    color: #303133;
    line-height: 1.5;
}
.wb-system-alert-body i { font-size: 32px; color: #e6a23c; flex-shrink: 0; }

/* ============== 工作计划 - 行内编辑 ============== */
.wb-plan-edit-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    font-size: 12px;
    color: #303133;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}
.wb-plan-edit-input:focus {
    border-color: #6C3FF5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 63, 245, 0.08);
}
#wbPlanTableWrap tr td { vertical-align: middle; }

/* 负责人选择输入框（带下拉按钮） */
.wb-owner-input-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
}
.wb-owner-input-wrap > input {
    flex: 1;
    min-width: 0;
}
.wb-owner-picker-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    background: #f5f7fa;
    color: #606266;
    cursor: pointer;
    font-size: 12px;
    transition: all .15s;
}
.wb-owner-picker-btn:hover {
    border-color: #6C3FF5;
    color: #6C3FF5;
    background: #f3ecff;
}
.contract-form-cell .wb-owner-input-wrap > input,
.contract-form-cell .wb-owner-picker-btn,
.wb-form-cell .wb-owner-picker-btn {
    height: 32px;
}

/* 操作员选择弹窗 */
.wb-operator-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.wb-operator-search > .wb-form-input { flex: 1; min-width: 0; }
.wb-operator-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wb-operator-table th,
.wb-operator-table td { border: 1px solid #ebeef5; padding: 7px 10px; text-align: left; }
.wb-operator-table th { background: #f7f8fa; color: #606266; font-weight: 600; }
.wb-operator-table tbody tr { cursor: pointer; transition: background .15s; }
.wb-operator-table tbody tr:hover { background: #f5f7fa; }
.wb-operator-table tbody tr.selected { background: #f0e6ff; }

/* 合同列表行选中高亮（用于「合同计划」跳转指定合同） */
#workbenchTbody tr { cursor: pointer; }
#workbenchTbody tr.selected { background-color: #f3ecff; }
#workbenchTbody tr.selected:hover { background-color: #ecdcff; }

/* ---------- 工作计划「确认完成」弹窗 ---------- */
#wbPlanDoneModal .modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(108, 63, 245, .18);
}
#wbPlanDoneModal .modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f5;
    background: linear-gradient(180deg, #faf8ff 0%, #fff 100%);
}
#wbPlanDoneModal .modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    display: flex;
    align-items: center;
    gap: 6px;
}
#wbPlanDoneModal .modal-body { padding: 18px 20px 6px; }
#wbPlanDoneModal .modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f5;
    gap: 10px;
}

.wb-plan-done-summary {
    background: #f7f4ff;
    border: 1px solid #e6dcff;
    border-left: 3px solid #6C3FF5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.wb-plan-done-name {
    font-size: 14px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 4px;
    word-break: break-all;
}
.wb-plan-done-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #909399;
}
.wb-plan-done-sub b { color: #606266; font-weight: 600; }

.wb-plan-done-field { margin-bottom: 14px; }
.wb-plan-done-field > label {
    display: block;
    font-size: 12px;
    color: #606266;
    margin-bottom: 6px;
    font-weight: 600;
}
.wb-plan-done-field > label .req { color: #f56c6c; font-style: normal; }
.wb-plan-done-field input[type="datetime-local"],
.wb-plan-done-field textarea {
    width: 100%;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    color: #303133;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.wb-plan-done-field input[type="datetime-local"]:focus,
.wb-plan-done-field textarea:focus {
    border-color: #6C3FF5;
    box-shadow: 0 0 0 3px rgba(108, 63, 245, .12);
}
.wb-plan-done-field textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.wb-plan-done-static {
    font-size: 13px;
    color: #303133;
    background: #f7f8fa;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 7px 10px;
}

/* 详情页工作计划表：附件上传 / 操作（确认/取消完成，合并按钮） */
.wb-detail-table .wb-plan-action-btn,
.wb-detail-table .wb-plan-detail-upload {
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
    transition: opacity .2s, transform .2s;
}
.wb-detail-table .wb-plan-action-btn:hover,
.wb-detail-table .wb-plan-detail-upload:hover {
    opacity: .78;
    transform: translateY(-1px);
    text-decoration: underline;
}
.wb-detail-table .wb-plan-detail-upload {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* 弹窗内：确认类型选择器（收款/付款 radio 组） */
.wb-plan-done-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 0;
}
.wb-plan-done-type-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1.5px solid #dcdfe6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .2s;
    user-select: none;
}
.wb-plan-done-type-option:hover {
    border-color: #c0c4cc;
    background-color: #f5f7fa;
}
.wb-plan-done-type-option:has(input:checked) {
    border-color: #6C3FF5;
    background-color: #f0edff;
    box-shadow: 0 0 0 2px rgba(108,63,245,.12);
}
.wb-plan-done-type-option input[type="radio"] {
    accent-color: currentColor;
    margin: 0;
}

/* ===================== 深色模式适配：合同工作台 / 合同计划 / 合同进度 ===================== */
[data-theme="dark"] .wb-workbench-card {
    background: var(--crm-surface);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
/* 工具栏 / 筛选条 / 底部分页 */
[data-theme="dark"] .wb-toolbar { border-bottom-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-tool-title { color: var(--crm-text); }
[data-theme="dark"] .wb-filter-summary { color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-fs-item b { color: var(--crm-text); }
[data-theme="dark"] .wb-tool-btn {
    background: var(--crm-surface2);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--crm-text-secondary);
}
[data-theme="dark"] .wb-tool-btn:hover { color: var(--crm-primary-light); border-color: rgba(108, 63, 245, 0.5); }
[data-theme="dark"] .wb-table-footer,
[data-theme="dark"] .wb-sticky-bottom { background: var(--crm-surface); }
/* 分页暗色适配 */
[data-theme="dark"] .wb-pagination { color: #9AA3B5; }
[data-theme="dark"] .wb-page-btn {
    background: var(--crm-surface2);
    border-color: rgba(255, 255, 255, 0.12);
    color: #9AA3B5;
}
[data-theme="dark"] .wb-page-btn:hover:not(:disabled):not(.disabled) { color: #b794f6; border-color: rgba(108, 63, 245, 0.5); }
[data-theme="dark"] .wb-page-btn.active { background: #6C3FF5; border-color: #6C3FF5; color: #fff; }
[data-theme="dark"] .wb-page-size-select {
    background: var(--crm-surface2);
    border-color: rgba(255, 255, 255, 0.12);
    color: #9AA3B5;
}
[data-theme="dark"] .wb-page-size-select:focus { border-color: #6C3FF5; outline: none; }

/* 工作台表格 + 合同列表补充边框：浅灰网格线 → 柔和半透明线 */
[data-theme="dark"] .crm-table.wb-table th,
[data-theme="dark"] .crm-table.wb-table td { border-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] #contractTable th,
[data-theme="dark"] #contractTable td { border-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .crm-table.wb-table thead th { background: var(--crm-surface2); }
/* 数据行背景：暗色模式补全 */
[data-theme="dark"] .crm-table.wb-table tbody tr { background: var(--crm-surface); }
[data-theme="dark"] .crm-table.wb-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] #contractTable tbody tr { background: var(--crm-surface); }
[data-theme="dark"] #contractTable tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .wb-empty-row td { border-bottom-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .wb-table tfoot .wb-tfoot,
[data-theme="dark"] .wb-table tfoot .wb-tfoot-tail { background: var(--crm-surface2); }
[data-theme="dark"] .wb-table tfoot .wb-tfoot td {
    color: var(--crm-text);
    border-top-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .wb-table tfoot .wb-tfoot-lead .val { color: var(--crm-text-secondary); }

/* 进度条轨道 */
[data-theme="dark"] .wb-progress .bar { background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .wb-progress .pct { color: var(--crm-text-secondary); }

/* 合同进度（详情）视图：明细表格 + 信息卡 */
[data-theme="dark"] .wb-detail-table th,
[data-theme="dark"] .wb-detail-table td { border-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .wb-detail-table th { background: var(--crm-surface2); color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-info-card,
[data-theme="dark"] .wb-pcard,
[data-theme="dark"] .wb-plan-progress-card {
    background: var(--crm-surface);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .wb-pcard .big { color: var(--crm-text); }
[data-theme="dark"] .wb-pcard .t,
[data-theme="dark"] .wb-pcard .sub { color: var(--crm-text-secondary); }

/* 合同计划视图：基础信息卡 / 日历 / 项目选择 */
[data-theme="dark"] .wb-plan-basic-card,
[data-theme="dark"] .wb-plan-wb-calendar,
[data-theme="dark"] .wb-plan-section,
[data-theme="dark"] .wb-plan-calendar-tooltip {
    background: var(--crm-surface);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--crm-text);
}
[data-theme="dark"] .wb-plan-calendar-tooltip::before {
    background: var(--crm-surface);
    border-left-color: rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.08);
}
/* 日历日期格子暗色适配 */
[data-theme="dark"] .wb-plan-calendar-day { color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-plan-calendar-day.today { background: rgba(108, 63, 245, 0.2); color: #b794f6; font-weight: 700; }
[data-theme="dark"] .wb-plan-calendar-day.has-event { background: rgba(82, 196, 26, 0.15); }
[data-theme="dark"] .wb-plan-calendar-day.has-event:hover { background: rgba(82, 196, 26, 0.25); }
[data-theme="dark"] .wb-plan-calendar-day .wb-plan-calendar-dot { background: #52c41a; }
[data-theme="dark"] .wb-plan-calendar-nav button { background: var(--crm-surface2); border-color: rgba(255, 255, 255, 0.12); color: #9AA3B5; }
[data-theme="dark"] .wb-plan-calendar-nav button:hover { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-plan-calendar-weekday { color: #6b7280; }
[data-theme="dark"] .wb-plan-calendar-header h4 { color: var(--crm-text); }

/* 计划-关联合同表 */
[data-theme="dark"] .wb-plan-contract-table th,
[data-theme="dark"] .wb-plan-contract-table td { border-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .wb-plan-contract-table th { background: var(--crm-surface2); color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-plan-contract-table tbody tr:hover { background: rgba(108, 63, 245, 0.08); }
[data-theme="dark"] .wb-plan-contract-table tbody tr.selected { background: rgba(108, 63, 245, 0.15); }

/* 计划编辑表格行状态 */
[data-theme="dark"] .wb-plan-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .wb-plan-table tbody tr.selected { background: rgba(108, 63, 245, 0.15); }
[data-theme="dark"] .wb-plan-table tbody tr.editing { background: rgba(245, 158, 11, 0.1); }

/* ===================== 深色模式补充：合同计划视图 ===================== */
/* 基本信息卡片文字（深色底上不可见的深灰字） */
[data-theme="dark"] .wb-plan-basic-card h4 { color: var(--crm-text); }
[data-theme="dark"] .wb-plan-basic-cell .k { color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-plan-basic-cell .v { color: var(--crm-text); }
[data-theme="dark"] .wb-section-title { color: var(--crm-text); }

/* 计划明细：输入框白底问题（含 #wbPlanWbTableWrap 高优先级覆盖） */
[data-theme="dark"] .wb-plan-edit-input,
[data-theme="dark"] #wbPlanWbTableWrap .wb-plan-edit-input {
    background: var(--crm-surface2);
    color: var(--crm-text);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .wb-plan-edit-input:focus { border-color: var(--crm-primary); }
[data-theme="dark"] .wb-plan-edit-input:disabled {
    background: transparent;
    color: var(--crm-text-secondary);
    border-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .wb-plan-edit-input::placeholder { color: var(--crm-text-secondary); opacity: 0.6; }
/* 日期选择器图标在深色下反色 */
[data-theme="dark"] .wb-plan-edit-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }
/* 已完成置灰行 */
[data-theme="dark"] #wbPlanWbTableWrap tr.row-disabled td { color: var(--crm-text-secondary); }
[data-theme="dark"] #wbPlanWbTableWrap tr.row-disabled .wb-plan-edit-input { color: var(--crm-text-secondary) !important; }
[data-theme="dark"] #wbPlanWbTableWrap tr.row-disabled .badge-wb {
    color: var(--crm-text-secondary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}
/* 状态徽章 */
[data-theme="dark"] .badge-wb-warn { background: rgba(224, 138, 43, 0.15); color: #E8A24B; }
[data-theme="dark"] .badge-wb-ok { background: rgba(82, 196, 26, 0.15); color: #7ED957; }
/* 详情视图信息行文字 */
[data-theme="dark"] .wb-info-card h4 { color: var(--crm-text); }
[data-theme="dark"] .wb-info-row .k { color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-info-row .v { color: var(--crm-text); }
[data-theme="dark"] .wb-info-row { border-bottom-color: rgba(255, 255, 255, 0.06); }

/* ===================== 深色模式补充：合同进度（详情）视图 ===================== */
/* 头部与标签页 */
[data-theme="dark"] .wb-detail-header { border-bottom-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-detail-tabs { border-bottom-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-detail-tabs span { color: var(--crm-text-secondary); }
/* 流程时间轴 */
[data-theme="dark"] .wb-tl-dot { background: rgba(255, 255, 255, 0.08); color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-tl-line { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-tl-label { color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-tl-node.done .wb-tl-label,
[data-theme="dark"] .wb-tl-node.cur .wb-tl-label { color: var(--crm-text); }
/* 收款/付款流程图标题 */
[data-theme="dark"] .wb-flowchart-caption { color: var(--crm-text); border-left-color: rgba(255, 255, 255, 0.2); }
[data-theme="dark"] .wb-flowchart-rec { color: var(--crm-primary-light); border-left-color: var(--crm-primary); }
[data-theme="dark"] .wb-flowchart-pay { color: #4CC38A; border-left-color: #4CC38A; }
/* 小进度条轨道 */
[data-theme="dark"] .wb-mini-bar { background: rgba(255, 255, 255, 0.1); }
/* 徽章与弱化文字 */
[data-theme="dark"] .badge-wb-na { background: rgba(255, 255, 255, 0.06); color: var(--crm-text-secondary); }
[data-theme="dark"] .wb-muted { color: var(--crm-text-secondary); }
/* 进度卡片标题 */
[data-theme="dark"] .wb-plan-progress-card .t { color: var(--crm-text-secondary); }

/* 深色模式修正：信息行虚线用灰色、字段名提亮 */
[data-theme="dark"] .wb-info-row { border-bottom: 1px dashed #4A5060; }
[data-theme="dark"] .wb-info-row .k { color: #9AA3B5; }
[data-theme="dark"] .wb-info-row .v { color: #E6E9F0; }
[data-theme="dark"] .wb-info-card h4 { color: #F0F2F6; }

/* 深色模式修正：合同计划基本信息字段同步提亮 */
[data-theme="dark"] .wb-plan-basic-cell .k { color: #9AA3B5; }
[data-theme="dark"] .wb-plan-basic-cell .v { color: #E6E9F0; }
[data-theme="dark"] .wb-plan-basic-card h4 { color: #F0F2F6; }
[data-theme="dark"] .wb-section-title { color: #F0F2F6; }

/* 深色模式微调：字段值更亮、虚线更暗 */
[data-theme="dark"] .wb-info-row .v,
[data-theme="dark"] .wb-plan-basic-cell .v { color: #F5F7FA; font-weight: 500; }
[data-theme="dark"] .wb-info-row { border-bottom: 1px dashed #363B49; }

/* 深色模式修正：合同进度-基本信息3列布局（.wb-info-cell） */
[data-theme="dark"] .wb-info-3row { border-bottom: 1px dashed #363B49; }
[data-theme="dark"] .wb-info-cell .k { color: #9AA3B5; }
[data-theme="dark"] .wb-info-cell .v { color: #F5F7FA; font-weight: 500; }

/* 深色模式修正：收款/付款进度卡（pcard） */
[data-theme="dark"] .wb-pcard-title { color: #F0F2F6; }
[data-theme="dark"] .wb-pcard-bar { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wb-pcard-amounts > div { border-top: 1px dashed #363B49; }
[data-theme="dark"] .wb-pcard-amounts .k { color: #9AA3B5; }
[data-theme="dark"] .wb-pcard-amounts .v { color: #F5F7FA; }
[data-theme="dark"] .wb-pcard.pay .wb-pcard-pct { color: #FFB347; }
