:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #52606d;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --line: #d9e2ec;
  --success: #087f5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.16), transparent 28%),
    linear-gradient(180deg, #eef2f6 0%, #f8fafc 100%);
  color: var(--text);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.status-card {
  width: min(100%, 760px);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #9a3412;
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.2;
}

.lead {
  margin: 12px 0 0;
  color: var(--success);
  font-size: 24px;
  font-weight: 700;
}

.status-panel {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e5edf5;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

#health-status {
  font-size: 20px;
}

.tips {
  margin-top: 24px;
  color: var(--muted);
  line-height: 1.8;
}

.tips p {
  margin: 0;
}

.home-actions {
  margin-top: 24px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.28);
}

.secondary-button {
  background: #e2e8f0;
  color: #1e293b;
}

.danger-button {
  background: #b91c1c;
  color: #ffffff;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.auth-page,
.dashboard-page {
  min-height: 100vh;
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #edf2f7;
  color: #1f2937;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  border-radius: 24px;
  border: 1px solid #dbe4ee;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
}

.auth-card h1,
.dashboard-main h1,
.dashboard-panel h2 {
  margin-top: 0;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: #52606d;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  font: inherit;
}

.field input.field-error,
.field select.field-error,
.field textarea.field-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.muted {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.status-text {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 14px;
  color: #0f766e;
}

.status-text.error {
  color: #b91c1c;
}

/* Toast 通知 */
.toast {
  min-width: 260px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
  word-break: break-word;
}
.toast.success { background-color: #16a34a; }
.toast.error { background-color: #dc2626; }
.toast.info { background-color: #2563eb; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.dashboard-sidebar {
  padding: 24px 20px;
  background: #0f172a;
  color: #e2e8f0;
}

.dashboard-sidebar h2 {
  margin-top: 0;
  font-size: 24px;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.nav-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-button.active {
  background: rgba(249, 115, 22, 0.24);
  border-color: rgba(249, 115, 22, 0.4);
}

.dashboard-main {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.compact-field {
  min-width: 240px;
}

.dashboard-panels {
  display: grid;
  gap: 20px;
}

.dashboard-panel {
  padding: 20px 24px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #dbe4ee;
}

.hidden {
  display: none !important;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.tab-button {
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px 10px 0 0;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab-button:hover:not(:disabled) {
  background: #e2e8f0;
}

.tab-button.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.tab-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.roster-pane {
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.modal-content h3 {
  margin-top: 0;
}

.field-error {
  border-color: #b91c1c !important;
  background: #fef2f2;
}

/* r77：编辑存量记录时「本格没改动但不合规」的柔和提示 —— 不禁用保存按钮，只告知会自动清空 */
.field-error-soft {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #b45309;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 4px 8px;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.data-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #dbe4ee;
  background: #f8fafc;
}

.data-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.toolbar-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 16px;
}

/* 考勤表/工资表工具栏：左侧筛选 + 右侧按钮 */
.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 16px;
}

.sheet-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.sheet-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #52606d;
  white-space: nowrap;
}

.inline-field span {
  flex-shrink: 0;
}

.inline-field input,
.inline-field select {
  width: auto;
  min-width: 140px;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #52606d;
  white-space: nowrap;
  padding: 7px 0;
}

.worker-form-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 260px;
}

.worker-photo-box {
  display: grid;
  align-content: start;
  gap: 16px;
}

.photo-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  overflow: hidden;
  text-align: center;
}

.photo-preview img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.photo-preview.placeholder {
  padding: 12px;
}

.photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.photo-actions .secondary-button {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
}

.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumbnail-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #e2e8f0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #475569;
}

.thumbnail-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 12px;
}

.ocr-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.ocr-dropzone {
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 220px;
  padding: 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  text-align: center;
}

.ocr-dropzone.dragover {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}

.ocr-dropzone-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ocr-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ocr-file-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 13px;
}

/* 导出字段分组卡片 */
.export-field-groups {
  display: grid;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.export-group-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #f8fafc;
}

.export-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.export-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.export-group-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 16px;
}

.export-field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
  cursor: pointer;
}

.export-field-item:hover {
  color: #2563eb;
}

/* 可编辑表格单元格 */
.editable-cell {
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 20px;
  cursor: text;
}

.editable-cell:focus,
.editable-cell:hover {
  border-color: #cbd5e1;
  background: #fff;
  outline: none;
}

.editable-cell:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.editable-cell.readonly-cell {
  background: #f1f5f9;
  cursor: not-allowed;
  color: #475569;
}

.editable-cell.readonly-cell:hover {
  border-color: transparent;
  background: #f1f5f9;
}

/* 考勤/工资表格容器 */
.sheet-table-wrap {
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}

.sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid #e2e8f0;
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
}

.sheet-table th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
}

.sheet-table th.sticky-col,
.sheet-table td.sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.sheet-table th.sticky-col {
  z-index: 3;
  background: #f1f5f9;
}

.sheet-table tr:nth-child(even) td:not(.sticky-col) {
  background: #fafbfc;
}

.sheet-table .row-label {
  text-align: left;
  font-weight: 600;
  background: #f8fafc;
}

.sheet-table .attend-mark {
  color: #16a34a;
  font-weight: 700;
}

.sheet-table .formula-cell {
  background: #fef3c7;
  font-weight: 600;
}

/* r74：染色位置改到「日格」（宏哥要求：在有差异的对应日期格分色填充，不在合计天数分色）。
   只给上午/下午打勾小格上背景色，字体/边框/列宽/行高/对齐一律不动。
   浅绿 #DCFCE7 = 考勤机有√、人工表该半天没记；浅红 #FEE2E2 = 人工表该半天有√、考勤机没记；
   两边一致 或 该人该月人工表无逐日数据（manual_marks 为空）→ 不着色。 */
