/* ========== 全局 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1e6fff;
  --primary-dark: #1558d6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --header-h: 60px;
  --sidebar-w: 210px;
}

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-50);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  outline: none;
  background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12);
}
textarea { resize: vertical; }

/* ========== 顶部标题栏 ========== */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(90deg, #0f3a8f 0%, #1e6fff 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.top-header__title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-right: 16px;
}
.top-header__subtitle {
  font-size: 14px;
  opacity: 0.9;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.35);
}
.top-header__spacer { flex: 1; }
.top-header__meta { font-size: 14px; opacity: 0.9; }

/* ========== 主体布局 ========== */
.app-body {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
}
.sidebar__nav { padding: 16px 0; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--gray-700);
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.nav-item:hover { background: var(--gray-50); color: var(--primary); }
.nav-item.active {
  background: #eaf2ff;
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item__icon {
  width: 22px;
  margin-right: 10px;
  text-align: center;
  font-size: 16px;
}
.sidebar__footer {
  padding: 16px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.8;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 24px 32px;
  min-width: 0;
}

/* ========== 视图 ========== */
.hidden { display: none !important; }
.view { animation: fadeIn 0.2s ease; }
.view.hidden { display: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
/* 采购清单标题行：左侧标题 + 右侧「报价总表」直达入口 */
.pricing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pricing-head .view__title { margin-bottom: 0; }
.view__desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

/* ========== 表单卡片 ========== */
.form-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  max-width: 900px;
}
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
}
.form-row .form-item { flex: 1; }
.form-item { margin-bottom: 18px; }
.form-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 500;
}
.required { color: var(--danger); margin-left: 2px; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-default { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-default:hover { background: var(--gray-50); border-color: var(--gray-500); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ========== 工具栏 ========== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar__left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar__left select, .toolbar__left input { width: auto; min-width: 140px; }
.toolbar__right .stat { color: var(--gray-500); font-size: 13px; }
.toolbar__right .stat b { color: var(--primary); font-size: 16px; }

/* ========== 表格 ========== */
.table-wrap {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead {
  background: var(--gray-50);
}
.data-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-900);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f1f5ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.cell-link { color: var(--gray-900); font-weight: 600; }

/* 订单列表：新订单（未分配跟进人）整行标黄提醒，跟进后恢复；不做淡化处理 */
.data-table tr.order-new td { color: #b45309; }
.data-table tr.order-new td .cell-muted { color: #b45309; }

/* 订单列表：单元格横向等距 padding，列间空隙统一 */
#view-order-list .data-table th,
#view-order-list .data-table td { padding-left: 22px; padding-right: 22px; }
#view-order-list .data-table th:first-child,
#view-order-list .data-table td:first-child { padding-left: 12px; }
#view-order-list .data-table th:last-child,
#view-order-list .data-table td:last-child { padding-right: 12px; }

.table-empty {
  text-align: center;
  color: var(--gray-500);
  padding: 60px 20px !important;
}

/* ========== 状态标签 ========== */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-新订单 { background: #111827; color: #fff; }
.status-已派单 { background: #fef3c7; color: #b45309; }
.status-施工中 { background: #e0e7ff; color: #4338ca; }
.status-已完工 { background: #dcfce7; color: #15803d; }
.status-已取消 { background: #fee2e2; color: #b91c1c; }

/* 结算状态标签（订单列表「结算状态」列） */
.settle-tag--done { background: #ccfbf1; color: #0f766e; }
.settle-tag--pending { background: #fef9c3; color: #a16207; }

/* 勾选框列 */
.cell-check { text-align: center; }
.cell-check input[type="checkbox"],
.data-table th input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
  accent-color: var(--primary);
}

/* ========== 面板（详情卡片通用） ========== */
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.panel__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

/* ========== 详情页（订单 / 师傅） ========== */
.detail-topbar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-top: -12px;
  margin-bottom: 6px;
  background: var(--gray-50);
}
.detail-topbar__ops { display: flex; align-items: center; gap: 12px; }
.save-hint { font-size: 13px; color: var(--gray-500); }
.save-hint.is-dirty { color: var(--warning); font-weight: 600; }

/* Hero 头部横幅（两页配色不同，避免雷同） */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 16px;
  color: #fff;
}
.hero--order {
  background: linear-gradient(120deg, #1a5fe0, #2f7bff 55%, #63a4ff);
  box-shadow: 0 8px 20px rgba(30,111,255,0.20);
}
.hero--master {
  background: linear-gradient(120deg, #0b6b5f, #12a08c 55%, #2fcaa8);
  box-shadow: 0 8px 20px rgba(16,160,140,0.20);
}
.hero__identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hero__avatar {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.55);
}
.hero__main { min-width: 0; }
.hero__eyebrow { font-size: 12px; opacity: 0.85; margin-bottom: 8px; letter-spacing: 0.5px; }
.hero__eyebrow b { font-weight: 600; letter-spacing: 1px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; }
.hero__chip {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 4px 12px;
}
.hero__side { flex: none; }
.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 999px;
}
/* Hero 内嵌编辑控件 */
.hero__input {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  padding: 5px 12px;
  width: 280px;
  max-width: 100%;
  outline: none;
  font-family: inherit;
}
.hero__input--sm { font-size: 13px; font-weight: 400; padding: 5px 12px; width: 170px; border-radius: 999px; }
.hero__input::placeholder { color: rgba(255,255,255,0.6); }
.hero__input:focus { background: rgba(255,255,255,0.3); }
.hero__select {
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 双栏布局：订单详情（左信息 + 右派单） */
.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.detail-columns__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-columns__side { position: sticky; top: 0; }
@media (max-width: 1200px) {
  .detail-columns { grid-template-columns: 1fr; }
  .detail-columns__side { position: static; }
}

/* 订单详情：紧凑布局 */
#view-order-detail .detail-columns {
  gap: 12px;
  align-items: stretch;
}
#view-order-detail .detail-columns__main { gap: 12px; }
#view-order-detail .detail-columns__side { position: static; display: flex; flex-direction: column; gap: 12px; }
#view-order-detail .hero { padding: 14px 20px; margin-bottom: 12px; }
#view-order-detail .hero__input { font-size: 20px; padding: 4px 10px; }
#view-order-detail .hero__meta { margin-top: 6px; }
#view-order-detail .detail-card { padding: 14px 16px; }
#view-order-detail .detail-card .panel__title { font-size: 15px; margin-bottom: 10px; padding-bottom: 8px; }
#view-order-detail .detail-grid { row-gap: 10px; column-gap: 12px; }
#view-order-detail .detail-grid .value > input,
#view-order-detail .detail-grid .value > select { padding: 6px 10px; }
#view-order-detail .detail-block + .detail-block { margin-top: 10px; }
#view-order-detail .detail-block textarea { padding: 8px 12px; line-height: 1.5; }
#view-order-detail #detailDispatchText { height: 160px; }

/* 统计小卡片：师傅详情，点击可筛选下方接单记录 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-tile {
  background: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-top: 3px solid var(--primary);
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.10); }
.stat-tile--active { background: #f5f9ff; box-shadow: 0 0 0 2px var(--primary); }
.stat-tile--teal { border-top-color: #12a08c; }
.stat-tile--amber { border-top-color: #f59e0b; }
.stat-tile--rose { border-top-color: #f43f5e; }
.stat-tile__num { font-size: 24px; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.stat-tile__label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* 筛选条（订单列表 / 师傅管理 统一样式） */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 14px 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-item label::before {
  content: "";
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: var(--primary, #2563eb);
  opacity: 0.85;
}
.filter-item select,
.filter-item input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  background: #fff;
  color: var(--gray-800, #1f2937);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-item select { width: 170px; cursor: pointer; }
.filter-item select:hover,
.filter-item input:hover { border-color: var(--gray-400, #9ca3af); }
.filter-item select:focus,
.filter-item input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.filter-item--grow { flex: 1; min-width: 230px; }
/* 关键词搜索框：内嵌放大镜图标 */
.filter-item--grow input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 15px 15px;
  padding-left: 32px;
}
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.filter-bar .btn {
  height: 36px;
  padding: 0 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
}

/* 表格内的接单情况小标签 */
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-stat {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.mini-stat--total { background: #eef4ff; color: #1d4ed8; }
.mini-stat--active { background: #e6f7f4; color: #0f766e; }
.mini-stat--done { background: #fef3c7; color: #b45309; }
.mini-stat--cancelled { background: #fee2e2; color: #b91c1c; }

/* 面板标题右侧的小标签 */
.panel__title-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
}

.detail-card { margin-bottom: 0; }
.cell-muted { color: var(--gray-400); font-weight: 400; }

.detail-grid {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 78px minmax(0, 1fr);
  row-gap: 14px;
  column-gap: 14px;
  font-size: 14px;
}
.detail-grid .label { color: var(--gray-500); }
.detail-grid .value { color: var(--gray-900); font-weight: 500; word-break: break-all; }
.detail-grid .value.full { grid-column: 2 / -1; }

/* 内嵌编辑控件 */
.detail-grid .value > input,
.detail-grid .value > select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
}
.detail-grid .value > input:focus,
.detail-grid .value > select:focus { border-color: var(--primary); outline: none; }

.detail-block + .detail-block { margin-top: 16px; }
.detail-block__label { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.detail-block textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  color: var(--gray-900);
}
.detail-block textarea:focus { border-color: var(--primary); outline: none; }

.dispatch-form { display: flex; flex-direction: column; gap: 10px; }
.dispatch-form label { color: var(--gray-700); font-size: 14px; }
.dispatch-form select { width: 100%; }
.dispatch-form__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.dispatch-form__btns .btn { flex: 1; }

#detailDispatchText {
  width: 100%;
  min-height: 260px;
  margin-top: 12px;
  font-family: "Consolas", "Microsoft YaHei", monospace;
  font-size: 13px;
  line-height: 1.8;
  background: var(--gray-50);
}
.copy-hint { margin-top: 10px; font-size: 13px; color: var(--success); min-height: 20px; }
.copy-hint.error { color: var(--danger); }

/* ========== 排序指示器 ========== */
.data-table th.col-sort { cursor: pointer; user-select: none; }
.data-table th.col-sort:hover { color: var(--primary); }
.sort-indicator { display: inline-block; margin-left: 4px; color: var(--primary); font-weight: 700; }

/* ========== 施工留证（照片） ========== */
.evidence-panel { padding: 14px 16px; }
.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.evidence-col {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.evidence-col__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.evidence-col--before .evidence-col__head { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.evidence-col--after  .evidence-col__head { background: linear-gradient(90deg, #16a34a, #4ade80); }
.evidence-col--contract .evidence-col__head { background: linear-gradient(90deg, #1e6fff, #60a5fa); }
.evidence-grid--three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .evidence-grid--three { grid-template-columns: 1fr; } }
.evidence-col__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; opacity: 0.9;
}
.evidence-col__count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}
.evidence-col .photo-grid {
  padding: 10px;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
}
.photo-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  background: var(--gray-50);
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.photo-uploader:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f5f9ff;
}
.photo-uploader__plus { font-size: 20px; line-height: 1; }

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gray-100);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.photo-item__del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-item__del:hover { background: var(--danger); }

/* 照片放大查看器 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.lightbox__close:hover { background: rgba(255,255,255,0.25); }

/* 师傅列表列宽微调（去掉接单情况列后更协调） */
#view-master .data-table td:nth-child(6) { color: var(--gray-500); white-space: nowrap; }


/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: 10px;
  width: 680px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-200);
}
.modal__header h3 { font-size: 17px; }
.modal__close {
  background: none;
  font-size: 24px;
  color: var(--gray-500);
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.modal__close:hover { background: var(--gray-100); color: var(--gray-900); }
.modal__body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}
.modal__footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--gray-900);
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 4000; /* 需高于登录浮层(3000)，否则登录页上的提示会被遮挡 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== 登录浮层 ========== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f3a8f 0%, #1e6fff 100%);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-card {
  width: 400px;
  max-width: 92vw;
  background: #fff;
  border-radius: 14px;
  padding: 32px 34px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card__brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}
.login-card__title { font-size: 14px; color: var(--gray-700); margin-top: 6px; }
.login-card__sub {
  font-size: 12px;
  color: var(--gray-500);
  margin: 4px 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 6px;
  font-weight: 500;
}
.login-card .btn-block { margin-top: 6px; }
.login-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
}

/* ========== 顶部用户区 / 角色标签 ========== */
.top-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.35);
  font-size: 13px;
}
.role-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.role-tag--super { background: #fef3c7; color: #b45309; }
.role-tag--admin { background: #dbeafe; color: #1d4ed8; }
.btn-logout {
  background: rgba(255,255,255,0.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.32); }

/* 管理员不可见的超级管理员专属功能 */
body.role-admin .super-only { display: none !important; }
/* 分配按钮：普通管理员隐藏（超级管理员/高级管理员可见） */
body.role-admin:not(.role-senior) .assign-only { display: none !important; }

/* ========== 分配跟进人：多选人员 ========== */
.assign-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.assign-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: all 0.15s;
}
.assign-check:hover { border-color: var(--primary, #2563eb); }
.assign-check input { accent-color: var(--primary, #2563eb); }
.assign-check:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}
/* 超级管理员不显示的管理员提示 */
body.role-super .admin-only { display: none !important; }

/* ========== 高级管理员标签 ========== */
.role-tag--senior { background: #ede9fe; color: #6d28d9; }
/* 超级管理员标签：统一黄色（顶部深蓝栏与表格内一致） */
.role-tag--super { background: #f59e0b; color: #fff; }

/* ========== 账号管理：部门分组单元格 ========== */
.dept-cell {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary, #2563eb);
  text-align: center;
  vertical-align: middle;
  background: rgba(37, 99, 235, 0.06);
  border-right: 1px solid var(--gray-200, #e5e7eb);
}
.dept-cell--plain {
  color: var(--gray-500, #6b7280);
  background: var(--gray-50, #f9fafb);
  font-size: 13px;
}

/* ========== 在线状态标签 ========== */
.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.online-tag.online { color: #16a34a; }
.online-tag.offline { color: var(--gray-400); }

/* ========== 待验收状态标签 ========== */
.status-待验收 { background: #ffedd5; color: #c2410c; }

/* ========== 订单进度（流程化状态） ========== */
.flow-panel .flow-steps {
  display: flex;
  margin: 6px 0 14px;
}
.flow-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.flow-step::before,
.flow-step::after {
  content: '';
  position: absolute;
  top: 13px;
  height: 2px;
  width: 50%;
  background: var(--gray-200);
}
.flow-step::before { left: 0; }
.flow-step::after { right: 0; }
.flow-step:first-child::before,
.flow-step:last-child::after { display: none; }
.flow-step.done::before,
.flow-step.done::after,
.flow-step.current::before { background: var(--primary); }
.flow-step__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gray-300);
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
.flow-step.done .flow-step__dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.flow-step.current .flow-step__dot {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 111, 255, 0.15);
  font-weight: 700;
}
.flow-step__label {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.flow-step.current .flow-step__label { color: var(--primary); font-weight: 600; }
.flow-step.done .flow-step__label { color: var(--gray-700); }
.flow-cancelled {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  padding: 8px 0;
}
.flow-actions { border-top: 1px dashed var(--gray-200); padding-top: 12px; }
.flow-hint { font-size: 13px; color: var(--gray-700); line-height: 1.7; }
.flow-hint--wait { color: #b45309; }
.flow-hint--ok { color: #15803d; font-weight: 600; }
.flow-actions .accept-btns { display: flex; gap: 10px; margin-top: 8px; }

/* ========== 验收审批面板 ========== */
.accept-panel .accept-body { display: flex; flex-direction: column; gap: 6px; }
.accept-line { font-size: 13px; color: var(--gray-700); line-height: 1.7; }
.accept-line--ok { color: #15803d; font-weight: 600; }
.accept-line--wait { color: #b45309; }
.accept-line--reject { color: #b91c1c; font-weight: 600; }
.accept-time { display: block; font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.accept-btns { display: flex; gap: 10px; margin-top: 8px; }
.accept-btns .btn { flex: none; }
.accept-tag--待验收 { background: #ffedd5; color: #c2410c; }
.accept-tag--已通过 { background: #dcfce7; color: #15803d; }
.accept-tag--已驳回 { background: #fee2e2; color: #b91c1c; }

/* ========== 左侧导航红点 ========== */
.nav-item { position: relative; }
.nav-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.45);
}
.nav-badge.show { display: block; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ========== 审批中心 ========== */
.ap-stats { display: flex; gap: 12px; margin-bottom: 14px; }
.ap-stat {
  flex: 1;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 14px 18px;
  border-top: 3px solid var(--primary, #2563eb);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ap-stat--ok { border-top-color: #16a34a; }
.ap-stat--no { border-top-color: #dc2626; }
.ap-stat--expired { border-top-color: #9ca3af; }
.ap-stat__num { font-size: 24px; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.ap-stat__label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.ap-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ap-tab {
  border: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
  color: var(--gray-700, #374151);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.ap-tab:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.ap-tab.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; font-weight: 600; }

.ap-list { display: flex; flex-direction: column; gap: 10px; }
.ap-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ap-card--approved { border-left-color: #16a34a; }
.ap-card--rejected { border-left-color: #dc2626; }
.ap-card--accept { border-left-color: #d97706; }
.ap-card--master { border-left-color: #7c3aed; }
.ap-card--expired { border-left-color: #9ca3af; opacity: 0.75; }
.ap-type--master { background: #f5f3ff; color: #6d28d9; }
.ap-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-type {
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  background: #eff6ff; color: #1d4ed8;
  flex: 0 0 auto;
}
.ap-type--accept { background: #fff7ed; color: #c2410c; }
/* 「我提交的」标记：提醒审批人该条红点不会计入自己 */
.ap-mine {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #fef9c3; color: #a16207; flex: 0 0 auto;
}
.ap-card__title { font-weight: 600; color: var(--gray-900, #111827); flex: 1 1 auto; min-width: 0; }
.ap-status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; flex: 0 0 auto; }
.ap-status--pending { background: #fef3c7; color: #b45309; }
.ap-status--approved { background: #dcfce7; color: #15803d; }
.ap-status--rejected { background: #fee2e2; color: #b91c1c; }
.ap-status--expired { background: #f3f4f6; color: #6b7280; }
.ap-card__meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--gray-600, #4b5563);
  display: flex; flex-wrap: wrap; gap: 4px 18px;
}
.ap-card__ops { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
.ap-card__ops--hint { justify-content: flex-start; font-size: 12px; color: var(--gray-400, #9ca3af); }
.ap-btn { padding: 5px 14px; font-size: 13px; }
.ap-empty {
  background: #fff;
  border: 1px dashed var(--gray-200, #e5e7eb);
  border-radius: 10px;
  padding: 34px 16px;
  text-align: center;
  color: var(--gray-400, #9ca3af);
  font-size: 13px;
}

/* ========== 采购清单 · 报价单生成 ========== */
.pricing-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pricing-main { flex: 1 1 auto; min-width: 0; }
.pricing-side { flex: 0 0 360px; position: sticky; top: 76px; }

/* 分类选项卡 */
.pricing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 12px;
}
.pricing-tab {
  border: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
  color: var(--gray-700, #374151);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pricing-tab:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.pricing-tab.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
}
.pricing-tab__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 条目列表 */
.pricing-items__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800, #1f2937);
  margin: 4px 2px 10px;
}
.pricing-items__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-500, #6b7280);
  margin-left: 10px;
}
.price-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.price-item.selected {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 1px var(--primary, #2563eb) inset;
  background: rgba(37, 99, 235, 0.03);
}
.price-item__info { flex: 1 1 auto; min-width: 0; }
.price-item__name { font-size: 14px; font-weight: 600; color: var(--gray-900, #111827); }
.price-item__note {
  font-size: 12px;
  color: var(--gray-500, #6b7280);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-item__prices { flex: 0 0 auto; text-align: right; min-width: 86px; }
.price-item__price { font-size: 17px; font-weight: 700; color: var(--primary, #2563eb); }
.price-item__unit { font-size: 12px; font-weight: 400; color: var(--gray-500, #6b7280); }
.price-item__labor { font-size: 12px; color: #b45309; margin-top: 2px; }
.price-item__qty { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.qty-add {
  border: 1px solid var(--primary, #2563eb);
  background: #fff;
  color: var(--primary, #2563eb);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.qty-add:hover { background: var(--primary, #2563eb); color: #fff; }
.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-300, #d1d5db);
  background: #fff;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  color: var(--gray-700, #374151);
  line-height: 1;
}
.qty-btn:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.qty-input {
  width: 52px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  font-size: 13px;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input { -moz-appearance: textfield; appearance: textfield; }

/* 报价汇总卡片 */
.quote-summary {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}
.quote-summary__head {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900, #111827);
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quote-summary__count { font-size: 12px; font-weight: 500; color: var(--gray-500, #6b7280); }
.quote-summary__empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-400, #9ca3af);
  line-height: 1.9;
}
.quote-summary__table-wrap { max-height: 300px; overflow-y: auto; }
.quote-summary__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quote-summary__table th {
  position: sticky;
  top: 0;
  background: var(--gray-50, #f9fafb);
  color: var(--gray-500, #6b7280);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.quote-summary__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  color: var(--gray-800, #1f2937);
}
.quote-row__name { font-weight: 500; }
.quote-row__qty { color: var(--gray-500, #6b7280); font-size: 12px; margin-left: 6px; }
.quote-row__num { font-weight: 700; color: var(--primary, #2563eb); white-space: nowrap; }
.quote-row__del { text-align: center; }
.quote-del {
  border: none;
  background: none;
  color: var(--gray-400, #9ca3af);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.quote-del:hover { color: var(--danger, #dc2626); }
.quote-summary__totals { padding: 12px 16px; border-top: 1px solid var(--gray-100, #f3f4f6); }
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
}
.total-row span { font-size: 13px; color: var(--gray-600, #4b5563); }
.total-row i {
  font-style: normal;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: #fef3c7;
  color: #b45309;
}
.total-row b { font-size: 20px; font-weight: 800; }
.total-row--customer b { color: var(--primary, #2563eb); }
.total-row--labor b { color: #b45309; font-size: 17px; }
.total-row__cn { font-size: 12px; color: var(--gray-500, #6b7280); margin-top: 4px; }
.quote-summary__actions { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.btn-block { width: 100%; }
.form-row-2 { display: flex; gap: 12px; }
.form-row-2 .form-item { flex: 1; }
.print-tip {
  margin-top: 10px;
  padding: 9px 12px;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary, #2563eb);
}

/* ========== 客户报价单（打印版，仅打印时可见） ========== */
#printSheet { display: none; }
.sheet { width: 200mm; margin: 0 auto; color: #111; font-size: 13px; line-height: 1.6; }
/* 抬头品牌区：左侧公司落款，右侧盖章位 */
.sheet__brand { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet__logo { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: #1e3a8a; }
.sheet__sub { font-size: 11px; color: #666; letter-spacing: 2px; margin-top: 3px; }
.sheet__corp { font-size: 11.5px; color: #444; margin-top: 8px; display: flex; align-items: center; }
.sheet__corp-sep {
  display: inline-block;
  width: 1px; height: 10px;
  background: #bbb;
  margin: 0 8px;
}
.sheet__title {
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  margin: 16px 0 8px;
  padding-bottom: 12px;
  border-bottom: 2.5px solid #111;
}
.sheet__meta-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #444;
  margin: 10px 0 14px;
}
.sheet__meta-line b { font-size: 12.5px; }
.sheet__meta, .sheet__table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.sheet__meta th, .sheet__meta td {
  border: 1px solid #8c8c8c;
  padding: 7px 10px;
  font-size: 12.5px;
  text-align: left;
}
.sheet__meta th { background: #eef1f6; width: 90px; font-weight: 600; }
.sheet__meta td { width: 155px; }
.sheet__table th, .sheet__table td {
  border: 1px solid #8c8c8c;
  padding: 7px 10px;
  font-size: 12.5px;
}
/* 明细表头：深蓝底白字，正式单据风格 */
.sheet__table th {
  background: #1e3a8a;
  color: #fff;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}
.sheet__table .c { text-align: center; }
.sheet__table .r { text-align: right; }
.sheet__table td { text-align: left; }
.sheet__table tbody tr:nth-child(even) td { background: #f7f9fc; }
.sheet-unit { color: #666; font-size: 11px; margin-left: 2px; }
.sheet-group td {
  background: #e3eaf5;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
}
/* 合计行：强调底色 + 粗上边线 */
.sheet-total-row td { background: #eef1f6; border-top: 2.5px solid #111; font-size: 13.5px; }
.sheet-total-row b { font-size: 15px; }
.sheet-total-note { color: #555; font-size: 11px; }
.sheet__rules { margin: 4px 0 18px; }
.sheet__rules-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  padding-left: 8px;
  border-left: 3px solid #1e3a8a;
}
.sheet__rules ol { margin: 0; padding-left: 20px; font-size: 11.5px; color: #333; }
.sheet__rules li { margin-bottom: 2px; }
.sheet__remark { margin-top: 6px; font-size: 12px; color: #333; }
.sheet__sign { display: flex; gap: 40px; margin-top: 26px; page-break-inside: avoid; }
.sheet__sign-item { flex: 1; }
.sheet__sign-note { font-size: 11.5px; color: #555; margin-bottom: 22px; }
.sheet__sign-line { font-size: 13px; margin-bottom: 14px; }
.sheet__sign-line span {
  display: inline-block;
  width: 140px;
  border-bottom: 1px solid #333;
  height: 16px;
}
/* 页脚落款 */
.sheet__foot {
  margin-top: 22px;
  padding-top: 8px;
  border-top: 1px solid #999;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #777;
}
.sheet-blank {
  display: inline-block;
  width: 100%;
  border-bottom: 1px solid #999;
  height: 14px;
}

/* ========== 创收榜（独立导航页）：浅色干净风格 ========== */
.rank-hero {
  background: #fff;
  border-radius: 14px;
  padding: 26px 32px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.rank-hero__head { display: flex; align-items: center; gap: 12px; }
.rank-hero__title { font-size: 18px; font-weight: 700; letter-spacing: 2px; color: var(--gray-900); }
.rank-hero__month {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 12px;
  border-radius: 999px;
}

/* 本月结算概览 */
.rank-hero__stats {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 16px 0;
  background: var(--gray-50);
  border-radius: 10px;
}
.rank-stat { padding: 0 38px; text-align: center; border-right: 1px solid var(--gray-200); }
.rank-stat:last-child { border-right: none; }
.rank-stat__num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gray-900); }
.rank-stat__num--gold { color: #b45309; }
.rank-stat__label { font-size: 12px; margin-top: 3px; color: var(--gray-500); }

/* 领奖台：冠军居中最高，亚季军分列两侧；名字上方为奖杯 */
.rank-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 36px;
  padding: 30px 16px 0;
}
.podium__item {
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.podium__trophy { width: 44px; height: 44px; margin-bottom: 10px; }
.rank-1 .podium__trophy {
  width: 56px;
  height: 56px;
  fill: #f59e0b;
  filter: drop-shadow(0 3px 6px rgba(245, 158, 11, 0.4));
}
.rank-2 .podium__trophy { fill: #94a3b8; }
.rank-3 .podium__trophy { fill: #c08a5a; }
.podium__name { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.rank-1 .podium__name { font-size: 18px; }
.podium__income {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}
.rank-1 .podium__income { font-size: 24px; color: #b45309; }
.podium__count {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-100);
  padding: 3px 12px;
  border-radius: 999px;
}
.podium__base {
  margin-top: 16px;
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}
.rank-1 .podium__base { height: 80px; background: linear-gradient(180deg, #fbbf24, #d97706); }
.rank-2 .podium__base { height: 58px; background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.rank-3 .podium__base { height: 44px; background: linear-gradient(180deg, #d6a37a, #a16207); }

/* 第 4 名起：两列卡片接着排 */
.rank-list {
  margin-top: 26px;
  border-top: 1px solid var(--gray-100);
  padding: 16px 4px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.rank-row {
  display: grid;
  grid-template-columns: 26px 92px 1fr 92px;
  align-items: center;
  column-gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--gray-50);
  font-size: 14px;
}
.rank-row__no {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #e5e7eb;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-row__name { font-weight: 600; color: var(--gray-900); }
.rank-row__count { color: var(--gray-500); font-size: 12.5px; }
.rank-row__income {
  font-weight: 700;
  color: #15803d;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rank-empty { padding: 40px 0 44px; text-align: center; color: var(--gray-500); font-size: 14px; }
.rank-list .rank-empty { grid-column: 1 / -1; }

/* 人员管理：师傅 / 管理员左右两栏布局 */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr));
  gap: 18px;
  align-items: start;
}
.people-panel { margin-bottom: 0; }
.people-panel .toolbar { margin-bottom: 12px; }
.people-panel .filter-bar { margin-bottom: 12px; }
.cell-num { text-align: center; font-weight: 600; color: var(--gray-900); }
.cell-income { color: #15803d; }

/* 表格固定布局：列宽由表头决定，保证表头与内容严格上下对齐 */
.data-table--fixed { table-layout: fixed; }
.data-table--fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 人员管理两个表格统一：固定布局 + 单元格居中 + 横向等距 padding（含首尾列，保证各行严格对齐） */
.people-panel .data-table th,
.people-panel .data-table td { padding: 12px 14px; text-align: center; }

/* 师傅表格：勾选 / 序号两个窄列 padding 收窄，避免内容被挤压成省略号 */
.people-panel .data-table--masters th:nth-child(1),
.people-panel .data-table--masters td:nth-child(1),
.people-panel .data-table--masters th:nth-child(2),
.people-panel .data-table--masters td:nth-child(2) { padding-left: 6px; padding-right: 6px; }

/* 管理员表格：8 列等宽（含操作列），每栏间距相同，视觉和谐 */
.data-table--even { table-layout: fixed; }
.data-table--even th, .data-table--even td { width: 12.5%; }
.data-table--even td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 师傅表格：勾选/序号窄列固定，其余 6 列等宽均分 */
.data-table--masters th:nth-child(n+3), .data-table--masters td:nth-child(n+3) { width: auto; }

/* ========== 结算面板（位于派单面板下方，同风格框架） ========== */
.settle-hint {
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 14px;
}
.settle-form { display: flex; flex-direction: column; gap: 12px; }
.settle-field label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.settle-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.settle-field input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(30,111,255,0.12); }
.settle-field--btn { margin-top: 2px; }

/* 已结算态：金额 + 明细（朴素卡片，与面板框架同风格） */
.settle-done {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 18px;
}
.settle-done__amount { text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100); }
.settle-done__label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.settle-done__num { font-size: 30px; font-weight: 700; color: #15803d; line-height: 1.2; }
.settle-done__meta { display: flex; flex-direction: column; gap: 8px; }
.settle-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.settle-row__k { width: 88px; color: var(--gray-500); flex-shrink: 0; }
.settle-row__v { color: var(--gray-900); font-weight: 500; word-break: break-all; }
.settle-wxno { font-family: Consolas, Monaco, monospace; letter-spacing: 0.5px; }
.settle-ops { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.btn-s { padding: 4px 12px; font-size: 12px; }

/* ========== 录入中心 ========== */
/* 纵向铺满：两张卡片撑满主内容区剩余高度 */
#view-entry { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h) - 48px); }
#view-entry .entry-grid { flex: 1; }
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 960px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-card { display: flex; flex-direction: column; }
.entry-card form { flex: 1; display: flex; flex-direction: column; }
.entry-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 1280px) { .entry-2col { grid-template-columns: 1fr; gap: 0; } }
.entry-card .btn-block { width: 100%; margin-top: auto; }
.entry-note {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-left: 3px solid var(--primary);
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.7;
  border-radius: 0 6px 6px 0;
}

/* ========== 师傅证件 ========== */
.radio-row { display: flex; gap: 20px; }
.radio-item { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: normal; }
.radio-item input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.cert-fields {
  padding: 14px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 18px;
}
.cert-fields .form-item { margin-bottom: 12px; }
.cert-fields .form-item:last-child { margin-bottom: 0; }

/* 认证状态标签 */
.cert-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.cert-badge--yes { background: #dcfce7; color: #15803d; }
.cert-badge--no { background: #f3f4f6; color: #6b7280; }

/* 证件信息卡片 */
.cert-card { margin-bottom: 16px; }
.cert-info { margin-bottom: 14px; }
.cert-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.cert-row:last-child { border-bottom: none; }
.cert-k { width: 90px; color: var(--gray-500); flex-shrink: 0; }
.cert-v { color: var(--gray-900); font-weight: 500; }
.cert-img { max-width: 300px; max-height: 200px; border-radius: 8px; border: 1px solid var(--gray-200); }
.cert-no-photo { color: var(--gray-400); font-size: 13px; padding: 20px; text-align: center; background: var(--gray-50); border-radius: 8px; }
.cert-ops { margin-top: 12px; }

/* 标签颜色 */
.tag--green { background: #dcfce7 !important; color: #15803d !important; }
.tag--gray { background: #f3f4f6 !important; color: #6b7280 !important; }

/* ========== 权限调整 ========== */
.role-adjust {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.role-adjust__list { flex: 1; min-height: 160px; }
/* 管理员卡片：表单不撑高，权限调整区撑满剩余空间（拉高框架，消除上方空白） */
#entryAdminForm { flex: none; }
.role-adjust__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}
.role-adjust__group { margin-bottom: 12px; }
.role-adjust__group:last-child { margin-bottom: 0; }
.role-adjust__label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.role-adjust__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--gray-50);
  border-radius: 6px;
  margin-bottom: 6px;
}
.role-adjust__item:last-child { margin-bottom: 0; }
.role-adjust__name { font-weight: 500; color: var(--gray-900); }
.role-adjust__phone { font-size: 12px; color: var(--gray-500); flex: 1; }
.role-adjust__empty { color: var(--gray-400); font-size: 13px; text-align: center; padding: 12px; }
/* 待生效的权限调整（24小时后生效，可撤回） */
.role-adjust__item--pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.role-adjust__pending-info {
  flex: 1;
  font-size: 12px;
  color: #b45309;
}
.role-adjust__item--pending .role-adjust__phone { flex: none; }

/* 权限调整二次确认弹窗 */
.adjust-confirm p { font-size: 14px; color: var(--gray-900); margin-bottom: 12px; }
.adjust-confirm__rules {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.9;
}
.adjust-confirm__rules b { color: var(--gray-700); }

/* 证件工种多选栏目 */
.cert-type-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}
.cert-chip:hover { border-color: var(--primary); color: var(--primary); }
.cert-chip:has(input:checked) {
  background: #eaf2ff;
  border-color: var(--primary);
  color: var(--primary);
}
.cert-chip input { width: auto; padding: 0; margin: 0; accent-color: var(--primary); }

/* 证件照片缩略图（录入预览 + 详情多图横排） */
.cert-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cert-photo-preview:empty { margin-top: 0; }
.cert-thumb {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}
#certPhotoView { display: flex; flex-wrap: wrap; gap: 10px; }
#certPhotoView .cert-img, .cert-thumb { cursor: zoom-in; }

/* 证件照片放大查看 */
.photo-viewer { text-align: center; }
.photo-viewer img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

@media print {
  body > *:not(#printSheet) { display: none !important; }
  #printSheet { display: block !important; }
  body { background: #fff !important; }
  .sheet { width: 100%; }
  .sheet__table th, .sheet__meta th, .sheet-group td, .sheet-total-row td,
  .sheet__table tbody tr:nth-child(even) td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
