/* 内部 APP 安装引导 */
.install-area { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border, #e2e8f0); text-align: center; }
.install-btn {
  width: 100%; padding: 10px 14px; border: 1px solid var(--primary, #2563eb);
  border-radius: 8px; background: transparent; color: var(--primary, #2563eb);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.install-btn:hover { background: rgba(37, 99, 235, .06); }
.install-tip { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--muted, #64748b); }

/* 模板导入弹窗 */
.imp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.imp-toolbar .btn { text-decoration: none; display: inline-flex; align-items: center; }
.imp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #64748b); cursor: pointer; }
.imp-errors {
  margin: 10px 0; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; line-height: 1.7;
}
#impPreview table { font-size: 13px; }
#impPreview th { white-space: nowrap; }

/* 独立 APP 模式下留出顶部安全区 */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* 每页操作提示条 */
.op-hint {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 11px 14px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; color: #1e40af;
}
.op-hint-icon {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.op-hint-text { flex: 1; font-size: 13px; line-height: 1.65; }
.op-hint-text strong { font-weight: 700; }
.op-hint .btn { flex: 0 0 auto; white-space: nowrap; background: #fff; }
.op-hint-close { flex: 0 0 auto; border: 0; background: transparent; color: #64748b; font-size: 20px; cursor: pointer; line-height: 1; }

/* 可排序表头 */
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { color: var(--primary, #2563eb); background: #eef2ff; }
.sort-ind { color: #94a3b8; font-size: 11px; margin-left: 2px; }
.sort-bar { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.sort-bar select { padding: 5px 8px; border: 1px solid var(--border, #e2e8f0); border-radius: 7px; font-size: 13px; background: #fff; }

/* 行内数量输入 / 快速录入行 / 合计行 */
.qty-input { width: 82px; padding: 5px 7px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px; text-align: center; }
.qty-input:focus { border-color: var(--primary, #2563eb); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); outline: none; }
.quick-add tr { background: #f8fafc; }
.quick-add td { border-top: 2px dashed #cbd5e1; padding: 9px 8px; }
.quick-add input { width: 100%; min-width: 78px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px; background: #fff; }
.quick-add input:focus { border-color: var(--primary, #2563eb); outline: none; }
.quick-add input[type=number] { max-width: 100px; }
.sum-row td { background: #eff6ff; font-weight: 700; color: #1e40af; border-top: 2px solid #bfdbfe; }

/* 操作指南页 */
.guide-hero { background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff; border-radius: 14px; padding: 26px 28px; margin-bottom: 18px; }
.guide-hero h2 { margin: 0 0 8px; font-size: 22px; }
.guide-hero p { margin: 0; opacity: .92; font-size: 14px; line-height: 1.7; }
.guide-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.guide-step { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 18px; }
.guide-num { display: inline-flex; width: 28px; height: 28px; border-radius: 8px; background: #2563eb; color: #fff;
  align-items: center; justify-content: center; font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.guide-step h3 { margin: 0 0 8px; font-size: 15px; }
.guide-step p { margin: 0; font-size: 13px; color: #64748b; line-height: 1.75; }
.guide-card { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.guide-card h3 { margin: 0 0 12px; font-size: 16px; }
.guide-card ol, .guide-card ul { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 2; color: #334155; }
.guide-card table { font-size: 13px; }
.guide-card td { vertical-align: top; }
.guide-note { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 14px 16px; border-radius: 10px; font-size: 13px; line-height: 1.8; }

@media (max-width: 760px) {
  .guide-steps { grid-template-columns: 1fr; }
  .op-hint { flex-wrap: wrap; }
  .op-hint-text { flex-basis: calc(100% - 40px); }
  .sort-bar { margin-top: 8px; }
  .qty-input { width: 68px; }
}

/* 表格上方的快速录入条 */
.quick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; margin-bottom: 12px; }
.quick-bar-title { font-size: 13px; font-weight: 700; color: #1e40af; white-space: nowrap; margin-right: 2px; }
.quick-bar input { width: 132px; padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px; background: #fff; }
.quick-bar input[type=number] { width: 92px; }
.quick-bar input:focus { border-color: var(--primary, #2563eb); outline: none; }
.quick-amt { font-size: 13px; font-weight: 700; color: #2563eb; white-space: nowrap; min-width: 64px; }
.quick-bar .desc { font-size: 12px; }
@media (max-width: 760px) {
  .quick-bar input, .quick-bar input[type=number] { width: calc(50% - 6px); }
}

/* 宽表格：保证最后一列操作按钮不被挤出视窗 */
.tbl-budget, .tbl-sites { table-layout: fixed; width: 100%; }
.tbl-budget th, .tbl-budget td, .tbl-sites th, .tbl-sites td {
  white-space: normal; word-break: break-all; overflow-wrap: anywhere;
  padding: 9px 8px; vertical-align: top;
}
.tbl-budget th.col-action { width: 104px; }
.table-wrap table th.col-action, .table-wrap table td.col-action {
  position: sticky; right: 0; z-index: 2; background: #fff;
  box-shadow: -3px 0 6px rgba(15, 23, 42, .07);
}
.table-wrap table th.col-action { background: #f8fafc; }

/* 手机端：宽表格改为横向滑动，列宽自然，操作列仍固定在右侧 */
@media (max-width: 760px) {
  .tbl-budget, .tbl-sites { table-layout: auto; width: auto; min-width: 1080px; }
  .tbl-budget th, .tbl-budget td, .tbl-sites th, .tbl-sites td {
    white-space: nowrap; word-break: normal; overflow-wrap: normal; padding: 11px 14px;
  }
}

/* 工作台：待确认变更提醒条 */
.notice-bar {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 13px 16px;
  background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 10px;
}
.notice-ico {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #f59e0b; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
}
.notice-bar > div { flex: 1; font-size: 14px; line-height: 1.6; }
.notice-bar .desc { margin-top: 3px; }
.notice-bar .btn { flex: 0 0 auto; white-space: nowrap; }

/* 变更单卡片与附件 */
.chg-card .chg-content {
  margin-top: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #eef2f7;
  border-radius: 8px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
}
.att-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.att-img {
  width: 150px; height: 110px; object-fit: cover; border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px; cursor: pointer; background: #f8fafc;
}
.att-img:hover { border-color: var(--primary, #2563eb); }

/* 付款进度表 */
.tbl-pay { width: 100%; }
.tbl-pay th, .tbl-pay td { padding: 9px 8px; font-size: 13px; vertical-align: middle; }
.tbl-pay tfoot td { background: #fff; }
.tbl-pay .quick-bar { justify-content: flex-start; }
@media (max-width: 760px) {
  .tbl-pay { min-width: 900px; }
  .notice-bar { flex-wrap: wrap; }
}

/* 岗位化工作台：每人第一屏的常用动作 */
.quick-jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.quick-job {
  display: flex; align-items: center; gap: 12px; padding: 18px 16px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff;
  border: 0; border-radius: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; text-align: left; box-shadow: 0 3px 10px rgba(37, 99, 235, .18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.quick-job:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 99, 235, .28); }
.qj-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
@media (max-width: 760px) {
  .quick-jobs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-job { padding: 14px 12px; font-size: 13px; }
}

/* 施工节点 / 验收 / 保修 / 线索 / 复盘宽表格 */
.tbl-stages { table-layout: fixed; width: 100%; }
.tbl-stages th, .tbl-stages td {
  white-space: normal; word-break: break-all; overflow-wrap: anywhere;
  padding: 9px 8px; vertical-align: top;
}
.tbl-stages th.col-action { width: 132px; }
.row-alert { background: #fff7f7; }
.row-alert:hover { background: #fff1f1; }
.warn-text { color: #dc2626; font-size: 12px; margin-top: 4px; }
.rectify-box {
  margin-top: 10px; padding: 10px 12px; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 8px; color: #991b1b; font-size: 13px; line-height: 1.7;
}
.notice-red { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.notice-red .notice-ico { background: #dc2626; }
.notice-red strong { color: #991b1b; }

/* 待办中心 */
.todo-group .section-title { margin-bottom: 6px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.todo-item:last-child { border-bottom: none; }
.todo-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }
.todo-dot.red { background: #dc2626; }
.todo-dot.amber { background: #f59e0b; }
.todo-dot.blue { background: #2563eb; }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; color: #0f172a; }
.todo-item .btn { flex: 0 0 auto; }
.timeline-item { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.timeline-item:last-child { border-bottom: none; }

.pwd-split { height: 1px; background: #e2e8f0; margin: 22px 0 18px; }
#modalFoot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* 成本台账 / 成员账号：列多，允许换行并给操作列留宽度 */
.tbl-cost, .tbl-users { min-width: 940px; }
.tbl-cost th, .tbl-cost td, .tbl-users th, .tbl-users td { vertical-align: middle; }
.tbl-cost td, .tbl-users td { white-space: normal; word-break: break-word; }
.tbl-cost td:last-child, .tbl-users td:last-child { white-space: nowrap; }
.tbl-cost td .btn, .tbl-users td .btn { margin: 2px 3px 2px 0; }

/* 供应商库：9 列名录，允许换行并横向滚动 */
.tbl-sup { min-width: 1080px; }
.tbl-sup th, .tbl-sup td { vertical-align: middle; white-space: normal; word-break: break-word; }
.tbl-sup td:last-child { white-space: nowrap; }
.tbl-sup td .btn { margin: 2px 3px 2px 0; }
.filters { flex-wrap: wrap; }
.filters select, .filters input { min-width: 108px; }

/* 项目成员：按部门勾选的卡片式多选 */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.pm-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; cursor: pointer; }
.pm-item.on { border-color: #2563eb; background: #eff6ff; }
.pm-item input { width: 15px; height: 15px; accent-color: #2563eb; flex: 0 0 auto; }
.pm-item span { display: flex; flex-direction: column; min-width: 0; }
.pm-item strong { font-size: 13px; font-weight: 600; color: #0f172a; }
.pm-item small { font-size: 11px; color: #64748b; margin-top: 2px; }

@media (max-width: 760px) {
  .tbl-stages { table-layout: auto; width: auto; min-width: 1240px; }
  .tbl-stages th, .tbl-stages td {
    white-space: nowrap; word-break: normal; overflow-wrap: normal; padding: 11px 14px;
  }
  .todo-item { flex-wrap: wrap; }
  .todo-body { flex-basis: calc(100% - 30px); }
}