.sheet-table .mark-cell.att-manual-more { background: #DCFCE7 !important; }
.sheet-table .mark-cell.att-manual-less { background: #FEE2E2 !important; }
/* r95：加班行（机读底稿 vs 当前值，按小时数比）同色系 */
.sheet-table .overtime-cell.att-manual-more { background: #DCFCE7 !important; }
.sheet-table .overtime-cell.att-manual-less { background: #FEE2E2 !important; }

/* r71：人工表口径角标 —— 合计天数用了人工《考勤及工资汇总表》的工天时标注 * */
.manual-days-badge {
  margin-left: 2px;
  color: #b45309;
  font-weight: 700;
  cursor: help;
}

/* 考勤表备注列（仅管理层可见） */
.sheet-table .remark-cell {
  min-width: 160px;
  max-width: 240px;
  vertical-align: top;
}

.sheet-table .remark-view {
  min-height: 20px;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #92400e;
  background: #fffbeb;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  cursor: help;
}

/* 选项卡 */
.sub-tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
}

.sub-tab-button {
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.sub-tab-button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.sub-tab-pane {
  display: none;
}

.sub-tab-pane.active {
  display: block;
}

/* 配置项卡片 */
.config-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}

.config-item input {
  width: 160px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

.ocr-side-note {
  margin-top: 12px;
}

.ocr-result-list {
  display: grid;
  gap: 16px;
}

.ocr-result-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #dbe4ee;
  background: #f8fafc;
}

.ocr-result-card.error {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 242, 242, 0.9);
}

.ocr-result-card.confirmed {
  border-color: rgba(8, 127, 91, 0.28);
  background: rgba(236, 253, 245, 0.92);
}

.ocr-result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.ocr-result-header h4 {
  margin: 0 0 6px;
}

.ocr-preview-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
  font-size: 14px;
}

.ocr-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ocr-check {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.ocr-check.ok {
  background: rgba(8, 127, 91, 0.12);
  color: #087f5b;
}

.ocr-check.error {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.ocr-validation-list {
  display: grid;
  gap: 6px;
}

@media (max-width: 980px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .worker-form-layout {
    grid-template-columns: 1fr;
  }

  .worker-photo-box {
    order: -1;
  }

  .ocr-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== 移动端适配（手机录入） ===== */
@media (max-width: 768px) {
  .dashboard-sidebar {
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .dashboard-sidebar h2 {
    font-size: 18px;
    margin: 0;
  }
  .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }
  .nav-button {
    width: auto;
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
  }
  .field input,
  .field select,
  .field textarea {
    padding: 12px;
    font-size: 16px;
  }
  .primary-button,
  .secondary-button {
    padding: 12px 16px;
    font-size: 15px;
    min-height: 44px;
  }
  /* 考勤表横向滚动 */
  .table-wrapper,
  #attendance-sheet-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    font-size: 13px;
  }
  .toast {
    min-width: auto;
    max-width: 90vw;
    margin: 0 auto;
  }
  /* 手机端照片预览高度适中，避免占用过多屏幕 */
  .photo-preview {
    min-height: 160px;
  }
  .photo-preview img {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .status-card {
    padding: 20px 14px;
    border-radius: 16px;
  }
  .nav-button {
    font-size: 12px;
    padding: 8px 6px;
  }
  .field label {
    font-size: 13px;
  }
}

/* ===== 侧栏折叠 START ===== */
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-head h2 {
  margin: 0;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  min-height: 32px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.14);
  color: inherit;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.4);
}

.sidebar-toggle:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  font-size: 16px;
}

.dashboard-layout {
  transition: grid-template-columns 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-layout {
    transition: none;
  }
}

/* 收起：260px -> 64px，正文隐藏，只留一个竖排的明显「展开」按钮 */
body.sidebar-collapsed .dashboard-layout {
  grid-template-columns: 64px 1fr;
}

body.sidebar-collapsed .dashboard-sidebar {
  padding: 12px 8px;
}

body.sidebar-collapsed .dashboard-sidebar h2,
body.sidebar-collapsed .sidebar-body {
  display: none;
}

body.sidebar-collapsed .sidebar-head {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 48px;
  min-height: 96px;
  flex-direction: column;
  gap: 6px;
  padding: 10px 4px;
  border-color: rgba(249, 115, 22, 0.55);
  background: rgba(249, 115, 22, 0.2);
}

body.sidebar-collapsed .sidebar-toggle-icon {
  font-size: 20px;
}

body.sidebar-collapsed .sidebar-toggle-text {
  writing-mode: vertical-rl;
  letter-spacing: 3px;
}

/* 小屏（侧栏已变顶部横条）收起：不压成 64px 窄栏，整条压扁成一行 */
@media (max-width: 768px) {
  body.sidebar-collapsed .dashboard-layout {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .dashboard-sidebar {
    padding: 8px 12px;
  }

  body.sidebar-collapsed .sidebar-head {
    justify-content: flex-start;
    gap: 10px;
  }

  body.sidebar-collapsed .dashboard-sidebar h2 {
    display: block;
    font-size: 15px;
    margin: 0;
  }

  body.sidebar-collapsed .sidebar-toggle {
    width: auto;
    min-height: 36px;
    flex-direction: row;
    padding: 8px 12px;
  }

  body.sidebar-collapsed .sidebar-toggle-text {
    writing-mode: horizontal-tb;
    letter-spacing: 0;
  }
}
/* ===== 侧栏折叠 END ===== */

/* ===== 工资表第二轮：单元格控件 / 表尾合计 / 对照卡 / 凭证 ===== */
.sheet-table td.editable-holder,
.sheet-table td.calc-holder,
.sheet-table td.readonly-holder {
  padding: 2px 4px;
  vertical-align: top;
}
.cell-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 3px 6px;
  font: inherit;
  text-align: right;
  background: #fffdf5;
}
.cell-input.text { text-align: left; background: #fffdf5; }
.cell-input:focus { outline: 2px solid #2f6feb; outline-offset: -1px; background: #fff; }
.cell-input.deduction-input { background: #fff5f5; }
.calc-cell {
  font: inherit;
  text-align: right;
  padding: 3px 6px;
  color: #0b4a8f;
  font-weight: 600;
  white-space: nowrap;
}
.readonly-cell {
  font: inherit;
  text-align: right;
  padding: 3px 6px;
  color: #46586b;
  background: #f2f5f9;
  border-radius: 4px;
  white-space: nowrap;
}
.cell-hint {
  font-size: 11px;
  line-height: 1.3;
  color: #6b7a8c;
  margin-top: 2px;
  max-width: 150px;
}
.cell-hint.ro-hint { color: #8b98a8; }
.cell-hint.warn { color: #b3261e; font-weight: 600; }
/* 扣款填正数（=加钱）的醒目黄色提示：黄底+黄框，与红色错误提示区分 */
.cell-hint.warn-yellow {
  color: #7a4f00;
  font-weight: 700;
  background: #ffe066;
  border: 1px solid #e6a700;
  border-radius: 4px;
  padding: 1px 5px;
  display: inline-block;
}
.n-breakdown {
  font-size: 11px;
  line-height: 1.35;
  color: #34506b;
  margin-top: 3px;
  border-top: 1px dashed #cfd8e3;
  padding-top: 2px;
}
.sheet-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #eef3fa;
  font-weight: 700;
  border-top: 2px solid #2f6feb;
  z-index: 3;
}
.sheet-table tfoot td.total-cell { text-align: right; color: #0b4a8f; }
.sheet-table tfoot td.seq-cell,
.sheet-table tfoot td.name-cell { text-align: center; }
.inline-banner {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-left: 4px solid #f0a20b;
  background: #fff8e6;
  color: #6b4b00;
  border-radius: 4px;
  font-size: 13px;
}
.recon-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.recon-card {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f6f9fd);
}
.recon-card-label { font-size: 12px; color: #5b6b7c; }
.recon-card-value { font-size: 20px; font-weight: 700; color: #0b4a8f; margin: 4px 0 2px; }
.recon-card-hint { font-size: 11px; color: #8b98a8; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.warn, .warn { color: #b3261e; font-weight: 600; }
.data-table tr.total-row td { background: #eef3fa; font-weight: 700; }

/* ==================================================================
   设计规范统一层  v2026.10.29-r45（只改表现层：字号/间距/颜色/边框）
   三级字号：标题 18 / 正文 13 / 辅助 11
   主色 1 个（品牌橙）+ 中性灰阶；语义色只留 红=错误 绿=识别成功 黄=加价/待确认
   圆角统一 10px；边框统一 1px 浅灰；去掉装饰性阴影与渐变
   ================================================================== */
:root {
  --c-accent: #ea580c;
  --c-accent-weak: #fff2e9;
  --c-ink: #111827;
  --c-ink-2: #475569;
  --c-ink-3: #8a97a8;
  --c-line: #e5e9f0;
  --c-line-2: #d5dce6;
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --fs-title: 18px;
  --fs-body: 13px;
  --fs-hint: 11px;
  --r: 10px;
  --r-sm: 8px;
  --sp: 8px;
}

/* ---------- 布局：让宽表格在容器内滚动，而不是把整页撑宽 ---------- */
.dashboard-page {
  font-size: var(--fs-body);
  color: var(--c-ink);
  background: var(--c-bg);
}
.dashboard-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}
body.sidebar-collapsed .dashboard-layout {
  grid-template-columns: 64px minmax(0, 1fr);
}
.dashboard-main {
  min-width: 0;
  padding: 14px 16px;
  gap: 12px;
  align-content: start;
}
.dashboard-sidebar {
  padding: 14px 12px;
}

/* ---------- 三级字号（只作用于业务主界面） ---------- */
.dashboard-page h1,
.dashboard-page h2,
.dashboard-page h3,
.dashboard-page h4 {
  font-size: var(--fs-title);
  line-height: 1.35;
  color: var(--c-ink);
  letter-spacing: 0;
}
.dashboard-page .dashboard-panel h2 { margin: 0 0 8px; }
.dashboard-page .data-card h3,
.dashboard-page .config-card h3 { margin: 0 0 6px; }
.dashboard-page .lead,
.dashboard-page #health-status { font-size: var(--fs-title); }
.dashboard-sidebar h2 { font-size: var(--fs-title); }
.sidebar-head { align-items: center; }

/* ---------- 卡片/分区：统一圆角、边框、内边距 ---------- */
.dashboard-panel,
.data-card,
.config-card,
.ocr-result-card,
.recon-card,
.export-group-card,
.modal-content,
.sheet-table-wrap {
  border: 1px solid var(--c-line);
  border-radius: var(--r);
  background: var(--c-surface);
  box-shadow: none;
}
.dashboard-panel { padding: 12px 14px; }
.dashboard-panels { gap: 12px; }
.card-grid { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.data-card { padding: 10px 12px; }
.config-card { padding: 10px 12px; margin-bottom: 10px; }
.modal-content { box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); }

.compact-field { min-width: 170px; }
.compact-field .label { font-size: var(--fs-hint); margin-bottom: 2px; }

/* ---------- 控件统一尺寸 ---------- */
.primary-button,
.secondary-button,
.danger-button,
.tab-button,
.sub-tab-button,
.nav-button,
.sidebar-toggle {
  font-size: var(--fs-body);
  border-radius: var(--r-sm);
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.primary-button,
.secondary-button,
.danger-button {
  min-height: 30px;
  padding: 5px 12px;
  font-weight: 600;
}
.primary-button { background: var(--c-accent); }
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover { transform: none; }
.secondary-button { background: #eef1f6; color: var(--c-ink); border: 1px solid var(--c-line-2); }
.field input,
.field select,
.field textarea,
.inline-field input,
.inline-field select,
.config-item input {
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
  padding: 5px 8px;
  min-height: 30px;
}
.inline-field { font-size: var(--fs-body); color: var(--c-ink-2); gap: 5px; }
.inline-field input,
.inline-field select { min-width: 120px; max-width: 170px; }
.checkbox-field { font-size: var(--fs-body); padding: 3px 0; }

/* 主/子选项卡：选中态统一用主色，不再出现第二套蓝色 */
.tab-bar { gap: 6px; margin: 10px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--c-line); }
.tab-button { min-height: 30px; padding: 5px 14px; border-radius: var(--r-sm); }
.tab-button.active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.sub-tab-bar { gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--c-line); }
.sub-tab-button { padding: 6px 14px; color: var(--c-ink-2); }
.sub-tab-button.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.nav-button { padding: 8px 10px; }
.nav-list { gap: 6px; margin-top: 12px; }

/* ---------- 表单/表格：行高收紧，一屏多看几行 ---------- */
.table-wrap,
.sheet-table-wrap {
  max-width: 100%;
  border-radius: var(--r);
  border-color: var(--c-line);
  overflow: auto;
}
.data-table th,
.data-table td {
  padding: 5px 9px;
  font-size: var(--fs-body);
  border-bottom: 1px solid var(--c-line);
  line-height: 1.35;
}
.data-table th {
  background: #f7f9fc;
  font-weight: 600;
  color: var(--c-ink-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.sheet-table th,
.sheet-table td {
  padding: 2px 5px;
  font-size: var(--fs-body);
  line-height: 1.25;
  border: 1px solid var(--c-line);
}
.sheet-table th { background: #f7f9fc; }
.sheet-table td.sticky-col,
.sheet-table th.sticky-col {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-table td.sticky-col { background: #fff; }
.sheet-table th.sticky-col { background: #f7f9fc; }
/* 斑马纹只留这一种，取消其余花底 */
.sheet-table tr:nth-child(even) td:not(.sticky-col) { background: #fafbfd; }
.sheet-table .row-label { background: #f7f9fc; }

/* 单元格内控件 */
.cell-input {
  border: 1px solid var(--c-line-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: var(--fs-body);
  line-height: 1.3;
  background: #fffdf7;
}
.cell-input:focus { outline: 2px solid var(--c-accent); outline-offset: -1px; background: #fff; }
.cell-input.deduction-input { background: #fff6f6; }
.calc-cell,
.readonly-cell {
  padding: 1px 5px;
  font-size: var(--fs-body);
  line-height: 1.3;
  border-radius: 4px;
}
.calc-cell { color: var(--c-ink); }
.readonly-cell { color: var(--c-ink-2); background: #f3f5f9; }
/* 每个单元格的来源小字：降噪到一行 10px，保留可见（不删信息） */
.cell-hint {
  font-size: 10px;
  line-height: 1.15;
  margin-top: 0;
  max-width: 140px;
  color: #9aa6b5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-hint.ro-hint { color: #9aa6b5; }
.cell-hint.warn { color: #b3261e; font-weight: 600; }
.cell-hint.warn-yellow {
  color: #7a4f00;
  font-weight: 700;
  background: #ffe066;
  border: 1px solid #e6a700;
  border-radius: 4px;
  padding: 0 4px;
  display: inline-block;
}
.n-breakdown {
  font-size: 10px;
  line-height: 1.2;
  margin-top: 1px;
  border-top: 1px dotted var(--c-line-2);
  padding-top: 1px;
}
.sheet-table td.editable-holder,
.sheet-table td.calc-holder,
.sheet-table td.readonly-holder { padding: 1px 3px; }
.sheet-table tfoot td { background: #f3f6fb; border-top: 2px solid var(--c-accent); }
.sheet-table tfoot td.total-cell { color: var(--c-ink); }

/* 工具条：一行放完，按钮不换行 */
.sheet-toolbar { gap: 8px 12px; margin-top: 10px; flex-wrap: nowrap; }
.sheet-toolbar-filters { gap: 8px; flex-wrap: wrap; min-width: 0; }
.sheet-toolbar-buttons { gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }

/* 对照/统计卡 */
.recon-cards { gap: 10px; margin: 8px 0 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.recon-card { padding: 8px 12px; background: var(--c-surface); }
.recon-card-label { font-size: var(--fs-hint); color: var(--c-ink-3); }
.recon-card-value { font-size: var(--fs-title); color: var(--c-ink); margin: 2px 0 0; }
.recon-card-hint { font-size: var(--fs-hint); color: var(--c-ink-3); }
.inline-banner {
  margin: 6px 0 2px;
  padding: 6px 10px;
  border-left: 3px solid var(--c-accent);
  background: var(--c-accent-weak);
  color: #7a3b06;
  border-radius: 4px;
  font-size: var(--fs-hint);
}

/* 辅助文字统一到三级字号里的「辅助」档 */
.muted,
.status-text,
.label,
.field label,
.pill,
.ocr-check,
.thumbnail-box,
.cell-hint,
.recon-card-hint { font-size: var(--fs-hint); }
.muted { color: var(--c-ink-3); line-height: 1.5; }

/* 提示/徽标颜色收敛 */
.pill { background: #eef1f6; color: var(--c-ink-2); padding: 2px 8px; border-radius: 999px; }
.badge { border-radius: 999px; font-size: var(--fs-hint); }

/* 窄屏（1366 及以下）：进一步收外框，保证表格不出横向错位 */
@media (max-width: 1500px) {
  .dashboard-main { padding: 12px; gap: 10px; }
  .dashboard-panel { padding: 10px 12px; }
  .compact-field { min-width: 150px; }
}

/* 手机端：优先可读、可点，表格在自身容器内横向滚动 */
@media (max-width: 768px) {
  :root { --fs-title: 16px; --fs-body: 13px; --fs-hint: 11px; }
  .dashboard-main { padding: 10px; gap: 10px; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { padding: 8px 10px; }
  .dashboard-panel { padding: 10px; }
  .primary-button,
  .secondary-button,
  .danger-button { min-height: 36px; padding: 7px 12px; }
  .sheet-toolbar { flex-wrap: wrap; }
  .sheet-toolbar-buttons { flex-wrap: wrap; }
  .inline-field input,
  .inline-field select { min-width: 100px; max-width: 140px; }
  .sheet-table th,
  .sheet-table td { padding: 3px 5px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---- r45 补丁：隐式网格列改为可收缩，杜绝宽表格把整页撑宽 ---- */
.dashboard-main { grid-template-columns: minmax(0, 1fr); }
.dashboard-main > * { min-width: 0; max-width: 100%; }
.dashboard-panel,
.dashboard-panels,
.sub-tab-pane,
.toolbar-grid,
.sheet-toolbar,
.sheet-toolbar-filters,
.sheet-table-wrap,
.table-wrap,
.recon-cards,
.card-grid { min-width: 0; max-width: 100%; }
.toolbar-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.sheet-table-wrap,
.table-wrap { width: 100%; }

/* ---- r45 补丁：单元格内小字一律压成一行，行高收到 ~30px，一屏多看几行 ---- */
.sheet-table td,
.sheet-table th { padding: 2px 5px; line-height: 1.25; }
.sheet-table .cell-input,
.sheet-table .calc-cell,
.sheet-table .readonly-cell { line-height: 16px; }
.sheet-table .cell-hint,
.sheet-table .cell-hint.ro-hint,
.sheet-table .n-breakdown {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: 10px !important;
  line-height: 11px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-table .n-breakdown { border-top: 0; }
/* 需要人眼盯住的黄底提示允许换行，但仍是辅助级小字 */
.sheet-table .cell-hint.warn-yellow {
  white-space: normal !important;
  line-height: 12px !important;
  padding: 0 3px;
}
.sheet-table .cell-hint.warn { white-space: normal !important; line-height: 12px !important; }

/* ---- r45 补丁：表格区固定高度、表头吸顶（滚表格不滚整页） ---- */
.sheet-table-wrap {
  max-height: calc(100vh - 420px);
  min-height: 240px;
  overflow: auto;
}
.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f9fc;
  box-shadow: 0 1px 0 var(--c-line);
}
.sheet-table thead tr:nth-child(2) th { top: 24px; }
@media (max-width: 768px) {
  .sheet-table-wrap { max-height: 70vh; }
}

/* ---- r45 收尾：字号严格三级（18/13/11），辅助说明收边距 ---- */
.sheet-table .cell-hint,
.sheet-table .cell-hint.ro-hint,
.sheet-table .n-breakdown { font-size: 11px !important; line-height: 12px !important; }
.sidebar-toggle-icon { font-size: 13px; }
.dashboard-page p.muted { margin: 6px 0; line-height: 1.5; }
.sheet-toolbar { margin-top: 8px; }
.toolbar-grid { gap: 8px 10px; }
.sub-tab-pane > p.muted:first-child { margin-top: 0; }
.inline-banner { margin: 4px 0 2px; }

/* ---- r45 收尾：花名册等普通表格同样固定高度、内部滚动 ---- */
.table-wrap {
  max-height: calc(100vh - 420px);
  min-height: 240px;
  overflow: auto;
}
@media (max-width: 768px) {
  .table-wrap { max-height: 72vh; }
}
/* 手机上标题也保持三级字号里的标题档，不再出现第四种字号 */
@media (max-width: 768px) {
  :root { --fs-title: 18px; }
}

/* ---- r45 收尾：说明小字统一到辅助档 11px，杜绝第四种字号 ---- */
.dashboard-page p.muted,
.dashboard-page span.muted,
.dashboard-page .muted { font-size: var(--fs-hint); }
.dashboard-page p.muted,
.dashboard-page span.muted { font-size: var(--fs-hint) !important; }

/* ===== r46 规范层：侧栏收窄 + 顶部系统名可见 + 边缘 hover 收起 + 控件与列宽按内容 ===== */

/* 1) 侧栏宽度：260 -> 224（收起 64 -> 52）；必须 relative，边缘收起条才对得上侧栏右边缘 */
.dashboard-layout{grid-template-columns:224px minmax(0,1fr)}
body.sidebar-collapsed .dashboard-layout{grid-template-columns:52px minmax(0,1fr)}
#dashboard-sidebar{position:relative;min-width:0;overflow:visible}

/* 2) 顶部系统名：r45 误把标题设成墨色，压在深色侧栏上对比度只有 1.01:1，等于隐形 */
#dashboard-sidebar .sidebar-head{
  padding:12px 12px 10px;
  border-bottom:1px solid rgba(148,163,184,.18);
  min-width:0;
}
#dashboard-sidebar .sidebar-head h2{
  margin:0;
  font-size:15px;
  line-height:1.35;
  font-weight:600;
  letter-spacing:.3px;
  color:#f8fafc;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.sidebar-collapsed #dashboard-sidebar .sidebar-head{display:none}

/* 3) 导航项：收窄后仍一行放下，不换行不省略（最长「进退场台账」实测 65px，可用宽度 200px） */
#dashboard-sidebar .nav-button{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:clip;
  padding-left:10px;
  padding-right:10px;
  height:34px;
}
#dashboard-sidebar .nav-list{gap:2px}

/* 4) 侧栏右边缘 hover 收起条（收起后镜像到屏幕最左侧） */
/* r50：收起条改为固定定位，箭头恒定在屏幕垂直中线，不随页面滚动跑（宏哥原话） */
:root{--sbw:224px}
body.sidebar-collapsed{--sbw:52px}
.sidebar-edge{
  position:fixed;
  top:0;
  left:calc(var(--sbw) - 12px);
  right:auto;
  width:24px;
  height:100vh;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:center;
  font:inherit;
  color:#475569;
  -webkit-appearance:none;
  appearance:none;
}
body.sidebar-collapsed .sidebar-edge{left:calc(var(--sbw) - 12px);right:auto}
.sidebar-edge-line{
  position:absolute;
  top:0;
  bottom:0;
  right:12px;
  width:2px;
  background:#cbd5e1;
  opacity:0;
  transition:opacity .12s ease,width .12s ease;
}
body.sidebar-collapsed .sidebar-edge-line{right:auto;left:12px}
.sidebar-edge-arrow{
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#fff;
  border:1px solid #d5dce6;
  color:#475569;
  font-size:22px;
  line-height:1;
  opacity:0;
  transition:opacity .12s ease;
  box-shadow:0 1px 3px rgba(15,23,42,.10);
}
.sidebar-edge-tip{
  position:absolute;
  left:34px;
  top:50%;
  transform:translateY(-50%);
  padding:1px 6px;
  background:#fff;
  border:1px solid #e5e9f0;
  border-radius:4px;
  color:#475569;
  font-size:11px;
  line-height:16px;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.sidebar-edge:hover .sidebar-edge-line,
.sidebar-edge:focus-visible .sidebar-edge-line{opacity:1;width:3px}
.sidebar-edge:hover .sidebar-edge-arrow,
.sidebar-edge:focus-visible .sidebar-edge-arrow{opacity:1}
.sidebar-edge-arrow:hover ~ .sidebar-edge-tip,
.sidebar-edge:focus-visible .sidebar-edge-tip{opacity:1}
.sidebar-edge:focus{outline:none}
.sidebar-edge:focus-visible{outline:2px solid #ea580c;outline-offset:-2px;border-radius:50%}
body.sidebar-collapsed .sidebar-edge-tip{border-radius:4px;left:50px}
/* r49: 收起态镜像到屏幕左缘时 32px 圆点会有一半在视口外，向内平移 16px 保证整个圆点可见 */
body.sidebar-collapsed .sidebar-edge-arrow{transform:translateX(16px)}
/* r50：小屏（侧栏变顶部横排）不留悬在屏幕中部的箭头，退回贴侧栏的绝对定位 */
@media (max-width: 900px){
  .sidebar-edge{position:absolute;top:0;height:100%;left:auto;right:-12px}
  body.sidebar-collapsed .sidebar-edge{left:-12px;right:auto}
}

/* 5) 筛选控件按内容收窄：月份框放下「2026-10」+箭头，班组框按最长班组名 */
#salary-pane-v1 > .toolbar-grid,
#salary-pane-v2 > .toolbar-grid,
#salary-pane-recon > .toolbar-grid,
#salary-pane-stat > .toolbar-grid,
#salary-pane-payment > .toolbar-grid,
#attendance-sheet-panel > .toolbar-grid{
  grid-template-columns:max-content max-content minmax(0,1fr);
  justify-content:start;
  gap:8px 12px;
  align-items:end;
}
#salary-v1-month,
#salary-v2-month,
#recon-month,
#payment-month,
#attendance-sheet-month,
#salary-summary-start,
#salary-summary-end{
  width:116px;
  min-width:116px;
  max-width:116px;
  padding-left:8px;
  padding-right:4px;
}
#salary-v1-team-filter,
#salary-v2-team-filter,
#attendance-team-filter,
#worker-team-filter{
  width:auto;
  min-width:104px;
  max-width:190px;
}

/* 6) 工资表列宽：r47 重算 —— 两行断句后按「表头最长单行片段」与「副本库真实数据 p90」取大 + 4px 内边距，
      整表总宽压到 1366 屏可用宽（1060px）以内，一屏放得下不横滚；身份证 18 位、账号 19 位一排放得下不折断；
      超长省略号 + 悬停看全文 */
#salary-v1-table,
#salary-v2-table{
  table-layout:fixed;
  width:100%;
}
#salary-v1-table th,
#salary-v1-table td,
#salary-v2-table th,
#salary-v2-table td{overflow:hidden;text-overflow:ellipsis;padding-left:2px;padding-right:2px}
/* r47 内层单元格（只读值/计算值/输入框）同向收窄左右内边距，2+2px，把宽度让给内容 */
#salary-v1-table tbody td .readonly-cell,
#salary-v1-table tbody td .calc-cell,
#salary-v2-table tbody td .readonly-cell,
#salary-v2-table tbody td .calc-cell{padding-left:2px;padding-right:2px}
#salary-v1-table tbody td input,
#salary-v2-table tbody td input{padding-left:2px;padding-right:2px}
/* r47 表头两行断句：每段一行，固定两行高度，不出现第三行 */
#salary-v1-table thead th,
#salary-v2-table thead th{white-space:normal;height:42px;line-height:1.25;vertical-align:middle}
#salary-v1-table thead th .th-line,
#salary-v2-table thead th .th-line{display:block}

/* r47.1：合计/小计行零截断 —— 字号降一档（数据行 13px → 汇总行 10px），右对齐，禁省略号（真超长就视觉外溢，不出现 …） */
#salary-v1-table tfoot td,
#salary-v2-table tfoot td{font-size:10px;line-height:1.4;padding:6px 2px;white-space:nowrap;overflow:visible;text-overflow:clip}
#salary-v1-table tfoot td.total-cell,
#salary-v2-table tfoot td.total-cell{text-align:right;font-variant-numeric:tabular-nums}
#salary-v1-table tfoot td.name-cell,
#salary-v2-table tfoot td.name-cell{text-align:right;padding-right:8px;font-weight:600;overflow:visible;text-overflow:clip}
/* 宽屏给竖向滚动条留位，避免最右签字列被滚动条压住 */
@media (min-width:1500px){
  .sheet-table-wrap{scrollbar-gutter:stable}
}
#salary-v1-table thead th:nth-child(1),#salary-v1-table tbody td:nth-child(1){width:36px}
#salary-v1-table thead th:nth-child(2),#salary-v1-table tbody td:nth-child(2){width:57px}
#salary-v1-table thead th:nth-child(3),#salary-v1-table tbody td:nth-child(3){width:148px}
#salary-v1-table thead th:nth-child(4),#salary-v1-table tbody td:nth-child(4){width:85px}
#salary-v1-table thead th:nth-child(5),#salary-v1-table tbody td:nth-child(5){width:155px}
#salary-v1-table thead th:nth-child(6),#salary-v1-table tbody td:nth-child(6){width:58px}
#salary-v1-table thead th:nth-child(7),#salary-v1-table tbody td:nth-child(7){width:36px}
#salary-v1-table thead th:nth-child(8),#salary-v1-table tbody td:nth-child(8){width:66px}
#salary-v1-table thead th:nth-child(9),#salary-v1-table tbody td:nth-child(9){width:49px}
#salary-v1-table thead th:nth-child(10),#salary-v1-table tbody td:nth-child(10){width:51px}
#salary-v1-table thead th:nth-child(11),#salary-v1-table tbody td:nth-child(11){width:38px}
#salary-v1-table thead th:nth-child(12),#salary-v1-table tbody td:nth-child(12){width:38px}
#salary-v1-table thead th:nth-child(13),#salary-v1-table tbody td:nth-child(13){width:75px}
#salary-v1-table thead th:nth-child(14),#salary-v1-table tbody td:nth-child(14){width:51px}
#salary-v1-table thead th:nth-child(15),#salary-v1-table tbody td:nth-child(15){width:116px}
/* 工资表（2版）13 列，同一套算法 */
#salary-v2-table thead th:nth-child(1),#salary-v2-table tbody td:nth-child(1){width:36px}
#salary-v2-table thead th:nth-child(2),#salary-v2-table tbody td:nth-child(2){width:57px}
#salary-v2-table thead th:nth-child(3),#salary-v2-table tbody td:nth-child(3){width:148px}
#salary-v2-table thead th:nth-child(4),#salary-v2-table tbody td:nth-child(4){width:78px}
#salary-v2-table thead th:nth-child(5),#salary-v2-table tbody td:nth-child(5){width:155px}
#salary-v2-table thead th:nth-child(6),#salary-v2-table tbody td:nth-child(6){width:58px}
#salary-v2-table thead th:nth-child(7),#salary-v2-table tbody td:nth-child(7){width:74px}
#salary-v2-table thead th:nth-child(8),#salary-v2-table tbody td:nth-child(8){width:74px}
#salary-v2-table thead th:nth-child(9),#salary-v2-table tbody td:nth-child(9){width:49px}
#salary-v2-table thead th:nth-child(10),#salary-v2-table tbody td:nth-child(10){width:84px}
#salary-v2-table thead th:nth-child(11),#salary-v2-table tbody td:nth-child(11){width:68px}
#salary-v2-table thead th:nth-child(12),#salary-v2-table tbody td:nth-child(12){width:62px}
#salary-v2-table thead th:nth-child(13),#salary-v2-table tbody td:nth-child(13){width:116px}

/* 身份证、账号、元/工日、工日：一排放得下，不折断 */
#salary-v1-table tbody td:nth-child(2),
#salary-v1-table tbody td:nth-child(3),
#salary-v1-table tbody td:nth-child(5),
#salary-v1-table tbody td:nth-child(6){white-space:nowrap}

/* 金额与工日类右对齐（含框内输入） */
#salary-v1-table tbody td:nth-child(5),
#salary-v1-table tbody td:nth-child(6),
#salary-v1-table tbody td:nth-child(7),
#salary-v1-table tbody td:nth-child(8),
#salary-v1-table tbody td:nth-child(9),
#salary-v1-table tbody td:nth-child(10),
#salary-v1-table tbody td:nth-child(11),
#salary-v1-table tbody td:nth-child(12),
#salary-v1-table tbody td:nth-child(13),
#salary-v1-table tbody td:nth-child(14){text-align:right}
#salary-v1-table tbody td:nth-child(5) input,
#salary-v1-table tbody td:nth-child(6) input,
#salary-v1-table tbody td:nth-child(7) input,
#salary-v1-table tbody td:nth-child(8) input,
#salary-v1-table tbody td:nth-child(9) input,
#salary-v1-table tbody td:nth-child(10) input,
#salary-v1-table tbody td:nth-child(11) input,
#salary-v1-table tbody td:nth-child(12) input,
#salary-v1-table tbody td:nth-child(13) input,
#salary-v1-table tbody td:nth-child(14) input{text-align:right}
/* 来源小字保持左起，省略号生效 */
#salary-v1-table .cell-hint,
#salary-v1-table .ro-hint,
#salary-v1-table .n-breakdown{text-align:left;overflow:hidden;text-overflow:ellipsis}

/* 7) 页面本身不允许横向滚动（表格超宽只在容器内滚） */
body.dashboard-page{overflow-x:hidden}
.sheet-table-wrap,.table-wrap{overflow:auto;max-width:100%}

/* 8) 手机（<=430px）：固定 160px 的输入框会把页面撑出横向滚动条，改成可收缩 */
@media (max-width:430px){
  body.dashboard-page .field input,
  body.dashboard-page .field select{min-width:0;width:100%;max-width:100%}
  #salary-pane-v1 > .toolbar-grid,
  #salary-pane-v2 > .toolbar-grid,
  #salary-pane-recon > .toolbar-grid,
  #salary-pane-stat > .toolbar-grid,
  #salary-pane-payment > .toolbar-grid,
  #attendance-sheet-panel > .toolbar-grid{grid-template-columns:minmax(0,1fr)}
  #salary-v1-month,#salary-v2-month,#recon-month,#payment-month,#attendance-sheet-month,
  #salary-summary-start,#salary-summary-end,#salary-v1-team-filter,#salary-v2-team-filter,
  #attendance-team-filter,#worker-team-filter{width:100%;max-width:100%}
  #salary-v1-table{width:1316px;min-width:1316px}
}

/* ================= r48：花名册 32 列（照 templates\花名册.xlsx 的列序与断句） ================= */
/* 筛选栏：三个控件收窄、同一行不折行，重置/下载靠右，右侧不留大片空白 */
.roster-filter-bar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; }
.roster-filter-bar > .field { min-width: 0; }
#worker-search { width: 220px; }
#worker-team-filter { width: 110px; }
#worker-status-filter { width: 110px; }
.roster-filter-actions { display: flex; gap: 8px; margin-left: 2px; }
.roster-filter-actions button { padding: 6px 14px; }
/* r51①：花名册「查询」用主按钮，与「重置」同高同圆角，一眼能看见 */
.roster-filter-actions #worker-query-button { min-height: 30px; height: 30px; padding: 0 16px; font-weight: 700; }
.roster-filter-actions #worker-reset-button,
.roster-filter-actions #worker-export-button { min-height: 30px; height: 30px; padding: 0 14px; }

/* ================= r51②：工资 2 版凭证区可折叠（默认收起） ================= */
/* 开关放在 2 版表格上方的状态行右侧：收起时表格下方什么都不剩，底边才能贴到窗口底 12px */
#salary-v2-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
#salary-v2-status-row .status-text { margin: 0; flex: 1 1 auto; min-width: 0; }
#salary-v2-voucher-toggle { min-height: 28px; height: 28px; padding: 0 12px; flex: 0 0 auto; }

/* ===== r52：工资表班组筛选的可见反馈行（表格上方一行，截图/现场一眼可见）===== */
.salary-team-summary { margin: 2px 0 6px; font-size: 13px; font-weight: 600; color: var(--c-accent); }
.salary-team-summary.hidden { display: none; }
#salary-v2-voucher-body > .toolbar-grid { margin-top: 6px; }

/* ================= r51③：项目管理页页面不滚，列表/表单在容器内滚 ================= */
#projects-scroll { overflow-y: auto; overflow-x: hidden; max-width: 100%; box-sizing: border-box; min-height: 0; }

/* 表格：32 列如实撑开，横向滚动条常显（只对这一张表放开，工资表不受影响） */
.roster-table-wrap { overflow: auto; overflow-x: scroll; scrollbar-width: auto; scrollbar-gutter: stable; 
  max-height: calc(100vh - 331px);
}
/* r48.2：花名册面板底部内边距清零，让表格底边只离窗口 12px（工资/考勤/台账面板不受影响） */
#workers-panel { padding-bottom: 0; margin-bottom: -3px; }
/* 上面 3px 负边距是为了抵消「面板 1px 下边框 + 主区 14px 下内边距」里的 3px，
   让花名册表格底边离窗口底边正好 12px，同时页面不出现纵向滚动条（不出现双滚动条）。 */
#workers-table { table-layout: fixed; }
#workers-table th,
#workers-table td { padding: 3px 4px; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; }
#workers-table thead th { position: sticky; top: 0; z-index: 4; background: #f7f9fc; white-space: normal; vertical-align: middle; }
#workers-table th .th-line { display: block; white-space: nowrap; line-height: 1.25; }
#workers-table th:not(.th-two-line) { white-space: nowrap; }
#workers-table td.ta-center,
#workers-table th.ta-center { text-align: center; }
#workers-table td.cell-clip { text-overflow: ellipsis; }

/* 「操作」列 sticky 固定在右侧：滚动时始终可见，带左边框与背景 */
#workers-table th.roster-action-col,
#workers-table td.roster-action-col {
  position: sticky;
  right: 0;
  background: #fff;
  border-left: 1px solid var(--c-line);
  box-shadow: -4px 0 6px -4px rgba(20, 40, 80, 0.18);
}
#workers-table th.roster-action-col { background: #f7f9fc; z-index: 6; }
#workers-table tbody tr:nth-child(even) td.roster-action-col { background: #fafbfd; }
.roster-actions { flex-direction: row; flex-wrap: nowrap; gap: 2px; align-items: center; justify-content: center; }
.roster-actions button { padding: 0 5px; font-size: 11px; line-height: 1; white-space: nowrap; min-height: 25px; height: 25px; }

/* 照片类三列 + 照片列：44px 缩略图，无图留淡灰「—」 */
.roster-thumb { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; line-height: 0; }
.roster-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 3px; border: 1px solid var(--c-line); }
.roster-thumb-empty { color: #b0b7c3; font-size: 12px; }

/* ===== r49：顶栏去掉后的「面板标题行 + 当前项目」、侧栏退出登录、面板表格吃满窗口 ===== */
.panel-head{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin:0 0 8px;
}
body.dashboard-page .panel-head h2{margin:0}
.panel-head .compact-field{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  max-width:100%;
}
.panel-head .compact-field label{
  white-space:nowrap;
  font-size:var(--fs-hint);
  color:var(--c-ink-2);
}
.panel-head .compact-field select{
  min-height:28px;
  padding:2px 8px;
  max-width:320px;
  font-size:var(--fs-body);
}
.panel-head .compact-field.hidden{display:none}

#dashboard-sidebar .logout-button{
  width:100%;
  height:32px;
  margin-top:10px;
  padding:0 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(226,232,240,.14);
  border-radius:12px;
  background:rgba(148,163,184,.08);
  color:#cbd5e1;
  font-size:var(--fs-body);
  white-space:nowrap;
  overflow:hidden;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
}
#dashboard-sidebar .logout-button:hover{
  background:rgba(248,113,113,.18);
  border-color:rgba(248,113,113,.35);
  color:#fecaca;
}
body.sidebar-collapsed #dashboard-sidebar .logout-button{display:none}

/* r58：考勤机导入时未匹配花名册的工人（整块三行）红底提示，不许静默丢弃 */
tr.attendance-unmatched-row > td { background: #fdecea; }
tr.attendance-unmatched-row > td .editable-cell { background: #fdecea; }
/* ===== r59：花名册列宽真源（与 dashboard.js 的 ROSTER_COLUMNS.width 一一对应，改一处必须同步另一处）===== */
#workers-table th:nth-child(1),#workers-table td:nth-child(1){width:40px}
#workers-table th:nth-child(2),#workers-table td:nth-child(2){width:64px}
#workers-table th:nth-child(3),#workers-table td:nth-child(3){width:148px}
#workers-table th:nth-child(4),#workers-table td:nth-child(4){width:40px}
#workers-table th:nth-child(5),#workers-table td:nth-child(5){width:40px}
#workers-table th:nth-child(6),#workers-table td:nth-child(6){width:96px}
#workers-table th:nth-child(7),#workers-table td:nth-child(7){width:42px}
#workers-table th:nth-child(8),#workers-table td:nth-child(8){width:76px}
#workers-table th:nth-child(9),#workers-table td:nth-child(9){width:44px}
#workers-table th:nth-child(10),#workers-table td:nth-child(10){width:64px}
#workers-table th:nth-child(11),#workers-table td:nth-child(11){width:148px}
#workers-table th:nth-child(12),#workers-table td:nth-child(12){width:148px}
#workers-table th:nth-child(13),#workers-table td:nth-child(13){width:258px}
#workers-table th:nth-child(14),#workers-table td:nth-child(14){width:94px}
#workers-table th:nth-child(15),#workers-table td:nth-child(15){width:64px}
#workers-table th:nth-child(16),#workers-table td:nth-child(16){width:84px}
#workers-table th:nth-child(17),#workers-table td:nth-child(17){width:84px}
#workers-table th:nth-child(18),#workers-table td:nth-child(18){width:84px}
#workers-table th:nth-child(19),#workers-table td:nth-child(19){width:64px}
#workers-table th:nth-child(20),#workers-table td:nth-child(20){width:40px}
#workers-table th:nth-child(21),#workers-table td:nth-child(21){width:64px}
#workers-table th:nth-child(22),#workers-table td:nth-child(22){width:64px}
#workers-table th:nth-child(23),#workers-table td:nth-child(23){width:52px}
#workers-table th:nth-child(24),#workers-table td:nth-child(24){width:110px}
#workers-table th:nth-child(25),#workers-table td:nth-child(25){width:90px}
#workers-table th:nth-child(26),#workers-table td:nth-child(26){width:180px}
#workers-table th:nth-child(27),#workers-table td:nth-child(27){width:160px}
#workers-table th:nth-child(28),#workers-table td:nth-child(28){width:52px}
#workers-table th:nth-child(29),#workers-table td:nth-child(29){width:76px}
#workers-table th:nth-child(30),#workers-table td:nth-child(30){width:76px}
#workers-table th:nth-child(31),#workers-table td:nth-child(31){width:56px}
#workers-table th:nth-child(32),#workers-table td:nth-child(32){width:84px}
#workers-table th:nth-child(33),#workers-table td:nth-child(33){width:64px}
#workers-table th:nth-child(34),#workers-table td:nth-child(34){width:74px}
#workers-table th:nth-child(35),#workers-table td:nth-child(35){width:96px}
#workers-table th:nth-child(36),#workers-table td:nth-child(36){width:64px}
#workers-table th:nth-child(37),#workers-table td:nth-child(37){width:140px}
#workers-table th:nth-child(38),#workers-table td:nth-child(38){width:76px}
#workers-table th:nth-child(39),#workers-table td:nth-child(39){width:104px}
#workers-table th:nth-child(40),#workers-table td:nth-child(40){width:76px}
#workers-table th:nth-child(41),#workers-table td:nth-child(41){width:88px}
#workers-table th:nth-child(42),#workers-table td:nth-child(42){width:64px}
#workers-table th:nth-child(43),#workers-table td:nth-child(43){width:96px}
#workers-table th:nth-child(44),#workers-table td:nth-child(44){width:56px}
#workers-table th:nth-child(45),#workers-table td:nth-child(45){width:92px}
#workers-table th:nth-child(46),#workers-table td:nth-child(46){width:92px}
#workers-table th:nth-child(47),#workers-table td:nth-child(47){width:84px}
#workers-table th:nth-child(48),#workers-table td:nth-child(48){width:84px}
#workers-table th:nth-child(49),#workers-table td:nth-child(49){width:84px}
#workers-table th:nth-child(50),#workers-table td:nth-child(50){width:76px}
#workers-table th:nth-child(51),#workers-table td:nth-child(51){width:110px}
#workers-table th:nth-child(52),#workers-table td:nth-child(52){width:160px}
#workers-table th:nth-child(53),#workers-table td:nth-child(53){width:108px}

/* r59：长文本两行内截断（企业统一社会信用代码/所属单位/特长），超出用省略号，鼠标悬停看全文 */
#workers-table td.cell-clamp2 { text-overflow: clip; }
#workers-table td .cell-clamp2-inner {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; word-break: break-all;
  line-height: 1.25; max-height: 2.5em;
}

/* ===== r59：导出字段弹窗（宽 680 -> min(1000px, 92vw)）+ 已选字段 chips ===== */
.worker-export-modal { width: 100%; max-width: min(1000px, 92vw); }
.export-chips-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.export-chips-label { font-size: 13px; font-weight: 600; color: #334155; }
.export-chips {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px;
  min-height: 40px; max-height: 132px; overflow-y: auto;
  padding: 8px; margin-bottom: 12px;
  border: 1px dashed #cbd5e1; border-radius: 10px; background: #fbfcfe;
}
.export-chips-empty { font-size: 12px; color: #94a3b8; }
.export-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 9px; border: 1px solid #c7d2e4; border-radius: 999px;
  background: #fff; font-size: 12px; line-height: 1.6; color: #1f2937;
  cursor: grab; user-select: none; touch-action: none;
}
.export-chip:hover { border-color: #2f6fed; }
.export-chip.dragging { opacity: 0.45; cursor: grabbing; border-style: dashed; border-color: #2f6fed; }
.export-chip-title { white-space: nowrap; }
.export-chip-x {
  border: none; background: transparent; color: #94a3b8;
  font-size: 14px; line-height: 1; padding: 0 3px; cursor: pointer;
}
.export-chip-x:hover { color: #b91c1c; }

/* r59-B：籍贯「只能填汉字」即时提示 */
.field-hint {
  display: block; margin-top: 4px;
  font-size: 12px; line-height: 1.4; color: #94a3b8;
}
.field-hint.is-error { color: #dc2626; font-weight: 600; }

/* r60：危险操作（全部清空）—— 红边框红字，与主色按钮区分；置灰时不可点 */
.danger-outline-button {
  background: #ffffff;
  border: 1.5px solid #b91c1c;
  color: #b91c1c;
  box-shadow: none;
}

.danger-outline-button:hover {
  background: #fef2f2;
}

.danger-outline-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* r60：清空确认弹窗里的关联数据清单 */
.clear-related-list {
  margin: 8px 0 4px;
  padding-left: 20px;
  font-size: 14px;
  color: #1e293b;
}

.clear-related-list li {
  margin: 2px 0;
}


/* ==================== r65 考勤表：固定「合计天数」+「操作」两列 + 定宽显示（日期列 36px） ==================== */
/* 宏哥口径：常规窗口不拖滑条就要看到完整「合计天数」；「签字确认」「备注」拖滑条才出来；「操作」常驻右侧。
   r65：宏哥机器有效窗口偏窄（1920 屏 125% 缩放 → CSS 宽约 1536），流式「合计天数」仍会被操作列压住，
        故合计天数改为 sticky right:70px（操作 70 + 合计 80 = 150 常驻右侧），列宽与 colgroup 一律不动。
   页面整体横滚仍为 0，横滚只发生在 #attendance-sheet-panel 内部的 .sheet-table-wrap。 */
#attendance-sheet-panel { min-width: 0; max-width: 100%; overflow-x: hidden; }
#attendance-sheet-panel .sheet-table-wrap {
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;   /* 滑条常留位：既看得见，也不会在最右把「操作」列压歪 */
}
#attendance-sheet-table th,
#attendance-sheet-table td { padding: 1px 1px; }

/* 列宽：colgroup 说了算，这里再兜一层 min/max，防止被内容撑开或被浏览器压窄
   合计 44 + 88 + 68 + 31×36 + 80 + 88 + 100 + 70 = 1654px
   r65 后「合计天数」常驻右侧，可视区判据不再是累计宽度，而是「容器 clientWidth − 150（操作 70 + 合计 80）」 */
#attendance-sheet-table col.col-seq { width: 44px; }
#attendance-sheet-table col.col-name { width: 88px; }
#attendance-sheet-table col.col-cat { width: 68px; }
#attendance-sheet-table col.col-day { width: 36px; }
#attendance-sheet-table col.col-total { width: 80px; }
#attendance-sheet-table col.col-sign { width: 88px; }
#attendance-sheet-table col.col-remark { width: 100px; }
#attendance-sheet-table col.col-ops { width: 70px; }

#attendance-sheet-table .seq-cell,
#attendance-sheet-table .seq-head { width: 44px; min-width: 44px; max-width: 44px; }
#attendance-sheet-table .name-cell,
#attendance-sheet-table .name-head { width: 88px; min-width: 88px; max-width: 88px; }
#attendance-sheet-table .cat-cell { width: 68px; min-width: 68px; max-width: 68px; }

/* 日期列：36px 是硬下限（12~13px 字号下「24.5」约 27~29px 加内边距仍放得下），1366 也不再往下压 */
#attendance-sheet-table col.col-day { min-width: 36px; }
#attendance-sheet-table .editable-cell.mark-cell,
#attendance-sheet-table .editable-cell.overtime-cell { min-width: 0; }

/* 加班(小时) 那一列要装得下 4 个汉字 + 括号：字号降一档、内边距收紧，绝不截字 */
#attendance-sheet-table .cat-cell.overtime-label {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: -0.2px;
  padding: 2px 1px;
  white-space: nowrap;
}

/* 合计天数：r65 起固定在右侧（right:70px），与 fixed「操作」列相邻不叠压；底色逐档铺实、滚动不透色 */
#attendance-sheet-table .att-col-total {
  position: -webkit-sticky;
  position: sticky;
  right: 70px;
  z-index: 3;
  width: 80px; min-width: 80px; max-width: 80px;
  background: #fef3c7;
  border-left: 2px solid #cbd5e1;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
#attendance-sheet-table thead th.att-col-total { z-index: 6; background: #f1f5f9; }
#attendance-sheet-table tr.attendance-unmatched-row > td.att-col-total { background: #fdecea; }

/* 小计：r86 起也固定在右侧（right:150px = 操作 70 + 合计 80），
   与「合计天数」「操作」三列并排常驻，向右拖滑条时一起不动。
   列宽沿用 dashboard.html 里的 56px（col.col-subtotal），这里不改宽度；
   分隔线只画在小计列左边这一条（合计列左边那条仍在），两道线各管各的列边界，不会重成双线。 */
#attendance-sheet-table .att-col-subtotal {
  position: -webkit-sticky;
  position: sticky;
  right: 150px;
  z-index: 3;
  background: #fff;
  border-left: 2px solid #cbd5e1;
  white-space: nowrap;
}
#attendance-sheet-table thead th.att-col-subtotal { z-index: 6; background: #f1f5f9; }
#attendance-sheet-table tbody tr:nth-child(even) > td.att-col-subtotal { background: #fafbfd; }
#attendance-sheet-table tr.attendance-unmatched-row > td.att-col-subtotal { background: #fdecea; }

/* 签字确认 / 备注：普通流式列（靠拖滑条拖出来），宽度定死 */
#attendance-sheet-table .att-col-sign { width: 88px; min-width: 88px; max-width: 88px; }
#attendance-sheet-table .att-col-remark,
#attendance-sheet-table td.att-col-remark.remark-cell {
  width: 100px; min-width: 100px; max-width: 100px;
  vertical-align: middle;
}
#attendance-sheet-table .att-col-remark .remark-view {
  padding: 1px 3px; font-size: 11px; max-height: 72px; overflow: auto;
}

/* 唯一一个固定列：操作（right:0），底色逐档铺实，滚动时不透色 */
#attendance-sheet-table .att-col-ops {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 3;
  width: 70px; min-width: 70px; max-width: 70px;
  background: #fff;
  border-left: 2px solid #cbd5e1;
}
#attendance-sheet-table .att-col-ops .secondary-button {
  padding: 2px 6px; font-size: 12px; line-height: 1.3;
}
#attendance-sheet-table thead th.att-col-ops { z-index: 6; background: #f1f5f9; }
#attendance-sheet-table tbody tr:nth-child(even) > td.att-col-ops { background: #fafbfd; }
#attendance-sheet-table tr.attendance-unmatched-row > td.att-col-ops { background: #fdecea; }

/* 加班行数字：不许被 overflow 截、不许省略号，字号不低于 12px */
#attendance-sheet-table .overtime-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* 合计行（tfoot）：合计天数值完整、不省略；操作列同底色 */
#attendance-sheet-table tfoot tr.att-total-row > td { background: #eef3fa; }
#attendance-sheet-table tfoot tr.att-total-row > td.att-total-label {
  text-align: center; font-weight: 700; color: #0b4a8f;
}
#attendance-sheet-table tfoot tr.att-total-row > td.att-total-value {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  color: #0b4a8f;
  font-weight: 700;
  font-size: 13px;
}
#attendance-sheet-table tfoot tr.att-total-row > td.att-col-total {
  z-index: 7;
  background: #eef3fa;
  border-left: 2px solid #cbd5e1;
}
#attendance-sheet-table tfoot tr.att-total-row > td.att-col-ops {
  z-index: 7;
  background: #eef3fa;
  border-left: 2px solid #cbd5e1;
}
#attendance-sheet-table tfoot tr.att-total-row > td.att-col-subtotal {
  z-index: 7;
  background: #eef3fa;
  border-left: 2px solid #cbd5e1;
}

/* 未匹配·不录入 标注（红底行照样能核对，但不可编辑、不会保存） */
#attendance-sheet-table .unmatched-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #b91c1c;
  font-weight: 600;
}
#attendance-sheet-table .unmatched-tag {
  font-size: 10px;
  font-weight: 400;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  padding: 0 3px;
  white-space: nowrap;
}
#attendance-sheet-table .editable-cell[data-locked="1"] { cursor: not-allowed; color: #b91c1c; }

/* 1366 / 1440 一档：允许横滚，但不许把日期列压到 40px 以下，加班数字照样完整 */
@media (max-width: 1500px) {
  #attendance-sheet-table th,
  #attendance-sheet-table td { padding: 1px 0; font-size: 12px; }
  #attendance-sheet-table .editable-cell { padding: 1px 1px; min-width: 0; }
  #attendance-sheet-table .overtime-cell { font-size: 12px; }
}

/* r86：打印时三列都回到正常表格流。sticky 只在窗口滚动时有意义，
   打印若保留 sticky，个别浏览器会把固定列叠到别的列上或撑宽版面；这里统一复位，
   版面与 r84 一致（A4 横向 1 页宽、每页 6 人），列宽/换行都不受影响。 */
@media print {
  #attendance-sheet-table .att-col-subtotal,
  #attendance-sheet-table .att-col-total,
  #attendance-sheet-table .att-col-ops {
    position: static;
    right: auto;
    z-index: auto;
  }
}

/* r68：花名册「年龄」超过 60 岁黄底（正好 60 不黄；单元格文字/宽度/对齐不变） */
#workers-table td.age-over-60 { background: #FFFF00; }

/* r71：三级教育表里查无此人（仅 62.62亩/项目4，序号 >= 367）→ 整行淡黄底。
   让宏哥在屏幕上一眼看到这批「有考勤机记录但三级教育表里没有」的人，需去补交资料。
   用 #FFF9C4 淡黄而非 #FFFF00：整行 50+ 列纯黄太晃眼，淡黄够辨认又不刺眼。
   特异性说明：本条属性 #workers-table + tr.class + > td（1-1-1）已压过
   `#workers-table tbody tr:nth-child(even) td.roster-action-col`（1-2-1 中 td 是 class 选择器）
   对普通单元格的斑马纹（那条只作用于 .roster-action-col）；下方的
   「sticky 操作列同色」两条专门负责横滚时不透底，缺了会出现一列亮白断层。 */
#workers-table tbody tr.roster-row-no-education > td { background: #FFF9C4 !important; }
/* sticky 右侧「操作」列自身有 background:#fff / 斑马 #fafbfd 两层规则，必须单独压成同色，
   否则整行标黄时最右那列仍是白的，横向滚动看起来像穿了个洞。 */
#workers-table tbody tr.roster-row-no-education > td.roster-action-col,
#workers-table tbody tr.roster-row-no-education:nth-child(even) > td.roster-action-col {
  background: #FFF9C4 !important;
}

/* ===== r78：花名册列表页内联编辑 ===== */
/* 可编辑的格子给个手型/文本光标，让宏哥知道这里能直接点 */
#workers-table tbody td[data-col] { cursor: cell; }
/* 编辑中：格子本身高亮，避免和隔壁列看混 */
#workers-table tbody td.cell-editing { background: #E8F0FE !important; box-shadow: inset 0 0 0 2px #1a73e8; padding: 0 !important; }
#workers-table tbody td.cell-editing .inline-cell-input {
  width: 100%;
  min-width: 88px;
  box-sizing: border-box;
  border: 1px solid #1a73e8;
  border-radius: 3px;
  padding: 3px 4px;
  font: inherit;
  color: inherit;
  background: #fff;
  outline: none;
}
/* 提交中：浅灰底（轻量提示，不打断视线） */
#workers-table tbody td.cell-saving { background: #EEF1F4 !important; }
#workers-table tbody td.cell-saving::after {
  content: "⋯";
  color: #5f6368;
  font-weight: 700;
  margin-left: 2px;
}
/* 存好了短暂绿闪 / 存失败红闪 */
#workers-table tbody td.cell-saved { background: #E6F4EA !important; }
#workers-table tbody td.cell-error { background: #FCE8E6 !important; box-shadow: inset 0 0 0 2px #d93025; }

/* ===== r89：点图放大（灯箱） + 身份证有效期过期提示 ===== */
.photo-preview img,
.roster-thumb img,
img[data-zoomable] {
  cursor: zoom-in;
}

body.lightbox-open { overflow: hidden; }

.img-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 23, 42, 0.88);
}
.img-lightbox.hidden { display: none; }
.img-lightbox-img {
  max-width: 94vw; max-height: 88vh;
  object-fit: contain; background: #fff;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease; cursor: zoom-in; touch-action: none;
}
.img-lightbox-close {
  position: absolute; top: 14px; right: 18px;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #0f172a;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.img-lightbox-close:hover { background: #fff; }
.img-lightbox-tip {
  position: absolute; bottom: 16px; left: 0; right: 0;
  text-align: center; color: #e2e8f0; font-size: 12px; pointer-events: none;
}

.expired-text { color: #b91c1c; font-weight: 600; }
.expiring-text { color: #b45309; font-weight: 600; }
.badge-expired {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  border-radius: 4px; border: 1px solid #fca5a5; background: #fee2e2;
  color: #b91c1c; font-size: 11px; line-height: 16px; white-space: nowrap;
}
.input-expired { border-color: #ef4444 !important; background: #fff1f2; }
.input-expiring { border-color: #f59e0b !important; background: #fffbeb; }
.toast.warn { background-color: #d97706; }
.field-hint-warn { color: #b91c1c; font-weight: 600; }
.field-hint-soft { color: #64748b; }

/* ===== r91：灯箱左右翻图（上一个 / 下一个）—— 追加，不动上面 r89 的规则 ===== */
.img-lightbox { touch-action: none; }
.img-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 54px; height: 54px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.72); color: #0f172a;
  font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.img-lightbox-nav:hover { background: #fff; }
.img-lightbox-prev { left: 10px; }
.img-lightbox-next { right: 10px; }
.img-lightbox-count {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 2px 10px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.62); color: #f8fafc;
  font-size: 13px; line-height: 20px; pointer-events: none;
}
.img-lightbox-caption {
  position: absolute; bottom: 42px; left: 12px; right: 12px;
  text-align: center; color: #f8fafc; font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65); pointer-events: none;
}
.img-lightbox.is-single .img-lightbox-nav,
.img-lightbox.is-single .img-lightbox-count,
.img-lightbox.is-single .img-lightbox-caption { display: none; }
@media (max-width: 640px) {
  .img-lightbox-nav {
    width: 44px; height: 44px; font-size: 24px;
    background: rgba(255, 255, 255, 0.6);
  }
  .img-lightbox-prev { left: 8px; }
  .img-lightbox-next { right: 8px; }
}

/* r97：工资表1/2 筛选条改版 —— 与考勤表同一套 inline-field / checkbox-field 观感；
       原先 #salary-pane-v1/v2 > .toolbar-grid 的三列规则不再命中（结构调整后无 .toolbar-grid）。 */
#salary-pane-v1 > .sheet-toolbar,
#salary-pane-v2 > .sheet-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px 16px;
  margin-top:12px;
}
#salary-pane-v1 > .sheet-toolbar .sheet-toolbar-filters,
#salary-pane-v2 > .sheet-toolbar .sheet-toolbar-filters{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 16px;
  min-width:0;
}
#salary-pane-v1 > .sheet-toolbar .sheet-toolbar-buttons,
#salary-pane-v2 > .sheet-toolbar .sheet-toolbar-buttons{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
/* 复选框与文字垂直居中，别被 .inline-field 的 min-height 顶歪 */
#salary-pane-v1 #salary-v1-hide-zero,
#salary-pane-v2 #salary-v2-hide-zero{
  margin:0;
  width:16px;
  height:16px;
  min-height:0;
  flex-shrink:0;
}
/* 月份/班组宽度沿用既有 ID 规则（116px / auto 104-190px），此处不重复 */
@media (max-width:768px){
  #salary-pane-v1 > .sheet-toolbar .sheet-toolbar-buttons,
  #salary-pane-v2 > .sheet-toolbar .sheet-toolbar-buttons{ flex-wrap:wrap; }
}

/* r99：存档徽标（花名册 / 考勤表 / 工资表 三处共用） */
.archive-badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:2px 10px; border-radius:10px; font-size:12px; line-height:20px;
  background:#e8f5e9; color:#1b5e20; border:1px solid #a5d6a7;
}
.archive-badge.locked{ background:#fff3e0; color:#8a5300; border-color:#ffcc80; }
.archive-badge.locked::before{ content:"🔒 "; }

/* ==================== r101：手机端排版（花名册优先） ==================== */
/* 根因修复：1556 行的 768px 单列被 1669 行的全局规则压死，这里用 !important 收回。
   本段只追加，不改 1556/1669/1947/2003 原有规则（那是电脑端已验收的版式依据）。 */
@media (max-width: 768px) {
  body.dashboard-page .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.dashboard-page #dashboard-sidebar {
    position: static;
  }

  /* 筛选栏：四个控件两列排，别挤成一条 */
  body.dashboard-page .roster-filter-bar {
    flex-wrap: wrap !important;
    align-items: stretch;
    gap: 8px;
  }
  body.dashboard-page .roster-filter-bar > .field {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  body.dashboard-page #worker-search,
  body.dashboard-page #worker-team-filter,
  body.dashboard-page #worker-status-filter,
  body.dashboard-page #worker-job-filter {
    width: 100% !important;
    max-width: 100%;
  }

  /* 按钮行：两排四列网格，文字不再竖排 */
  body.dashboard-page .roster-filter-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
  }
  body.dashboard-page .roster-filter-actions button {
    width: 100%;
    min-height: 40px;
    height: auto;
    padding: 0 6px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 表内编辑/删除：触摸可点 */
  body.dashboard-page .roster-actions { gap: 4px; }
  body.dashboard-page .roster-actions button {
    min-height: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  /* 表格容器跟着面板宽，别再被侧栏挤窄 */
  body.dashboard-page .roster-table-wrap { max-width: 100%; }

  /* 内边距收窄：手机屏本来就窄，main 20px + panel 边框 2px + panel 20px = 42px 内边距
     会把表格容器压到主区的 89.8%（370/412），达不到「≥95%」判据。
     收到 4px 后 = 412 - 8 - 2 - 8 = 394px（95.6%）。只加在 r101 段，不动电脑端。 */
  body.dashboard-page .dashboard-main { padding: 4px; gap: 8px; }
  body.dashboard-page .dashboard-panel { padding: 4px; }

  /* 侧栏边缘收起条：小屏侧栏已变顶部横排，这条 fixed 条不该再存在。
     它 left:calc(var(--sbw) - 12px) 的参照块在窄屏下把文档撑宽 59px
     （html scrollWidth 471 vs clientWidth 412）——实测确认，必须一起收掉。 */
  body.dashboard-page #sidebar-edge { display: none !important; }

  /* ==================== r133：手机端触控与底部按钮可见性 ====================
     问题1（真 bug）：编辑工人表单有 30+ 字段，一屏放不下。原来「保存工人/重置/取消」
     在表单最末尾，手机上必须滚到最底才看得见，用户以为弹窗被屏幕切掉、系统坏了。
     改成 sticky 吸底常显：任何滚动位置都能看到并点到保存。
     问题2：表内「编辑/删除」只有 36px 高，手指粗容易点错删除 —— 提到 44px 并给操作列留白。 */
  body.dashboard-page #worker-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    background: #ffffff;
    border-top: 1px solid var(--c-line);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.10);
    margin: 8px -4px -4px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    flex-wrap: nowrap;
  }
  body.dashboard-page #worker-form-actions button {
    flex: 1 1 0;
    min-height: 44px;
    height: 44px;
    font-size: 15px;
    padding: 0 6px;
    white-space: nowrap;
  }
  body.dashboard-page .roster-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  body.dashboard-page .roster-actions button {
    width: 100%;
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
    font-size: 14px;
  }
  body.dashboard-page #workers-table th.roster-action-col,
  body.dashboard-page #workers-table td.roster-action-col {
    min-width: 64px;
    padding-left: 8px;
    padding-right: 6px;
  }
}


/* ==================== r101-b：手机横屏（CSS 视口约 904x412） ====================
   为什么必须单列一段：r101 的 768px 断点在横屏手机上打不到 —— 412×904 的手机转横屏后
   CSS 宽度是 904 > 768，整段手机规则一条都不生效，于是又退回「侧栏 224 + 主区 680 +
   工种筛选 49px + 三个按钮竖排 43×90」。用户实测「横屏稍好但还需改进」就是这个原因。
   判定用「横向 + 视口矮」：横屏手机高 ~412，笔记本高 ≥768，max-height:560 精确分开。
   不用 pointer:coarse —— Chrome 模拟器未必上报该特性，实测会漏判。 */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  /* 侧栏 → 顶部紧凑横条（50px 高） */
  body.dashboard-page .dashboard-layout { display: block !important; }
  body.dashboard-page #dashboard-sidebar {
    position: static !important; width: 100% !important; height: auto !important;
    display: flex !important; align-items: center; gap: 8px;
    padding: 3px 8px !important; box-sizing: border-box; overflow: hidden;
  }
  body.dashboard-page #dashboard-sidebar .sidebar-head { display: flex; align-items: center; flex: 0 0 auto; margin: 0 !important; }
  body.dashboard-page #dashboard-sidebar .sidebar-head h2 { font-size: 14px; margin: 0; white-space: nowrap; }
  body.dashboard-page #dashboard-sidebar .sidebar-body { display: flex !important; flex: 1 1 auto; min-width: 0; overflow-x: auto; margin: 0 !important; }
  body.dashboard-page #dashboard-sidebar .nav-list { display: flex !important; flex-wrap: nowrap !important; gap: 6px; margin: 0 !important; }
  body.dashboard-page #dashboard-sidebar .nav-button {
    width: auto !important; flex: 0 0 auto; height: 30px; padding: 0 12px;
    font-size: 13px; line-height: 30px; white-space: nowrap;
  }
  body.dashboard-page #sidebar-edge { display: none !important; }

  /* 纵向预算只有 412px 高：说明文字与多余留白全收掉，高度让给表格 */
  body.dashboard-page .dashboard-main { padding: 2px 6px 4px !important; gap: 4px; }
  body.dashboard-page .dashboard-panel { padding: 4px !important; }
  body.dashboard-page #workers-panel > p.muted { display: none !important; }
  body.dashboard-page .panel-head { margin-bottom: 2px !important; padding-bottom: 0 !important; }
  body.dashboard-page .panel-head h2, body.dashboard-page .panel-head h3 { font-size: 15px; margin: 0 !important; }
  body.dashboard-page .tab-bar { margin: 2px 0 !important; padding-bottom: 2px !important; }
  body.dashboard-page .tab-button { min-height: 28px; padding: 2px 10px; font-size: 12px; }

  /* 筛选：四个控件一排等分，工种筛选不再被压成 49px */
  body.dashboard-page .roster-filter-bar { flex-wrap: nowrap !important; align-items: flex-end; gap: 6px; }
  body.dashboard-page .roster-filter-bar > .field { flex: 1 1 0; min-width: 0; }
  body.dashboard-page .field > label { font-size: 11px; margin-bottom: 1px; }
  body.dashboard-page #worker-search,
  body.dashboard-page #worker-team-filter,
  body.dashboard-page #worker-status-filter,
  body.dashboard-page #worker-job-filter { width: 100% !important; max-width: 100%; box-sizing: border-box; height: 30px; }

  /* 按钮：七个一排各 1/7 宽，文字不再竖排成 43×90 */
  body.dashboard-page .roster-filter-actions {
    display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px; flex: 0 0 auto; width: auto; flex-basis: auto; margin-left: 0;
  }
  body.dashboard-page .roster-filter-actions button {
    width: 100%; min-height: 30px; height: 30px; padding: 0 3px;
    font-size: 12px; white-space: nowrap; box-sizing: border-box;
  }
  body.dashboard-page .roster-actions { gap: 3px; }
  body.dashboard-page .roster-actions button { min-height: 32px; height: 32px; padding: 0 10px; font-size: 12px; }

  /* 表格吃满剩余高度，页面本身不出现纵向滚动。
     用 flex 链把面板高度锁到 100vh，表格 flex:1 自适应 —— 写死 calc(100vh - Npx)
     在 812x375 这类更矮的横屏上会差 12px 溢出（实测），flex 链不受机型影响。 */
  body.dashboard-page .dashboard-main { min-height: 0; }
  body.dashboard-page #workers-panel {
    display: flex !important; flex-direction: column !important;
    height: calc(100vh - 52px) !important; max-height: calc(100vh - 52px) !important;
    overflow: hidden !important; box-sizing: border-box;
  }
  body.dashboard-page #workers-panel > .panel-head,
  body.dashboard-page #workers-panel > p.muted,
  body.dashboard-page #workers-panel > .tab-bar { flex: 0 0 auto; }
  body.dashboard-page #workers-panel > .roster-pane {
    display: flex !important; flex-direction: column !important;
    flex: 1 1 auto !important; min-height: 0 !important; overflow: hidden !important;
  }
  body.dashboard-page #workers-panel .roster-filter-bar { flex: 0 0 auto; }
  body.dashboard-page #workers-panel .status-text { flex: 0 0 auto; }
  body.dashboard-page .roster-table-wrap {
    flex: 1 1 auto !important; min-height: 90px !important; max-height: none !important;
    overflow-y: auto !important; max-width: 100%;
  }

  /* 表头两行→单行：th-two-line 每字一行占 72px，横屏没这个奢侈，一行 36px 多显示一行数据 */
  body.dashboard-page #workers-thead-row th.th-two-line { height: auto !important; padding-top: 2px !important; padding-bottom: 2px !important; }
  body.dashboard-page #workers-thead-row th.th-two-line .th-line { display: inline !important; }
  body.dashboard-page #workers-thead-row th { height: 32px !important; padding-top: 2px !important; padding-bottom: 2px !important; }
  body.dashboard-page #workers-table tbody tr { height: 30px !important; }
}


/* 横屏更矮的机型（375/390 高一类）：纵向再挤 40px 出来，否则只能看到 2 行数据。
   面板大标题与「说明」都和 tab 栏重复，矮屏下不占地方；筛选标签缩到 10px 留一排。 */
@media (orientation: landscape) and (max-height: 400px) and (min-width: 560px) {
  body.dashboard-page #workers-panel > .panel-head { display: none !important; }
  body.dashboard-page .tab-bar { margin: 0 0 2px !important; }
  body.dashboard-page .field > label { font-size: 10px; margin-bottom: 0 !important; line-height: 12px; }
  body.dashboard-page #worker-search,
  body.dashboard-page #worker-team-filter,
  body.dashboard-page #worker-status-filter,
  body.dashboard-page #worker-job-filter { height: 28px !important; font-size: 12px; }
  body.dashboard-page .roster-filter-actions button { min-height: 28px; height: 28px; font-size: 11px; }
  body.dashboard-page #workers-status, body.dashboard-page #workers-status + * { font-size: 11px; }
  body.dashboard-page .roster-table-wrap { min-height: 70px !important; }
}

/* ============ r102-fix：实测发现的补丁自身缺陷修正（只追加，不动上面补丁原文） ============
   缺陷1：补丁写了 `#workers-panel > .roster-pane { display:flex !important }`（特异性 1,2,1），
          把第 312 行的 `.hidden{display:none!important}`（特异性 0,1,0）压过 —— 未激活的
          roster-pane-add / roster-pane-template 仍按 flex 占高（实测 2px / 5px），页高被顶出 464 > 412。
   缺陷2：#dashboard-sidebar 的 .sidebar-body 里有 #sidebar-user / #app-version 两条 <p>，
          在 flex 横排里各撑 83px 高，侧栏实测 101px（判据要求 40~56）。
   缺陷3：侧栏收进 48px 后，机身占高 = 侧栏 + main 上下内边距，需与 height:calc(100vh-52px) 对齐。 */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  /* 缺陷1：让 .hidden 在横屏继续赢 */
  body.dashboard-page #workers-panel > .roster-pane.hidden { display: none !important; }
  body.dashboard-page #workers-panel > .modal-backdrop.hidden { display: none !important; }

  /* 缺陷2：侧栏横条锁 46px（padding 3+3 → 内容 40） */
  body.dashboard-page #dashboard-sidebar { height: 46px !important; padding: 3px 8px !important; }
  body.dashboard-page #dashboard-sidebar .sidebar-head { height: 40px; }
  body.dashboard-page #dashboard-sidebar .sidebar-head h2 { line-height: 40px; font-size: 13px; }
  body.dashboard-page #dashboard-sidebar .sidebar-body { height: 40px !important; align-items: center; overflow: hidden; }
  body.dashboard-page #dashboard-sidebar #sidebar-user {
    flex: 0 0 auto; margin: 0 6px 0 0 !important; font-size: 11px !important; line-height: 40px; height: 40px;
    white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis;
  }
  /* 版本号横屏下让位给菜单（index 页 badge 仍有），避免挤掉 nav-button */
  body.dashboard-page #dashboard-sidebar #app-version { display: none !important; }
  body.dashboard-page #dashboard-sidebar .nav-list { height: 40px; align-items: center; overflow-x: auto; overflow-y: hidden; }
  body.dashboard-page #dashboard-sidebar .nav-button { height: 30px; line-height: 30px; flex: 0 0 auto; }

  /* 缺陷3：机身占高对齐 —— 侧栏 46 + main 上 2 下 4 = 52，正好等于 calc(100vh - 52px) */
  body.dashboard-page .dashboard-main { padding: 2px 6px 4px !important; }
}


