/* === 明日装机计划 SOTA === */
.tp-page {
  background: var(--clr-muted, #f8fafc);
  padding: 0 0 80px;
  box-sizing: border-box;
  min-height: 100%;
}

/* --- 顶栏 --- */
.tp-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tp-app-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}
.tp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-filter {
  width: 180px;
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}
@media (max-width: 600px) {
  .tp-filter { width: 100%; order: 10; }
}

/* --- 汇总条 --- */
.tp-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.tp-stat {
  padding: 10px 16px;
  font-size: 13px;
  color: #64748b;
  border-right: 1px solid #f1f5f9;
  text-align: center;
  min-width: 72px;
}
.tp-stat:last-child { border-right: none; }
.tp-stat b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.tp-stat.warn b { color: #dc2626; }

/* --- 首页装维卡片 --- */
.tp-workers-list {
  padding: 12px 16px;
}
.tp-branch-sec {
  margin-bottom: 16px;
}
.tp-branch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  margin-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}
.tp-branch-name {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.tp-branch-stats {
  font-size: 12px;
  color: #64748b;
}
.tp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.tp-wk-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  gap: 10px;
}
.tp-wk-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.tp-wk-card[data-tone="red"] { border-left: 3px solid #ef4444; }
.tp-wk-card[data-tone="amber"] { border-left: 3px solid #f59e0b; }
.tp-wk-card[data-tone="green"] { border-left: 3px solid #22c55e; }
.tp-wk-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.tp-wk-info {
  flex: 1;
  min-width: 0;
}
.tp-wk-name {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}
.tp-wk-meta {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-wk-nums {
  text-align: right;
  flex-shrink: 0;
}
.tp-wk-nums b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #2563eb;
}
.tp-wk-nums small {
  font-size: 10px;
  color: #94a3b8;
}
.tp-wk-overdue-tag {
  font-size: 10px;
  background: #fef2f2;
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* --- 详情页 --- */
.tp-detail-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tp-detail-who {
  flex: 1;
  min-width: 0;
}
.tp-detail-name {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}
.tp-detail-meta {
  font-size: 12px;
  color: #64748b;
}

/* --- Tabs --- */
.tp-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
}
.tp-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tp-tab:hover { color: #0f172a; }
.tp-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.tp-tab b {
  margin-left: 4px;
  font-weight: 700;
  font-size: 13px;
}

/* --- Filter chips --- */
.tp-chips {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.tp-chip {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all .12s;
}
.tp-chip:hover { border-color: #94a3b8; }
.tp-chip.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* --- 工单列表 --- */
.tp-order-list {
  padding: 12px 16px 20px;
}
.tp-comm-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}
.tp-comm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #e2e8f0;
}
.tp-comm-head:hover { background: #f1f5f9; }
.tp-comm-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tp-comm-arrow {
  font-size: 10px;
  color: #94a3b8;
  transition: transform .15s;
  flex-shrink: 0;
}
.tp-comm-section.collapsed .tp-comm-arrow { transform: rotate(-90deg); }
.tp-comm-section.collapsed .tp-comm-body { display: none; }
.tp-comm-name {
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}
.tp-comm-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
}
.tp-comm-body {
  /* orders inside */
}

/* 工单行 */
.tp-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.tp-row:last-child { border-bottom: none; }
.tp-row:hover { background: #f8fafc; }
.tp-row.checked { background: #eff6ff; }
.tp-row-check {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
.tp-row-body {
  flex: 1;
  min-width: 0;
}
.tp-row-title {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.4;
}
.tp-row-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.4;
}
.tp-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 5px;
  font-weight: 600;
  vertical-align: middle;
}
.tp-b-over { background: #fef2f2; color: #b91c1c; }
.tp-b-tm { background: #ecfdf5; color: #047857; }
.tp-b-src { background: #f1f5f9; color: #475569; }
.tp-b-zhili { background: #fef3c7; color: #92400e; }
.tp-b-ok { background: #dbeafe; color: #1d4ed8; }
.tp-b-no { background: #f1f5f9; color: #64748b; }
.tp-b-special { background: #ffedd5; color: #c2410c; font-weight: 700; }

/* 小区内计数标签 */
.tp-comm-cnt {
  font-size: 11px;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.tp-comm-cnt-z {
  background: #fef3c7;
  color: #92400e;
}

/* 被动/主动分区折叠 */
.tp-sub-section { }
.tp-sub-section.collapsed .tp-sub-body { display: none; }
.tp-sub-section.collapsed .tp-sub-arrow { transform: rotate(-90deg); display: inline-block; }
.tp-sub-arrow {
  display: inline-block;
  font-size: 10px;
  margin-right: 4px;
  transition: transform 0.15s;
}
.tp-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
  border-top: 1px solid #f1f5f9;
}
.tp-section-toggle {
  cursor: pointer;
  user-select: none;
}
.tp-section-toggle:hover { background: #f1f5f9; }

/* 详情页统计条 */
.tp-detail-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.tp-ds {
  font-size: 12px;
  color: #64748b;
}
.tp-ds b {
  font-weight: 700;
  color: #0f172a;
  margin-left: 2px;
}

/* 首页卡片已选标 */
.tp-wk-sel-tag {
  font-size: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
}
.tp-wk-zhili {
  display: block;
  font-size: 10px;
  color: #92400e;
  font-weight: 500;
}

/* --- 底部固定操作栏 --- */
.tp-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.tp-bottom-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-sel-count {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
}

/* --- 计划预览 --- */
.tp-plan-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  max-height: 50vh;
  overflow: auto;
  margin: 0;
}
.tp-plan-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- 空状态 / 加载 --- */
.tp-loading, .tp-empty {
  padding: 40px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* --- 手机适配 --- */
@media (max-width: 600px) {
  .tp-topbar-actions { width: 100%; }
  .tp-card-grid { grid-template-columns: 1fr; }
  .tp-bottom-bar { flex-wrap: wrap; }
  .tp-tabs { overflow-x: auto; }
}
