/* ============================================================
 * 临时工模块样式 · 2026-11-16
 * 三块内容（名册 / 薪资 / 费用）收在同一个一级导航的页内子 tab。
 * 沿用 css_base.css 设计令牌与 .card / .data-table / .table-wrap / .pagination 组件，
 * 所有选择器以 .tw- 前缀隔离，不覆盖全局规则。
 * ============================================================ */

.tw-wrap { display: flex; flex-direction: column; gap: 0; height: 100%; min-height: 0; }

/* ---------- 对齐花名册：子 tab 行 + .toolbar 工具条 ---------- */
.tw-subtabs { margin: -2px 0 0 !important; flex: 0 0 auto; }
.tw-subtabs .tab.subtab { padding: 4px 16px; }
.tw-toolbar { flex-wrap: wrap; row-gap: 6px; padding: 4px 0 2px; margin-bottom: 2px; }
.tw-toolbar .toolbar-left { flex-wrap: wrap; row-gap: 6px; gap: 10px; min-width: 0; }
.tw-toolbar .toolbar-right { flex-wrap: wrap; row-gap: 6px; gap: 8px; }
.tw-toolbar .tw-in { width: auto; min-width: 110px; }
.tw-toolbar .tw-btn { height: var(--ctrl-h, 32px); border-radius: 6px; }
.tw-toolbar .tw-label { font-size: 12px; color: var(--text-muted, #4A4E52); white-space: nowrap; }

.tw-search {
  width: 240px; max-width: 30vw; height: var(--ctrl-h, 32px);
  box-sizing: border-box; padding: 0 12px; border-radius: var(--radius-pill, 999px);
}
.tw-search input { font-size: 13px; color: var(--text, #2B2F33); }
.tw-count { font-size: 11px; color: var(--text-faint, #80868B); white-space: nowrap; }

/* 子 tab 行 / 工具栏 / 内容区共用同一条左边缘（section 左边缘，无额外缩进） */
.tw-main {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 0 28px;
  display: flex; flex-direction: column; gap: 12px;
}
/* ---------- 卡片 ----------
   数据列表卡与花名册同构：.card 直接子级 .table-wrap + .pagination，
   命中 css_base 的 .card:has(> .table-wrap) 透明无边框规则（无白色底框）。 */
.tw-card { padding: 0; overflow: hidden; }
.tw-card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border, #C7CFDB);
  font-size: 13px; color: var(--text-strong, #16181A);
}
.tw-card-h b { font-weight: 600; }
.tw-card-b { padding: 12px 14px; overflow: auto; }

/* ---------- 控件：上下式标签 + 浅灰描边，编辑态不加蓝色 glow ---------- */
.tw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 13px; border-radius: var(--radius, 8px);
  border: 1px solid var(--border, #C7CFDB); background: var(--card-bg, #fff);
  color: var(--text, #2B2F33); font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: filter .15s;
}
.tw-btn:hover:not(:disabled) { filter: brightness(.97); }
.tw-btn:disabled { opacity: .5; cursor: not-allowed; }
.tw-btn.primary { background: var(--primary, #1A73E8); border-color: var(--primary, #1A73E8); color: #fff; }
.tw-btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.tw-mini {
  height: 22px; padding: 0 8px; font-size: 11px; border-radius: 5px;
  border: 1px solid var(--border, #C7CFDB); background: var(--card-bg, #fff);
  color: var(--primary, #1A73E8); cursor: pointer; white-space: nowrap;
}
.tw-mini:hover { border-color: var(--primary, #1A73E8); }
.tw-mini.danger { color: #c0392b; }
.tw-mini.danger:hover { border-color: #c0392b; }
.tw-in {
  display: block; width: 100%; height: 30px; padding: 0 9px; font-size: 12px;
  border: 1px solid var(--border, #C7CFDB); border-radius: var(--radius, 8px);
  background: var(--card-bg, #fff); color: var(--text, #2B2F33);
  outline: none; box-shadow: none;
}
.tw-in:focus, .tw-in:hover { border-color: var(--border, #C7CFDB); box-shadow: none; }
.tw-in.sm { height: 26px; min-width: 78px; font-size: 12px; padding: 0 6px; }
.tw-in[readonly] { background: #F5F7FA; color: var(--text-muted, #4A4E52); }
textarea.tw-in { height: auto; padding: 7px 9px; line-height: 1.5; resize: vertical; }
.tw-field { display: block; margin-bottom: 11px; }
.tw-field > label { display: block; font-size: 12px; color: var(--text-muted, #4A4E52); margin-bottom: 5px; }
.tw-field > label .req { color: #c0392b; margin-left: 2px; }
.tw-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tw-form-grid.one { grid-template-columns: 1fr; }
.tw-span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .tw-form-grid { grid-template-columns: 1fr; } }

/* 日期控件：convertDateInput 会把 class 复制到 .date-picker 包裹层，需复位避免双框 */
.tw-dialog .date-picker.tw-in,
.tw-dialog .date-picker {
  height: auto; width: 100%; padding: 0; border: 0; background: transparent;
  box-shadow: none; display: block;
}
.tw-dialog .date-picker .dp-input {
  width: 100%; height: 30px; padding: 0 9px; font-size: 12px;
  border: 1px solid var(--border, #C7CFDB); border-radius: var(--radius, 8px);
  background: var(--card-bg, #fff); color: var(--text, #2B2F33); box-sizing: border-box;
}
.tw-dialog .date-picker .dp-input:focus,
.tw-dialog .date-picker .dp-input:hover,
.tw-dialog .date-picker.open .dp-input { border-color: var(--border, #C7CFDB); box-shadow: none; }

/* ---------- 提示条 / 胶囊标签 ---------- */
.tw-banner {
  padding: 9px 13px; border-radius: var(--radius, 8px); font-size: 12px; line-height: 1.65;
  border-left: 3px solid var(--primary, #1A73E8);
  background: var(--primary-soft, #E8F0FE); color: var(--text, #2B2F33);
}
.tw-banner.warn { border-left-color: var(--warning, #FBBC04); background: #FFF8E6; }
.tw-banner.ok { border-left-color: var(--success, #34A853); background: #EFF8F1; }
.tw-pill {
  display: inline-block; padding: 1px 9px; border-radius: var(--radius-pill, 999px);
  font-size: 11px; line-height: 18px; white-space: nowrap;
  background: var(--primary-soft, #E8F0FE); color: var(--primary, #1A73E8);
}
.tw-pill.warn { background: #FFF3E0; color: #B76E00; }
.tw-pill.ok { background: #E3F5E9; color: #1A7F43; }
.tw-pill.off { background: #EEF1F5; color: #6B7280; }
.tw-tip { font-size: 11px; color: var(--text-faint, #80868B); line-height: 1.6; }

/* ---------- 统计卡 ---------- */
.tw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tw-stat {
  background: var(--card-bg, #fff); border: 1px solid var(--border, #C7CFDB);
  border-radius: var(--radius, 8px); padding: 10px 12px;
}
.tw-stat .v { font-size: 18px; font-weight: 600; color: var(--text-strong, #16181A); line-height: 1.3; font-variant-numeric: tabular-nums; }
.tw-stat .l { font-size: 11px; color: var(--text-faint, #80868B); margin-top: 3px; }
.tw-stat.accent .v { color: var(--primary, #1A73E8); }
.tw-stat.money .v { font-size: 17px; }

/* 费用分类占比条 */
.tw-catbars { display: flex; flex-direction: column; gap: 7px; }
.tw-catrow { display: grid; grid-template-columns: 74px 1fr 96px; align-items: center; gap: 10px; font-size: 12px; }
.tw-catrow .nm { color: var(--text-muted, #4A4E52); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-catrow .bar { height: 8px; border-radius: 4px; background: #EEF1F5; overflow: hidden; }
.tw-catrow .bar > i { display: block; height: 100%; border-radius: 4px; background: var(--primary, #1A73E8); }
.tw-catrow .am { text-align: right; color: var(--text, #2B2F33); font-variant-numeric: tabular-nums; }

/* ---------- 表格 ---------- */
.tw-table { font-size: 12px; }
.tw-table th { font-size: 12px; white-space: nowrap; }
.tw-table td { white-space: nowrap; vertical-align: middle; line-height: 1.5; font-size: 12px; }
.tw-table td.wrap { white-space: normal; min-width: 130px; }
.tw-table td.money { text-align: right; font-variant-numeric: tabular-nums; }
.tw-table td.empty { text-align: center; color: var(--text-faint, #80868B); padding: 26px 0; }
.tw-table tbody tr:hover td { background: #F7F9FC; }
.tw-table input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; vertical-align: middle; }
.tw-strong { font-weight: 600; color: var(--text-strong, #16181A); }
.tw-sub { font-size: 11px; color: var(--text-faint, #80868B); }
.tw-mono { font-variant-numeric: tabular-nums; }

/* ---------- 弹窗（私有，不带 .modal，避免被 autoFloatModalOnShow 浮窗化） ---------- */
.tw-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.tw-dialog {
  background: var(--card-bg, #fff); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  width: 720px; max-width: 96vw; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.tw-dialog.wide { width: 900px; }
.tw-dialog-h {
  padding: 13px 18px; border-bottom: 1px solid var(--border, #C7CFDB);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-strong, #16181A); flex: 0 0 auto;
}
.tw-dialog-b { padding: 16px 18px; overflow: auto; flex: 1 1 auto; }
.tw-dialog-f {
  padding: 12px 18px; border-top: 1px solid var(--border, #C7CFDB);
  display: flex; justify-content: flex-end; gap: 8px; flex: 0 0 auto;
}
.tw-x {
  border: 0; background: transparent; cursor: pointer; padding: 0 2px;
  font-size: 19px; line-height: 1; color: var(--text-faint, #80868B);
}
.tw-x:hover { color: var(--text, #2B2F33); }

/* 薪资弹窗：应发/实发强调块 */
.tw-calc {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  padding: 10px 12px; border-radius: var(--radius, 8px); background: #F5F7FA;
  border: 1px solid var(--border, #C7CFDB); margin-bottom: 12px; font-size: 12px;
}
.tw-calc b { font-size: 15px; color: var(--text-strong, #16181A); font-variant-numeric: tabular-nums; }
.tw-calc .k { color: var(--text-muted, #4A4E52); margin-right: 4px; }

/* 迁移弹窗内的提示 */
.tw-mig-list { max-height: 46vh; overflow: auto; border: 1px solid var(--border, #C7CFDB); border-radius: 8px; }
.tw-mig-list .table-wrap { margin: 0; }