/* ==================== r103：工资表/考勤表工具栏出屏（竖屏 + 横屏） ====================
   根因（实测）：.sheet-toolbar-buttons 是 `flex-shrink: 0` + `width:auto`（style.css 2536 行起 r97 段），
   容器宽被内容撑到 max-content —— 工资 7 按钮 726px、考勤 10 按钮 1018px。
   它的 computed flex-wrap 确实是 wrap，但**容器自己就比父级宽，没有可换行的余量**，
   所以一个按钮都没换行，实测 buttonsH=36（单行）。
   → 修法只有一条路：给容器一个受父级约束的宽度（flex:1 1 100% + min-width:0 + flex-shrink:1），
     wrap 才会真的换行。**不要只加 flex-wrap:wrap（已经是 wrap 了，没用）**。
   实测出屏：工资 right=735（超 412 共 323）、考勤 right=1027（超 615，且 body overflow-x:hidden
   直接把它切掉 → 第 4 个按钮起根本点不到，属功能丢失，不只是难看）。
   横屏：横向 0，但 buttons 仍 726/1018，纵向面板 559/476 > 视口 412 → 纵溢 199/116。 */
@media (max-width: 768px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {

  body.dashboard-page .sheet-toolbar { flex-wrap: wrap !important; align-items: flex-end; }

  /* 筛选块占满一行 */
  body.dashboard-page .sheet-toolbar-filters {
    flex: 1 1 100% !important; min-width: 0 !important; flex-wrap: wrap !important;
  }
  body.dashboard-page .sheet-toolbar-filters > .inline-field,
  body.dashboard-page .sheet-toolbar-filters > .checkbox-field { flex: 0 1 auto; max-width: 100%; }

  /* 按钮组：解除 flex-shrink:0，改为可收缩 + 独占一行 + 内部换行 */
  body.dashboard-page .sheet-toolbar-buttons {
    flex: 1 1 100% !important;
    flex-shrink: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }
  /* 长按钮文字（「导出（含上月实发+凭证清单）」203px）不再把行撑爆 */
  body.dashboard-page .sheet-toolbar-buttons > button {
    flex: 0 1 auto; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 12px; padding: 0 8px; min-height: 34px;
  }
  /* 面板/子页/表格容器允许被压窄，否则 flex 链会溢出 */
  body.dashboard-page .sub-tab-pane,
  body.dashboard-page .sheet-table-wrap { min-width: 0 !important; max-width: 100% !important; }
}

/* 横屏专用：纵向预算只有 ~412px，面板锁高 + 表格内部滚动（同 r102 的 flex 链思路） */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  body.dashboard-page #salary-panel,
  body.dashboard-page #attendance-sheet-panel {
    display: flex !important; flex-direction: column !important;
    height: calc(100vh - 52px) !important; max-height: calc(100vh - 52px) !important;
    overflow: hidden !important; box-sizing: border-box;
  }
  body.dashboard-page #salary-panel > .panel-head,
  body.dashboard-page #salary-panel > p.muted,
  body.dashboard-page #salary-panel > .sub-tab-bar,
  body.dashboard-page #attendance-sheet-panel > .panel-head,
  body.dashboard-page #attendance-sheet-panel > p.muted { flex: 0 0 auto; }

  body.dashboard-page #salary-panel > .sub-tab-pane.active,
  body.dashboard-page #attendance-sheet-panel > .sub-tab-pane.active {
    display: flex !important; flex-direction: column !important;
    flex: 1 1 auto !important; min-height: 0 !important; overflow: hidden !important;
  }
  body.dashboard-page .sheet-toolbar,
  body.dashboard-page .status-text,
  body.dashboard-page .sub-tab-pane.active > .muted { flex: 0 0 auto; }
  body.dashboard-page .sheet-table-wrap,
  body.dashboard-page .sub-tab-pane.active > .table-wrap {
    flex: 1 1 auto !important; min-height: 90px !important; max-height: none !important;
    overflow: auto !important;
  }

  /* 横屏纵溢的最后一截来自四处重复说明文字（面板 muted 33 + 子页 muted 33 + 尾部 muted 33
     + 面板标题 20），横屏下全部收起，位置让给表格（实测表格从 90 → 156，多 2 行） */
  body.dashboard-page #salary-panel > .panel-head,
  body.dashboard-page #salary-panel > p.muted,
  body.dashboard-page #attendance-sheet-panel > .panel-head,
  body.dashboard-page #attendance-sheet-panel > p.muted,
  body.dashboard-page .sub-tab-pane.active > p.muted { display: none !important; }
  body.dashboard-page .sheet-table-wrap,
  body.dashboard-page .sub-tab-pane.active > .table-wrap { min-height: 140px !important; }
}


/* ============ r103-fix：hidden 面板被上面的 display:flex!important 顶开（实测发现，只追加） ============
   上段横屏块（2883-2888 行）给 #salary-panel / #attendance-sheet-panel 写了 display:flex!important，
   特异性 (1,1,1)，把第 312 行 `.hidden{display:none!important}`（0,1,0）压过 ——
   实测 904x412：hidden 的 #workers-panel 与 #attendance-sheet-panel 各被渲染成 360px 高，
   和 #salary-panel 三个叠起来 → 整页 scrollHeight 1133（视口 412，纵溢 721）。
   r102 段第 2767 行的 #workers-panel 是同一写法，横屏切到工资页时花名册面板同样不消失。
   修法与 r102-fix 同思路：给 .hidden 状态补一条更高特异性 (1,2,1) 的 display:none。 */
body.dashboard-page #workers-panel.hidden,
body.dashboard-page #attendance-sheet-panel.hidden,
body.dashboard-page #salary-panel.hidden { display: none !important; }

/* ==================== r104：手机端两处死锁/隐藏（实测根因，只追加） ====================
   ── 缺陷1（竖屏）宏哥实机原话：顶部侧栏内容显示不出来；下拉刷新时能看见但点不动，刷新完又缩回去。
      根因：侧栏折叠是电脑端功能，状态存在 localStorage（project_a_sidebar_collapsed）。
            dashboard.js 的 initSidebarCollapse() 一进页面就按它给 body 加 .sidebar-collapsed；
            body.sidebar-collapsed 系列规则把 .sidebar-head / .sidebar-body / h2 / logout-button
            全设成 display:none（style.css 1103/1690/2063）；
            而手机断点里 r101/r102 又把唯一能恢复的 #sidebar-edge 收起条 display:none 掉了（2705 / 2731）。
            于是手机一旦处于折叠态 = 顶栏只剩一条空深色带、菜单全不可见，且没有任何入口能恢复，彻底死锁。
            「刷新过程中能看见」是因为 CSS 已到、JS 未执行的那几百毫秒 body 上还没有 .sidebar-collapsed。
      修法：手机断点内让折叠态失效，把被折叠规则藏掉的元素全部还原（不改 JS、不碰电脑端断点）。
   ── 缺陷2（横屏矮屏）宏哥实机原话：顶部横条正常，但「当前项目」看不见。
      根因：@media (orientation:landscape) and (max-height:400px) 把 #workers-panel > .panel-head
            整行 display:none（2797），而「当前项目」选择器是 r49 动态挂进当前面板 .panel-head 的
            （全页只此一份），被一起藏了。实测 780x360、893x375 两档 picker 尺寸 0x0。
      修法：只藏标题 h2，选择器保留，压到 22px 高。 */

@media (max-width: 768px) {
  /* 缺陷1：折叠态在手机上整体失效 */
  body.dashboard-page.sidebar-collapsed .dashboard-layout { grid-template-columns: minmax(0, 1fr) !important; }
  body.dashboard-page.sidebar-collapsed #dashboard-sidebar { padding: 8px 10px !important; }
  body.dashboard-page.sidebar-collapsed #dashboard-sidebar .sidebar-head {
    display: flex !important; justify-content: space-between !important;
  }
  body.dashboard-page.sidebar-collapsed #dashboard-sidebar .sidebar-head h2 { display: block !important; }
  body.dashboard-page.sidebar-collapsed #dashboard-sidebar .sidebar-body { display: block !important; }
  body.dashboard-page.sidebar-collapsed #dashboard-sidebar .logout-button { display: flex !important; }
}

/* 缺陷2：横屏矮屏保留「当前项目」，只藏标题 */
@media (orientation: landscape) and (max-height: 400px) and (min-width: 560px) {
  body.dashboard-page #workers-panel > .panel-head {
    display: flex !important; align-items: center; gap: 8px;
    margin: 0 0 2px !important; min-height: 0 !important; flex-wrap: nowrap;
  }
  body.dashboard-page #workers-panel > .panel-head > h2 { display: none !important; }
  body.dashboard-page #workers-panel > .panel-head .compact-field { height: 22px !important; min-width: 0 !important; gap: 4px; }
  body.dashboard-page #workers-panel > .panel-head .compact-field label { font-size: 10px !important; margin: 0 !important; line-height: 22px; }
  body.dashboard-page #workers-panel > .panel-head .compact-field select {
    min-height: 22px !important; height: 22px !important; font-size: 11px !important; padding: 0 6px !important; max-width: 180px;
  }
}
/* ===== r104b（2026-11-12）横屏矮档顶部横条：导航列表被「退出登录」挤到只剩 264px，第 6 个导航（我的账号）与「工资管理」文字被切。
   修法：把「退出登录」从 flex:1（占 343~491px）收回内容宽，导航列表 flex:1 吃剩余宽度。
   作用域仅 orientation:landscape + max-height:560px，竖屏与电脑端一条不命中。 ===== */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px){
  body.dashboard-page #dashboard-sidebar .logout-button{flex:0 0 auto !important;width:auto !important;min-width:0 !important;padding:0 10px !important;font-size:12px !important;}
  body.dashboard-page #dashboard-sidebar .nav-list{flex:1 1 auto !important;min-width:0 !important;}
}

/* ===== r104c（2026-11-12）横屏矮档：r103 的 2911-2915 把 `#salary-panel > .panel-head` 与
   `#attendance-sheet-panel > .panel-head` 整行 display:none，而「当前项目」picker 是 r49 动态
   挂进【当前激活面板】.panel-head 的唯一实例 —— 一切到工资表/考勤表，picker 就 0×0 消失。
   r104 只修了花名册面板（#workers-panel），这里补齐另外两块。
   修法与 r104 一致：保留 panel-head 容器、只藏里面的 h2，其余说明文字照旧收起以保表格高度。
   作用域仅 orientation:landscape + max-height:560px，竖屏与电脑端一条不命中。 ===== */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px){
  body.dashboard-page #salary-panel > .panel-head,
  body.dashboard-page #attendance-sheet-panel > .panel-head{
    display: flex !important; flex: 0 0 auto !important;
    align-items: center !important; justify-content: space-between !important;
    height: 24px !important; min-height: 24px !important;
    padding: 0 !important; margin: 0 0 2px !important; overflow: visible !important;
  }
  body.dashboard-page #salary-panel > .panel-head > h2,
  body.dashboard-page #attendance-sheet-panel > .panel-head > h2{ display: none !important; }
  body.dashboard-page #salary-panel > .panel-head .compact-field,
  body.dashboard-page #attendance-sheet-panel > .panel-head .compact-field{
    height: 22px !important; min-width: 0 !important; gap: 4px; margin: 0 !important;
  }
  body.dashboard-page #salary-panel > .panel-head .compact-field label,
  body.dashboard-page #attendance-sheet-panel > .panel-head .compact-field label{
    font-size: 10px !important; margin: 0 !important; line-height: 22px;
  }
  body.dashboard-page #salary-panel > .panel-head .compact-field select,
  body.dashboard-page #attendance-sheet-panel > .panel-head .compact-field select{
    height: 22px !important; font-size: 11px !important; padding: 0 4px !important; max-width: 180px;
  }
}
/* ===== r104d 手机横屏顶部横条：8 个导航被切（2026-11-12） =====
   现象：横屏 CSS 宽约 904 时顶部横条 8 个导航能放下，但 893/812/780/736 宽时
         .nav-list 内容宽 653px > 可用宽 568/536/492，「我的账号」被切到屏幕外，
         overflow-x:auto 虽在但看不见滚动条，用户以为导航丢了。
   根因：横条三段刚性占用 —— .sidebar-head「工地实名制管理系统」144px
         + .logout-button 70px + 导航本身 653px（13px 字号 + 左右各 10px 内距）。
         893 宽时 144+70+653=867 已超 867>893-16(padding)=877 边缘，812 起明显不够。
   修法：只动横屏矮档（orientation:landscape and max-height:560px），
         ① 导航字号 13→12px、左右内距 10→4px（8 项合计省约 130px）；
         ② 侧栏标题按内容收缩并限宽 76px 省略，省约 56px；
         总省约 186px，736 宽以上 8 个导航全部一屏放下；更窄档（<667）保留横滑。
   影响面：竖屏与电脑端（>560 高）零命中，r104/r104b/r104c 规则不动。 */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {

  body.dashboard-page #dashboard-sidebar .sidebar-head {
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    padding: 0 6px !important;
    border-bottom: 0 !important;
  }

  body.dashboard-page #dashboard-sidebar .sidebar-head h2 {
    font-size: 12px !important;
    max-width: 76px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.dashboard-page #dashboard-sidebar .nav-button {
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 12px !important;
  }
}
/* ===== r104e 手机横屏矮档：窄屏再放出 136px，让 8 导航下探到 720 宽（2026-11-12） =====
   现象：r104d 落生产后 head 144→88、导航 653→494，但实测全显门槛只到 812 宽；
        780/768/736/720 四档导航仍差 9~76px，「我的账号」被切（可横滑但不是全显）。
   根因：顶栏第 4 段 #sidebar-user（登录者标签「系统管理员（超级管理员）」，
         display:block / font-size:11px / max-width:130px / margin-right:6px）
         合计刚性占用 136px；该标签与「我的账号」页内容重复，横屏矮档无保留必要。
   修法：只在「横屏 + 高≤560 + 宽≤860」时收掉 #sidebar-user，省 136px。
         860 以上保留标签（893/904/960 本来已全显，不动观感）。
         720 宽起 8 个导航一屏放下；667 及以下物理放不下，保留 .nav-list 横滑。
   影响面：竖屏 / 电脑端 / 861 以上横屏零命中；r101~r104d 各段规则一行不动。 */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 860px) and (min-width: 560px) {

  body.dashboard-page #dashboard-sidebar #sidebar-user {
    display: none !important;
  }
}

/* ===================================================================
   r106：花名册「月份 / 在场 / 新进场 / 退场」四个筛选的版式
   —— 纯追加，r101~r104e 各段一字未改；
      选择器一律带 body.dashboard-page .roster-filter-bar 前缀（并只在
      .field--period 上做文章），绝不裸写 .field，不影响考勤页/工资页。
   =================================================================== */
/* 桌面端（≥769px）：筛选栏允许换行，新 4 项占 132~200px 弹性区间，排不下自动换行。
   既有 4 个控件不加任何 flex 声明 —— 横屏矮档 2744 行的 flex:1 1 0 照旧生效。 */
@media (min-width: 769px) {
  body.dashboard-page .roster-filter-bar { flex-wrap: wrap; }
  body.dashboard-page .roster-filter-bar > .field--period { flex: 0 1 150px; min-width: 132px; max-width: 200px; }
}
/* 手机端（≤768px，含 390×844 / 360×740）：既有「两列」规则对同为 .field 的
   新控件同样生效，这里只补「高度 ≥44px、宽度撑满、文字不截断」。 */
@media (max-width: 768px) {
  body.dashboard-page .roster-filter-bar > .field--period { flex: 1 1 calc(50% - 4px); min-width: 0; max-width: none; }
  body.dashboard-page .roster-filter-bar > .field--period > select { width: 100%; max-width: 100%; min-height: 44px; }
}
/* 横屏矮档（landscape + max-height:560px）：沿用既有 nowrap 布局（不动 2742 行），
   新 4 项与既有控件同样 flex:1 1 0 等分；min-width:0 保证不横向滚动、按钮不压扁。
   代价（如实记录）：同排从 4 项变 8 项，既有 4 控件宽度由 101px 等分到约 47px。 */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  body.dashboard-page .roster-filter-bar > .field--period { flex: 1 1 0; min-width: 0; max-width: none; }
  body.dashboard-page .roster-filter-bar > .field--period > select { width: 100%; max-width: 100%; min-height: 30px; }
}
/* 月份=全部月份时的禁用态：置灰但不隐身，一眼看出要先选月份 */
body.dashboard-page .roster-filter-bar > .field--period > select:disabled { opacity: .55; cursor: not-allowed; }
/* ==================== r110：授权管理 手机端行高压下来 + 账号/姓名搜索框 ==================== */
/* 背景（总管实测）：手机竖屏「操作」列被挤到 39px 宽，保存/重置密码/删除 三个按钮竖排，
   整行被撑到 239px、一屏只露 2.5 行，wb（王总）/wh（汪宏）要横向滚才看得到。
   本段全部追加在 style.css 末尾，只命中 ≤768px 竖屏 与 手机横屏矮档；
   桌面端（1920×1080）一条都不命中，既有 108335 字节一行未改。 */

/* ---- ① 手机竖屏（≤768px）：操作按钮两行、44px 高、文字不截断；项目授权列收窄让位 ---- */
@media (max-width: 768px) {
  /* 改固定表格布局：自动布局下 <select multiple> 的项目名会把「项目授权」列顶到 292px，
     账号/姓名/操作 只剩碎渣。改成按百分比分列后 6 列合计 100%，表格宽度=容器宽，
     手机端横向滚动由「585 > 372」变成 0（只是变少，不会变多）。 */
  body.dashboard-page #users-panel .data-table { table-layout: fixed; width: 100%; }
  body.dashboard-page #users-panel .data-table th,
  body.dashboard-page #users-panel .data-table td { padding: 4px 4px; }
  /* 列宽：账号 14% / 姓名 14% / 角色 12% / 状态 12% / 项目授权 12%（原 292px → 约 45px）/ 操作 36% */
  body.dashboard-page #users-panel .data-table th:nth-child(1),
  body.dashboard-page #users-panel .data-table td:nth-child(1) { width: 14%; }
  body.dashboard-page #users-panel .data-table th:nth-child(2),
  body.dashboard-page #users-panel .data-table td:nth-child(2) { width: 14%; }
  body.dashboard-page #users-panel .data-table th:nth-child(3),
  body.dashboard-page #users-panel .data-table td:nth-child(3) { width: 12%; }
  body.dashboard-page #users-panel .data-table th:nth-child(4),
  body.dashboard-page #users-panel .data-table td:nth-child(4) { width: 12%; }
  body.dashboard-page #users-panel .data-table th:nth-child(5),
  body.dashboard-page #users-panel .data-table td:nth-child(5) { width: 12%; }
  body.dashboard-page #users-panel .data-table th:nth-child(6),
  body.dashboard-page #users-panel .data-table td:nth-child(6) { width: 36%; }
  /* 控件收内边距：默认 10px/12px 的内边距在 45~52px 窄列里要吃掉 24px，字只剩一两个 */
  body.dashboard-page #users-panel .data-table input,
  body.dashboard-page #users-panel .data-table select { padding: 2px 4px; font-size: 13px; }
  body.dashboard-page #users-panel .data-table select[data-project-user-id] {
    width: 100%; min-width: 0; padding: 1px 2px; font-size: 12px;
  }
  /* 操作列：flex 换行成两行（保存 + 重置密码 一行，删除 独占一行）；44px 触控高度；nowrap 不截字 */
  body.dashboard-page #users-panel .data-table .inline-actions {
    gap: 4px; margin-top: 0; flex-wrap: wrap;
  }
  body.dashboard-page #users-panel .data-table .inline-actions > button {
    flex: 1 1 calc(50% - 2px); min-width: 0; min-height: 44px;
    padding: 4px 2px; font-size: 14px; white-space: nowrap;
  }
}

/* ---- ② 手机横屏矮档（landscape + max-height:560px，沿用本文件既有手机横屏断点） ---- */
/* 竖屏那套两行按钮在 844×390 会把行撑到 113px、一屏只露 2.1 行；横屏宽度富裕，
   三个按钮排一排各占 1/3（每个约 99px，「重置密码」装得下），行高 56px、一屏 4.3 行。 */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  body.dashboard-page #users-panel .data-table { table-layout: fixed; width: 100%; }
  body.dashboard-page #users-panel .data-table th,
  body.dashboard-page #users-panel .data-table td { padding: 4px 5px; }
  body.dashboard-page #users-panel .data-table th:nth-child(1),
  body.dashboard-page #users-panel .data-table td:nth-child(1) { width: 12%; }
  body.dashboard-page #users-panel .data-table th:nth-child(2),
  body.dashboard-page #users-panel .data-table td:nth-child(2) { width: 12%; }
  body.dashboard-page #users-panel .data-table th:nth-child(3),
  body.dashboard-page #users-panel .data-table td:nth-child(3) { width: 11%; }
  body.dashboard-page #users-panel .data-table th:nth-child(4),
  body.dashboard-page #users-panel .data-table td:nth-child(4) { width: 9%; }
  body.dashboard-page #users-panel .data-table th:nth-child(5),
  body.dashboard-page #users-panel .data-table td:nth-child(5) { width: 16%; }
  body.dashboard-page #users-panel .data-table th:nth-child(6),
  body.dashboard-page #users-panel .data-table td:nth-child(6) { width: 40%; }
  body.dashboard-page #users-panel .data-table input,
  body.dashboard-page #users-panel .data-table select { padding: 2px 6px; font-size: 13px; }
  body.dashboard-page #users-panel .data-table select[data-project-user-id] { width: 100%; min-width: 0; }
  body.dashboard-page #users-panel .data-table .inline-actions { gap: 4px; margin-top: 0; flex-wrap: nowrap; }
  body.dashboard-page #users-panel .data-table .inline-actions > button {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 4px; font-size: 14px; white-space: nowrap;
  }
}

/* ==================== r115（2026-11-15）手机「查询」筛选栏：挤成一团 / 字看着反序 的根因修复 ====================
   实测根因（8104 副本 + 375×667 / 390×844 / 375×300 三档实测，不是猜）：
   ① 一点输入框，软键盘顶起会把布局视口压矮（375×667 → 375×300）。此时 宽375 > 高300，
      `(orientation: landscape) and (max-height: 560px)` 整套横屏矮档规则误命中：8 个筛选控件
      nowrap 等分 → 每个 .field 实测宽度 0px、8 个框互相重叠；#worker-search 只剩 18×30px、
      标签逐字竖排把 .field 撑到 134px 高 —— 界面既「挤成一团没法输入」，重叠渲染的文字也
      看着像字序反了（实测 direction:ltr / unicode-bidi:normal，并不是真的被设成了 RTL）。
   ② 真横屏手机（812×375）下 8 项等分只有 43px 宽，输姓名只能看见 1~2 个字。
   修法：横屏矮档全部媒体查询加 `min-width: 560px` 门（真横屏手机宽 ≥736px，不受影响；条件行已改）；
        本节再补两档：竖屏 ≤768px 控件与按钮抬到 44px（触控目标）；横屏矮档把搜索框加宽到 2 份、其余 7 项等分。
   影响面：只命中 body.dashboard-page 的花名册筛选栏与按钮行；电脑端竖屏（≥769px）不命中。 */
@media (max-width: 768px) {
  body.dashboard-page .roster-filter-bar > .field > input,
  body.dashboard-page .roster-filter-bar > .field > select { min-height: 44px !important; box-sizing: border-box; }
  body.dashboard-page .roster-filter-actions { gap: 6px !important; }
  body.dashboard-page .roster-filter-actions button { min-height: 44px !important; height: auto !important; }
}

@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  /* 真横屏手机（≥560px 宽）维持 r101~r114 已验收版式（8 项同排、30px 高），本次不动；
     本节仅把搜索框从 1 份加到 2 份宽（812 宽时 43px → 约 86px），让输姓名能看见全名。 */
  body.dashboard-page .roster-filter-bar > .field:first-child { flex: 2 1 0 !important; min-width: 0 !important; }
}

/* ==================== r116（2026-11-15）照片「清除」键 + 错图提示 —— 纯追加，768px 以上版式逐项不变 ====================
   用途：四个上传控件（本人照片 / 身份证人像面 / 国徽面 / 银行卡）预览右上角挂一个 ≥44px 的「×」，
        点它清空该控件重传；错图判定结果用红字贴在预览下方，提示「错在哪、怎么改」。
   位置：只在本文件末尾追加，不改动上面任何既有规则；新规则选择器都带 .photo-* 前缀，不影响别处。 */
.photo-preview {
  position: relative;
}

.photo-preview .photo-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
  -webkit-tap-highlight-color: transparent;
}

.photo-preview .photo-clear-btn:hover {
  background: rgba(220, 38, 38, 0.92);
}

.photo-preview .photo-clear-btn:active {
  transform: scale(0.96);
}

.photo-preview .photo-clear-btn:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.photo-preview .photo-clear-btn.hidden {
  display: none !important;
}

.photo-guard-hint {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
}

.photo-guard-hint.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  /* 手机端触控目标抬到 46px，贴在缩略图右上角，不挡拍照按钮、不引起横向滚动 */
  .photo-preview .photo-clear-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    top: 4px;
    right: 4px;
  }
  .photo-guard-hint {
    font-size: 13px;
  }
}

/* r123：保存按钮被前端规则禁用时必须「看得出来」是灰的，否则宏哥以为还能点 */
#worker-save-button:disabled,
#worker-save-button:disabled:hover,
#worker-save-button:disabled:active {
  background: #c9cdd4 !important;
  color: #ffffff !important;
  opacity: .85;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

/* ===== 班组资金 r124（只新增，不改上面任何规则） ===== */
/* 空状态：灰字居中，表格还在时不挤占视线 */
.team-fund-empty {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
/* 结余负数（班组长垫资）：红字，下面跟一行更小的说明 */
.team-fund-negative {
  color: #c0392b;
  font-weight: 600;
}
.team-fund-positive {
  color: #0f172a;
}
.team-fund-note {
  display: block;
  margin-top: 1px;
  color: #c0392b;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
/* 产值 0 的行标「未填报」，让宏哥一眼看出哪几行空着 */
.team-fund-unfilled {
  display: block;
  margin-top: 1px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.2;
}
/* 合计行：加粗 + 底色，跟数据行分开 */
.team-fund-total-row td {
  background: #eef2f7;
  font-weight: 700;
  border-top: 2px solid #cbd5e1;
}
/* 数字列右对齐，金额扫起来快 */
#team-fund-table .team-fund-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* 表格里的产值/备注输入框：窄、贴格子、数字右对齐 */
#team-fund-table .team-fund-output,
#team-fund-table .team-fund-remark {
  width: 108px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
#team-fund-table .team-fund-remark {
  width: 190px;
  text-align: left;
}
#team-fund-table .team-fund-output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#team-fund-table .team-fund-output:disabled,
#team-fund-table .team-fund-remark:disabled {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}
/* 该行改过没保存：输入框描橙边（只是提示，不自动发请求） */
#team-fund-table tr.team-fund-dirty .team-fund-output,
#team-fund-table tr.team-fund-dirty .team-fund-remark {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
/* 行内小按钮：保存 / 清除（触控目标 ≥44px 在手机端单独抬） */
#team-fund-table .team-fund-btn {
  min-height: 26px;
  padding: 3px 10px;
  margin: 0 2px;
  font-size: 12px;
}
#team-fund-table .team-fund-btn-clear {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}
#team-fund-table td.team-fund-cell-actions {
  white-space: nowrap;
}
/* 手机端（<=768px）：页面整体不横滚，表格只在容器内横滚；保存按钮抬到 44px 可点 */
@media (max-width: 768px) {
  #team-fund-panel .sheet-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  #team-fund-table .team-fund-btn {
    min-height: 44px;
    min-width: 56px;
    padding: 8px 12px;
    font-size: 13px;
  }
  #team-fund-table .team-fund-output,
  #team-fund-table .team-fund-remark {
    min-height: 40px;
  }
}

/* ===== r125fix2：卡证拍照引导层 ===== */
/* 全屏半透明遮罩 + 中间镂空一个 1.585:1 的框（身份证 85.6×54mm=1.585，银行卡同为 ISO/IEC 7810 ID-1） */
.photo-guide-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  background: rgba(9, 14, 28, 0.86);
  overflow-y: auto;
}

.photo-guide-layer.hidden {
  display: none !important;
}

.photo-guide-panel {
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 16px;
  background: transparent;
  text-align: center;
}

.photo-guide-title {
  margin: 0 0 12px;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}

.photo-guide-frame-wrap {
  padding: 0;
  margin: 0 auto 12px;
  display: flex;
  justify-content: center;
}

/* 镂空框：aspect-ratio 1.585 保证任何屏宽都是标准卡比例；outline 用浅色描出「镂空」边界 */
.photo-guide-frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1.585 / 1;
  box-sizing: border-box;
  border: 2px dashed #38bdf8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 9999px rgba(9, 14, 28, 0.0), inset 0 0 24px rgba(56, 189, 248, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* 框内四角「角标」，让宏哥看得见四角要对齐在哪 */
.photo-guide-frame::before,
.photo-guide-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #38bdf8;
  border-radius: 4px;
}

.photo-guide-frame::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.photo-guide-frame::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

.photo-guide-frame-text {
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.photo-guide-tip {
  margin: 0 0 16px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
  padding: 0 4px;
}

.photo-guide-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.photo-guide-actions .primary-button,
.photo-guide-actions .secondary-button {
  min-height: 44px;
  min-width: 120px;
  padding: 10px 20px;
  font-size: 15px;
}

/* 手机竖屏：框按屏宽自动缩放；提示文案不挤；按钮 ≥44px 且不换行溢出 */
@media (max-width: 768px) {
  .photo-guide-layer {
    padding: 10px;
    align-items: flex-start;
  }
  .photo-guide-panel {
    max-width: 100%;
    padding: 12px 8px;
  }
  .photo-guide-title {
    font-size: 15px;
    margin-bottom: 10px;
  }
  .photo-guide-frame {
    max-width: 100%;
  }
  .photo-guide-frame-text {
    font-size: 13px;
  }
  .photo-guide-tip {
    font-size: 12.5px;
    margin-bottom: 12px;
  }
  .photo-guide-actions {
    flex-direction: column;
    gap: 8px;
  }
  .photo-guide-actions .primary-button,
  .photo-guide-actions .secondary-button {
    width: 100%;
    min-height: 46px;
  }
}

/* r125fix2：裁切质量提示用黄色（不是红色报错）—— 卡没识别出边缘只是「想更清楚可以重拍」，不阻断保存 */
.photo-guard-hint.warn {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

/* r128：考勤表备注栏改成可编辑。只作用于这格（#attendance-sheet-table .att-col-remark 下的 editable-cell），
   其他页面的 .remark-view 一字不动；底色/字号沿用既有 .remark-view 规则。 */
#attendance-sheet-table .att-col-remark .editable-cell.remark-view {
  cursor: text;
  outline: none;
}
#attendance-sheet-table .att-col-remark .editable-cell.remark-view:focus {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
}

/* ===== r129：花名册/考勤表「序号 + 姓名」左侧冻结 + 点击整行跟随浅蓝 =====
   列宽一律沿用既有值，改冻结不动一列宽：
     花名册 ROSTER_COLUMNS 序号 40px / 姓名 64px（表头由 dashboard.js 写成 inline width）
     考勤表 dashboard.html colgroup .col-seq 44px / .col-name 88px
   左粘两列铺实色（白 / 斑马 / 黄底 / 浅蓝 四种情况都不许透出下面的日期格）。 */

/* --- 花名册：序号 left:0，姓名 left:40 --- */
#workers-table td.roster-seq-col,
#workers-table td.roster-name-col {
  position: -webkit-sticky;
  position: sticky;
  z-index: 3;
  background: #fff;
}
#workers-table td.roster-seq-col { left: 0; }
#workers-table td.roster-name-col { left: 40px; border-right: 1px solid #e2e8f0; }

/* 表头那两格：top(原 #workers-table thead th 已有 top:0) + left 双粘，
   z-index 5 —— 高于普通表头(4)，低于右侧「操作」表头(6) */
#workers-table thead th.roster-seq-col,
#workers-table thead th.roster-name-col {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f9fc;
}
#workers-table thead th.roster-seq-col { left: 0; }
#workers-table thead th.roster-name-col { left: 40px; }

/* 斑马纹 / 黄底行 / 选中行，左冻结列各自铺实色 */
#workers-table tbody tr:nth-child(even) td.roster-seq-col,
#workers-table tbody tr:nth-child(even) td.roster-name-col { background: #fafbfd; }
#workers-table tbody tr.roster-row-no-education > td.roster-seq-col,
#workers-table tbody tr.roster-row-no-education > td.roster-name-col { background: #FFF9C4 !important; }

/* --- 考勤表：序号 left:0，姓名 left:44；rowspan=3 只有一个格子，三行天然对齐 --- */
#attendance-sheet-table td.att-col-seq,
#attendance-sheet-table td.att-col-name {
  position: -webkit-sticky;
  position: sticky;
  z-index: 3;
  background: #fff;
  vertical-align: middle;
}
#attendance-sheet-table td.att-col-seq { left: 0; }
#attendance-sheet-table td.att-col-name { left: 44px; border-right: 1px solid #e2e8f0; }

#attendance-sheet-table thead th.seq-head,
#attendance-sheet-table thead th.name-head {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f1f5f9;
}
#attendance-sheet-table thead th.seq-head { left: 0; }
#attendance-sheet-table thead th.name-head { left: 44px; }

#attendance-sheet-table tbody tr:nth-child(even) > td.att-col-seq,
#attendance-sheet-table tbody tr:nth-child(even) > td.att-col-name { background: #fafbfd; }
#attendance-sheet-table tr.attendance-unmatched-row > td.att-col-seq,
#attendance-sheet-table tr.attendance-unmatched-row > td.att-col-name { background: #fdecea; }

/* --- 点击跟随：浅蓝 #EEF6FF，只染 td，不碰内层 .mark-cell 的填充 --- */
/* 优先级：既有染色（差异绿 #DCFCE7 / 红 #FEE2E2 在 .mark-cell 上带 !important；
   合计格琥珀 #fef3c7；未匹配行 #fdecea）都必须压过浅蓝 —— 合计/小计/操作三列直接排除在浅蓝之外，
   未匹配行整行排除，内层 mark-cell 的差异色本来就盖在 td 之上。 */
#attendance-sheet-table tbody tr.att-follow-row:not(.attendance-unmatched-row) > td:not(.att-col-total):not(.att-col-subtotal):not(.att-col-ops):not(.formula-cell) {
  background: #EEF6FF;
}
/* 花名册：整行（含左冻结两列与右侧操作列）；黄底行 !important 仍然赢 */
#workers-table tbody tr.roster-row-active > td:not(.roster-action-col) {
  background: #EEF6FF;
}
#workers-table tbody tr.roster-row-active > td.roster-action-col {
  background: #EEF6FF;
}
/* 还没保存的内联编辑格（#E8F0FE !important）仍然比浅蓝醒目，编辑不受影响 */

/* r129 打印：左侧粘的两列回到正常表格流（与 r86 右侧三列的复位同一套路）。
   sticky 在打印里只会被个别浏览器叠列/撑宽，复位后 A4 横向仍 1 页宽、每页人数不变。
   列宽不写死、不改现有 colgroup / inline width，版式零变化。 */
@media print {
  #workers-table th.roster-seq-col,
  #workers-table td.roster-seq-col,
  #workers-table th.roster-name-col,
  #workers-table td.roster-name-col,
  #attendance-sheet-table th.seq-head,
  #attendance-sheet-table td.att-col-seq,
  #attendance-sheet-table th.name-head,
  #attendance-sheet-table td.att-col-name {
    position: static;
    left: auto;
    top: auto;
    z-index: auto;
    border-right: none;
  }
}

/* r129：序号锁定格（序号即工号）原来用 inline background:#f1f5f9 铺底，
   inline 会压过浅蓝跟随与斑马纹 —— 挪到类规则里，视觉不变、优先级回到 CSS 层。
   黄底行仍用 !important 压住它。 */
#workers-table td.seq-locked { background: #f1f5f9; }

/* ===== r129-B：工资统计 / 工资 1版 / 2版 「序号 + 姓名」左侧冻结 =====
   与花名册/考勤表同一套写法：只做 position: sticky + left 偏移，
   列宽一格不动（1版/2版表头仍用原来的 min-width，工资统计表仍是自动布局），
   偏移量 --lf-offset 由 JS 按真实首列宽度量出来写到 table 元素上。 */
#salary-v1-table th.salary-lf-seq, #salary-v1-table td.salary-lf-seq,
#salary-v2-table th.salary-lf-seq, #salary-v2-table td.salary-lf-seq,
#salary-summary-table th.salary-lf-seq, #salary-summary-table td.salary-lf-seq {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}
#salary-v1-table th.salary-lf-name, #salary-v1-table td.salary-lf-name,
#salary-v2-table th.salary-lf-name, #salary-v2-table td.salary-lf-name,
#salary-summary-table th.salary-lf-name, #salary-summary-table td.salary-lf-name {
  position: -webkit-sticky;
  position: sticky;
  left: var(--lf-offset, 40px);
  z-index: 3;
  background: #fff;
  border-right: 1px solid #e2e8f0;
}
/* 表头：工资 1版/2版 的表头本来就 top 粘（.sheet-table th），这里只补 left 与更高的层级 */
#salary-v1-table th.salary-lf-seq, #salary-v1-table th.salary-lf-name,
#salary-v2-table th.salary-lf-seq, #salary-v2-table th.salary-lf-name {
  top: 0;
  z-index: 4;
  background: #f7f9fc;
}
#salary-summary-table th.salary-lf-seq, #salary-summary-table th.salary-lf-name {
  z-index: 4;
  background: #f7f9fc;
}
/* 斑马纹在左冻结两列上也要铺实色，横向滚动不透底 */
#salary-v1-table tbody tr:nth-child(even) td.salary-lf-seq,
#salary-v1-table tbody tr:nth-child(even) td.salary-lf-name,
#salary-v2-table tbody tr:nth-child(even) td.salary-lf-seq,
#salary-v2-table tbody tr:nth-child(even) td.salary-lf-name { background: #fafbfd; }

/* 打印：所有新增的左冻结列回到正常表格流（sticky 只在屏上生效），
   列宽/换行/分页一个字不改，导出与打印版式与原来一致。 */
@media print {
  #salary-v1-table th.salary-lf-seq, #salary-v1-table td.salary-lf-seq,
  #salary-v1-table th.salary-lf-name, #salary-v1-table td.salary-lf-name,
  #salary-v2-table th.salary-lf-seq, #salary-v2-table td.salary-lf-seq,
  #salary-v2-table th.salary-lf-name, #salary-v2-table td.salary-lf-name,
  #salary-summary-table th.salary-lf-seq, #salary-summary-table td.salary-lf-seq,
  #salary-summary-table th.salary-lf-name, #salary-summary-table td.salary-lf-name {
    position: static;
    left: auto;
    top: auto;
    z-index: auto;
    border-right: none;
  }
}

/* ===== r130：班组资金三张表（按月/按年/汇总）新增列 + 班组名左冻结 + 1920 宽不横滚 =====
   列顺序：班组 · 人数 · 考勤总天数 · 合同金额 · 已收款 · 申请发放工资 · 实付工资 · 结余 · 人均日薪 · 备注 · 操作
   做法：table-layout: fixed，只给每列定宽（金额列够宽不换行），剩余宽度全给备注列（可省略号）；
        班组名沿用 r129 同一套 sticky 写法（left:0），不做整体重排。 */
#team-fund-table {
  table-layout: fixed;
  width: 100%;
}
#team-fund-table th.tf-col-team, #team-fund-table td.tf-col-team { width: 132px; }
#team-fund-table th.tf-col-count, #team-fund-table td.tf-col-count { width: 62px; }
#team-fund-table th.tf-col-days, #team-fund-table td.tf-col-days { width: 100px; }
#team-fund-table th.tf-col-contract, #team-fund-table td.tf-col-contract { width: 118px; }
#team-fund-table th.tf-col-output, #team-fund-table td.tf-col-output { width: 124px; }
#team-fund-table th.tf-col-apply, #team-fund-table td.tf-col-apply { width: 122px; }
#team-fund-table th.tf-col-actual, #team-fund-table td.tf-col-actual { width: 118px; }
#team-fund-table th.tf-col-balance, #team-fund-table td.tf-col-balance { width: 134px; }
#team-fund-table th.tf-col-percap, #team-fund-table td.tf-col-percap { width: 104px; }
#team-fund-table th.tf-col-ops, #team-fund-table td.tf-col-ops { width: 128px; }
#team-fund-table th.tf-col-remark, #team-fund-table td.tf-col-remark { width: auto; }
/* 金额一律单行不换行，数字右对齐 */
#team-fund-table td.tf-col-output,
#team-fund-table td.tf-col-apply,
#team-fund-table td.tf-col-actual,
#team-fund-table td.tf-col-contract {
  white-space: nowrap;
}
/* 输入框跟格子齐宽（原来写死 108px，新列宽下会顶出格子） */
#team-fund-table .team-fund-output,
#team-fund-table .team-fund-contract {
  width: 100%;
}
#team-fund-table .team-fund-remark { width: 100%; }
/* 备注列窄 + 省略号：格子 title 里是全量文本 */
#team-fund-table td.tf-col-remark { overflow: hidden; text-overflow: ellipsis; }
/* 班组名列左冻结（与 r129 花名册/考勤表同一套：只 sticky + 铺实色，列宽不动） */
#team-fund-table th.tf-col-team,
#team-fund-table td.tf-col-team {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  white-space: nowrap;
}
#team-fund-table th.tf-col-team {
  top: 0;
  z-index: 5;
  background: #f7f9fc;
}
#team-fund-table tbody tr:nth-child(even) td.tf-col-team { background: #fafbfd; }
#team-fund-table tbody tr.team-fund-total-row td.tf-col-team { background: #eef2f7; }
/* 该行改过没保存：合同金额输入框也描橙边（与产值/备注一致） */
#team-fund-table tr.team-fund-dirty .team-fund-contract {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
/* 人均日薪没得算（0 天 / 无考勤）时的「—」：灰一点，不刺眼 */
#team-fund-table .team-fund-dash { color: #94a3b8; }
/* 打印：班组名左冻结回正常表格流，版式与列宽一个字不改（sticky 只在屏上生效） */
@media print {
  #team-fund-table th.tf-col-team,
  #team-fund-table td.tf-col-team {
    position: static;
    left: auto;
    top: auto;
    z-index: auto;
  }
  #team-fund-table { table-layout: auto; }
}
