/* ============ 设计变量 ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #ea580c;
  --warning-light: #ffedd5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --cyan: #0891b2;
  --cyan-light: #cffafe;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-w: 166px;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.14);
  --transition: .2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

svg { width: 20px; height: 20px; flex-shrink: 0; }

.app { display: flex; min-height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.brand-logo svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .5px; }
.brand-text span { font-size: 9px; color: #64748b; margin-top: 1px; white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 14px 8px; overflow-y: auto; }

.nav-group { margin-bottom: 20px; }
.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 9px;
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(37,99,235,.12));
  color: #fff;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.nav-item.active svg { color: #60a5fa; }

/* 报工菜单下的可折叠子菜单 */
.nav-parent { margin-bottom: 3px; }
.nav-parent-row { display: flex; align-items: center; }
.nav-parent-row .nav-item { flex: 1; margin-bottom: 0; }
.nav-toggle {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 30px;
  margin-right: 4px;
  padding: 0;
  background: none; border: 0;
  color: #64748b; cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-toggle:hover { color: #e2e8f0; background: var(--sidebar-hover); }
.nav-toggle svg { width: 15px; height: 15px; transition: transform .2s ease; }
.nav-parent.open .nav-toggle svg { transform: rotate(180deg); }

.nav-sub { display: none; padding: 4px 0 6px 24px; }
.nav-parent.open .nav-sub { display: block; }
.nav-sub-item {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(148,163,184,.25);
  color: #8494a8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}
.nav-sub-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-sub-item.active {
  background: rgba(37,99,235,.18);
  color: #fff;
  border-left-color: #3b82f6;
}
.nav-parent.parent-active > .nav-parent-row > .nav-item {
  background: linear-gradient(135deg, rgba(37,99,235,.22), rgba(37,99,235,.1));
  color: #fff;
}
.nav-parent.parent-active > .nav-parent-row > .nav-item svg { color: #60a5fa; }

.sidebar-footer { padding: 14px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.storage-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
}
.storage-badge svg { width: 18px; height: 18px; color: #22c55e; }
.storage-badge div { display: flex; flex-direction: column; }
.storage-badge strong { color: #cbd5e1; font-size: 12px; font-weight: 600; }
.storage-badge span { color: #64748b; font-size: 10px; }

/* ============ 主内容 ============ */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.topbar-title p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.date-chip {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 20px;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--bg); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.content { flex: 1; padding: 28px; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ============ 视图 ============ */
.view { display: none; animation: fadeIn .3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header p { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }

/* ============ 统计卡片 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
/* 生产概况：三名机长卡片固定一排，等宽；覆膜卡略高以容纳今日平方数 */
.chief-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chief-stat-grid .stat-card { min-height: 118px; }
.chief-stat-grid [data-stat="todayProcess:laminating"] { min-height: 134px; }
@media (max-width: 900px) {
  .chief-stat-grid { grid-template-columns: 1fr; }
  .chief-stat-grid [data-stat="todayProcess:laminating"] { min-height: 118px; }
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { border-color: var(--primary); }
.stat-more { float: right; font-size: 11px; color: var(--primary); font-weight: 400; }
.stat-process-foot { display: flex; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.stat-process-foot .pf-print { color: var(--primary); }
.stat-process-foot .pf-lam { color: var(--purple); }
.stat-process-foot .pf-die { color: var(--warning); }
.stat-value-split { display: flex; align-items: flex-end; gap: 14px; }
.stat-value-split > span { display: flex; flex-direction: column; line-height: 1.15; }
.stat-value-split b { font-size: 23px; font-weight: 700; }
.stat-value-split small { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-top: 4px; white-space: nowrap; }
.stat-value-split > span + span { border-left: 1px solid var(--border); padding-left: 14px; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-info { flex: 1; }
.stat-info .stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-info .stat-value { font-size: 28px; font-weight: 700; margin: 4px 0; line-height: 1.2; }
.stat-info .stat-foot { font-size: 11px; color: var(--text-muted); }

/* ============ 卡片/面板 ============ */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-header h3 svg { width: 18px; height: 18px; color: var(--primary); }
.panel-body { padding: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ============ 工序进度卡 ============ */
.process-progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.progress-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.progress-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.progress-card-icon svg { width: 20px; height: 20px; }
.progress-card-icon.printing { background: var(--primary-light); color: var(--primary); }
.progress-card-icon.laminating { background: var(--purple-light); color: var(--purple); }
.progress-card-icon.diecutting { background: var(--warning-light); color: var(--warning); }
.progress-card-title { font-weight: 700; font-size: 14px; }
.progress-card-sub { font-size: 11px; color: var(--text-muted); }
.progress-card-pct { font-size: 24px; font-weight: 700; margin-left: auto; }
.progress-bar-track { height: 8px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 10px; transition: width .5s ease; }
.progress-bar-fill.printing { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.progress-bar-fill.laminating { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.progress-bar-fill.diecutting { background: linear-gradient(90deg, #f97316, #ea580c); }
.progress-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ============ 表格 ============ */
.table-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search-box input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--surface);
  cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* 表格字段筛选：下拉项按字段值自动去重，点击“字段筛选”展开/收起 */
.field-filter-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.field-filter-panel { padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg); }
.field-filter-grid { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 10px; }
.field-filter-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.field-filter-item .filter-select { padding: 6px 8px; font-size: 12px; max-width: 190px; }

/* 报工班次：07:30–次日07:00 夜班，其余白班 */
.shift-tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.shift-tag.night { background: #ede9fe; color: #6d28d9; }
.shift-tag.day { background: #dcfce7; color: #15803d; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
/* 逐笔明细弹窗汇总条 */
.monthly-summary-strip { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 16px; margin: 4px 0 8px; background: var(--bg); border-radius: 8px; }
.monthly-summary-strip > div { display: flex; flex-direction: column; gap: 3px; }
.monthly-summary-strip span { font-size: 11px; color: var(--text-muted); }
.monthly-summary-strip strong { font-size: 15px; }

/* ============ 应收/应付统计表（参考财务软件：期间 + 客户一行 + 期初/本期/期末） ============ */
.stat-report { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat-report-title { font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 2px; color: var(--text); margin-bottom: 16px; }
.stat-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 14px; }
.stat-filter-bar .sf-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.stat-filter-bar .sf-month { width: 110px; background: #fff2cc; border-color: #ffc000; font-weight: 600; }
.stat-filter-bar .sf-search { margin-left: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-table th, .stat-table td { border: 1px solid #cbd5e1; padding: 8px 10px; }
.stat-table .st-head th { background: #44B36E; color: #fff; font-weight: 700; text-align: left; white-space: nowrap; }
.stat-table .st-head th:nth-child(n+3):nth-child(-n+6) { text-align: right; }
.stat-table .st-total td { background: #fff2cc; font-weight: 700; }
.stat-table .t { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-table .inc { color: var(--warning); }
.stat-table .dec { color: var(--success); }
.stat-table .st-balance { background: #fff9c4; font-weight: 700; }
.stat-table.ap-stat .inc { color: var(--danger); }
.stat-table.ap-stat .st-balance { background: #dbeafe; }
.stat-table .st-row:hover td { background: var(--primary-light); }
.stat-table .st-row:hover .st-balance { background: #fde68a; }
.stat-table.ap-stat .st-row:hover .st-balance { background: #bfdbfe; }
.stat-table .st-note { min-width: 60px; }
.stat-table td[colspan] { text-align: right; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 13px 16px;
  background: linear-gradient(180deg, #f1f5fb 0%, #e8eef8 100%);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
  border-bottom: 2px solid #cbd5e1;
  letter-spacing: .3px;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid #eef2f7; font-size: 13px; vertical-align: middle; }
tbody tr { transition: var(--transition); }
tbody tr:nth-child(even) { background: #eef2f8; }
tbody tr:hover { background: var(--primary-light); }
tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cell-mono { font-family: "SF Mono", Monaco, Consolas, monospace; font-size: 12px; color: var(--primary); font-weight: 600; }
.text-right { text-align: right; }
/* 完工状态：绿色强调徽章 */
.finish-done {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--success-light); color: var(--success);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.finish-done::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* 机长姓名：紫色标签 */
.chief-name-tag {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  background: var(--purple-light); color: var(--purple);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--bg); color: var(--text-secondary); }
.badge.printing { background: var(--primary-light); color: var(--primary); }
.badge.laminating { background: var(--purple-light); color: var(--purple); }
.badge.diecutting { background: var(--warning-light); color: var(--warning); }
.badge.completed { background: var(--success-light); color: var(--success); }
.badge.process-print { background: var(--primary-light); color: var(--primary); }
.badge.process-laminate { background: var(--purple-light); color: var(--purple); }
.badge.process-die { background: var(--warning-light); color: var(--warning); }

/* 小进度条 */
.mini-progress { display: flex; align-items: center; gap: 8px; }
.mini-progress-track { width: 70px; height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.mini-progress-fill { height: 100%; border-radius: 6px; }
.mini-progress-text { font-size: 11px; font-weight: 600; color: var(--text-secondary); min-width: 34px; }

/* 操作按钮组 */
.action-btns { display: flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px;
  border: none;
  background: var(--bg);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }
.icon-btn.danger:hover { background: var(--danger-light); color: var(--danger); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding: 10px 0 6px; margin-top: 2px;
  border-bottom: 1px dashed var(--border);
}
.form-section-title:not(:first-child) { margin-top: 8px; }
.form-section-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--primary);
}
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-group label .required { color: var(--danger); }
.form-control {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  width: 100%;
  background: var(--surface);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 70px; }
/* 订单录入表单：填入内容字体加大加黑，便于车间识读（仅订单表单，不影响其它表单） */
#orderForm .form-control {
  font-size: 15px; font-weight: 700; color: #1a1a1a;
}
/* 报工数量输入框：粉色底，醒目提示需填写/已填数量 */
.qty-pink { background: #fce7f3 !important; border-color: #f9a8d4 !important; color: #be185d !important; font-weight: 700; }
.qty-pink::placeholder { color: #db2777; opacity: .6; }
.qty-pink:focus { border-color: #db2777 !important; box-shadow: 0 0 0 3px rgba(219,39,119,.18) !important; }
.form-hint { font-size: 11px; color: var(--text-muted); }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .25s ease;
}
.modal.modal-lg { max-width: 740px; max-height: 96vh; }
.modal.modal-print { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============ 报工页面 ============ */
.work-layout { display: grid; grid-template-columns: minmax(0, 1fr) 613px; gap: 20px; align-items: start; }

.process-banner {
  border-radius: var(--radius);
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.process-banner::after { content: ''; position: absolute; right: -30px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.process-banner.printing { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.process-banner.laminating { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.process-banner.diecutting { background: linear-gradient(135deg, #f97316, #c2410c); }
.process-banner .pb-icon { width: 52px; height: 52px; background: rgba(255,255,255,.18); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.process-banner .pb-icon svg { width: 28px; height: 28px; }
.process-banner .pb-text { flex: 1; }
.process-banner .pb-text h3 { font-size: 18px; margin-bottom: 3px; }
.process-banner .pb-text p { font-size: 12px; opacity: .85; }

.order-select-panel .panel-body { padding: 0; }
.order-option-list { max-height: 360px; overflow-y: auto; }
.order-option {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.order-option:last-child { border-bottom: none; }
.order-option:hover { background: #f8fafc; }
.order-option.selected { background: var(--primary-light); border-left: 3px solid var(--primary); padding-left: 15px; }
.order-option-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.order-option-no { font-weight: 700; font-size: 13px; font-family: "SF Mono", Monaco, monospace; color: var(--primary); }
.order-option-name { font-size: 13px; font-weight: 600; }
.order-option-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; }

.selected-order-info { margin-bottom: 20px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { background: var(--bg); padding: 12px 14px; border-radius: var(--radius-sm); }
.info-item label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; }
.info-item .val { font-size: 14px; font-weight: 600; }

/* 报工成功提示 */
.report-summary {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
  display: none;
}
.report-summary.show { display: block; animation: fadeIn .3s ease; }
.report-summary h4 { color: var(--success); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.report-summary h4 svg { width: 18px; height: 18px; }
.report-summary .rs-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.report-summary .rs-row span:first-child { color: var(--text-secondary); }
.report-summary .rs-row strong { font-weight: 700; }

/* ============ 订单详情 ============ */
.detail-section { margin-bottom: 24px; }
.detail-section h4 { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.detail-item label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; }
.detail-item .val { font-size: 14px; font-weight: 600; }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -24px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--border);
}
.timeline-dot.done { background: var(--success); border-color: var(--success); }
.timeline-dot.active { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.timeline-item strong { font-size: 13px; }
.timeline-item p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; color: #cbd5e1; }
.empty-state h3 { color: var(--text-secondary); font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 18px; }

/* ============ 提示消息 ============ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500;
  border-left: 4px solid var(--primary);
  min-width: 260px;
  animation: toastIn .3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast svg { width: 18px; height: 18px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .work-layout { grid-template-columns: 1fr; }
  .grid-3, .process-progress-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .process-progress-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .date-chip { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   多用户登录 ERP · 追加样式
   ============================================================ */

/* ---------- 登录视图 ---------- */
.login-view {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  padding: 20px;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-decor { position: absolute; border-radius: 50%; background: rgba(59,130,246,.12); }
.decor-1 { width: 500px; height: 500px; top: -180px; left: -120px; }
.decor-2 { width: 380px; height: 380px; bottom: -140px; right: -100px; background: rgba(124,58,237,.12); }
.decor-3 { width: 240px; height: 240px; top: 45%; right: 18%; background: rgba(16,185,129,.07); }

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  padding: 38px 40px 28px;
  animation: modalIn .4s ease;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-brand .brand-logo { width: 52px; height: 52px; border-radius: 14px; }
.login-brand .brand-logo svg { width: 28px; height: 28px; }
.login-brand h1 { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.login-brand p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.login-features {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  padding: 14px 16px; background: var(--bg);
  border-radius: 10px; margin-bottom: 24px;
}
.lf-item { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.lf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.login-form-wrap h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.login-tip { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.login-form-wrap .form-group { margin-bottom: 16px; }
.login-form-wrap .form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.code-input-row { display: flex; gap: 10px; }
.code-input-row .form-control { flex: 1; }
.code-btn { white-space: nowrap; min-width: 116px; justify-content: center; }
.code-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.login-submit { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 4px; letter-spacing: 4px; }
.field-error { color: var(--danger); font-size: 11px; margin-top: 5px; min-height: 0; }
.login-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px 0; color: var(--text-secondary); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.beian-line { text-align: center; font-size: 11px; margin-top: 8px; line-height: 1.6; }
.beian-line a { color: inherit; text-decoration: none; }
.beian-line a:hover { text-decoration: underline; }
.sidebar-footer .beian-line { color: #64748b; margin-top: 10px; font-size: 10px; }

/* ---------- 用户面板 ---------- */
.user-panel { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-meta strong { color: #e2e8f0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { color: #64748b; font-size: 10px; }
.logout-btn { background: none; border: none; color: #64748b; cursor: pointer; padding: 6px; border-radius: 6px; display: flex; }
.logout-btn:hover { background: rgba(255,255,255,.08); color: #f87171; }
.logout-btn svg { width: 17px; height: 17px; }

/* ---------- 工序流转状态标签 ---------- */
.badge.f-printing { background: var(--primary-light); color: var(--primary); }
.badge.f-lam_pending { background: var(--purple-light); color: var(--purple); }
.badge.f-die_pending { background: var(--warning-light); color: var(--warning); }
.badge.f-completed { background: var(--success-light); color: var(--success); }

/* ---------- 印刷/覆膜/模切/订单 四段状态标签 ---------- */
.badge.st-pending  { background: var(--bg); color: var(--text-secondary); }
.badge.st-doing    { background: var(--primary-light); color: var(--primary); }
.badge.st-done     { background: var(--success-light); color: var(--success); }
.badge.st-skip     { background: var(--bg); color: var(--text-muted); }
.badge.st-producing{ background: var(--warning-light); color: var(--warning); }
.badge.st-finished { background: var(--success-light); color: var(--success); }

/* ---------- 订单详情四段状态 ---------- */
.stage-status-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 14px; padding: 12px 14px; background: var(--bg); border-radius: 10px;
}
.stage-status-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stage-status-cell label { font-size: 11px; color: var(--text-muted); }
@media (max-width: 720px) { .stage-status-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 工序流转看板 ---------- */
.flow-board { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.flow-col {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; min-height: 200px; display: flex; flex-direction: column;
}
.flow-col-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #f8fafc; border-radius: 10px 10px 0 0;
}
.flow-col-head .fc-title { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.flow-col-head .fc-title .fc-dot { width: 8px; height: 8px; border-radius: 50%; }
.flow-col-head .fc-count {
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 12px; color: var(--text-secondary);
}
.flow-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.flow-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: var(--transition);
}
.flow-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--primary); }
.flow-card-no { font-size: 11px; font-family: "SF Mono", Monaco, monospace; color: var(--primary); font-weight: 700; }
.flow-card-customer { font-size: 12px; font-weight: 600; margin: 4px 0 2px; }
.flow-card-product { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 10px; color: var(--text-muted); }
.flow-card-qty { font-weight: 600; color: var(--text-secondary); }

/* ---------- 表单内只读快照 ---------- */
.readonly-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); min-height: 40px; display: flex; align-items: center;
}
.auto-hint { font-size: 10px; color: var(--primary); margin-top: 3px; }

/* ---------- 可搜索/可新增的单选下拉 combobox ---------- */
.combo { position: relative; }
.combo-control { position: relative; }
.combo-control .combo-input { padding-right: 34px; }
.combo-toggle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 32px;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.combo-toggle svg { width: 15px; height: 15px; transform: rotate(90deg); }
.combo-toggle:hover { color: var(--primary); }
.combo-list {
  display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 210px; overflow-y: auto; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.combo-list.show { display: block; }
.combo-item {
  padding: 8px 10px; font-size: 13px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.combo-item-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item:hover { background: var(--primary-light); color: var(--primary); }
.combo-item.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.combo-item-del {
  flex: 0 0 auto; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: none; background: transparent; color: var(--text-muted); font-size: 16px;
  cursor: pointer; border-radius: 4px; padding: 0;
}
.combo-item-del:hover { background: var(--danger-light, #fee2e2); color: var(--danger, #dc2626); }
.combo-item.combo-new { color: var(--primary); font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; margin-bottom: 3px; padding-bottom: 10px; }
.combo-item.combo-new svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.combo-empty { padding: 12px 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.orders-table { min-width: 2480px; }
.orders-table td { white-space: nowrap; }
.orders-table tbody tr.order-row { cursor: pointer; }
.orders-table tbody tr.order-row:hover { background: var(--primary-light); }
.profile-table { min-width: 1800px; }
.profile-table td { white-space: nowrap; }

/* ---------- 资料编号：输入 + 查找按钮 ---------- */
.docno-input-row { display: flex; gap: 8px; align-items: stretch; }
.docno-input-row .form-control { flex: 1; min-width: 0; }
.docno-input-row .docno-search-btn {
  flex: 0 0 auto; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; white-space: nowrap;
}
.docno-input-row .docno-search-btn svg { width: 15px; height: 15px; }

/* ---------- 客户资料选择弹窗 ---------- */
.picker-overlay {
  position: fixed; inset: 0; z-index: 250; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
}
.picker-overlay.show { display: flex; }
.picker-dialog {
  width: 100%; max-width: 780px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  overflow: hidden; animation: modalIn .2s ease;
}
.picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.picker-header h2 { font-size: 16px; margin: 0; }
.picker-body { padding: 16px 20px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.picker-search { position: relative; }
.picker-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.picker-search .form-control { padding-left: 36px; }
.picker-tip { font-size: 12px; color: var(--text-secondary); margin: 10px 0 8px; }
.picker-list { overflow-y: auto; min-height: 120px; max-height: 48vh; display: flex; flex-direction: column; gap: 8px; }
.picker-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
  transition: border-color .15s, background .15s; background: var(--surface, #fff);
}
.picker-item:hover { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.picker-item.selected { border-color: var(--primary); background: var(--primary-light, #eff6ff); box-shadow: inset 3px 0 0 var(--primary); }
.picker-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }
.pi-main { flex: 1; min-width: 0; }
.pi-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pi-top .cell-mono { font-size: 12px; color: var(--primary); font-weight: 700; }
.pi-top strong { font-size: 13px; }
.pi-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-time { font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }
.picker-empty { text-align: center; color: var(--text-secondary); padding: 36px 10px; font-size: 13px; }
.picker-empty svg { width: 34px; height: 34px; color: var(--text-muted); display: block; margin: 0 auto 10px; }
.picker-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg);
}
.picker-count { font-size: 12px; color: var(--text-secondary); }
.picker-footer-btns { display: flex; gap: 10px; }
.btn-sm { padding: 5px 10px; font-size: 11px; gap: 4px; }
.btn-sm svg { width: 13px; height: 13px; }

@media (max-width: 900px) {
  .login-card { padding: 28px 24px 22px; }
  .flow-board { grid-template-columns: repeat(7, 210px); }
}

/* ============ 订单生产工单打印模板 ============ */
.print-tip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--primary-light); color: var(--primary);
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;
}
.print-tip svg { width: 16px; height: 16px; flex: 0 0 auto; }
.print-preview-wrap {
  background: #e9edf3; padding: 20px; border-radius: 8px;
  max-height: 62vh; overflow: auto; display: flex; justify-content: center;
}
.print-paper {
  background: #fff; color: #1a1a1a;
  width: 100%; max-width: 820px; min-height: 480px;
  padding: 24px 30px; box-sizing: border-box;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
  font-family: "Microsoft YaHei", "PingFang SC", SimSun, sans-serif;
}
.pp-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 1px solid #000; padding-bottom: 12px; margin-bottom: 12px;
}
.pp-head-qr { width: calc(62px + 5mm); height: calc(62px + 5mm); flex: 0 0 auto; background: #fff; border: 1px solid #000; display: flex; align-items: center; justify-content: center; }
.pp-head-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.pp-head h1 { flex: 1; text-align: center; font-size: 30px; letter-spacing: 8px; margin: 0; font-weight: 900; color: #000; }
.pp-head-right { text-align: right; font-size: 13px; line-height: 1.5; color: #000; font-weight: 700; margin-right: 24px; }
.pp-head-right strong { font-size: 24px; color: #000; font-weight: 900; }
.pp-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 700; color: #000; padding: 8px 0 12px; border-bottom: 1px solid #000;
}
.pp-meta strong { color: #000; }
.pp-section-title {
  font-size: 14px; font-weight: 800; letter-spacing: 1px;
  padding: 8px 10px; margin: 12px 0 8px;
  background: #eceff3; border-left: 1px solid #000; color: #000;
}
.pp-grid { display: grid; gap: 0; border-left: 1px solid #000; }
.pp-grid-1 { grid-template-columns: 1fr; }
.pp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pp-field {
  display: flex; min-height: 42px; border-right: 1px solid #000; border-bottom: 1px solid #000;
}
.pp-label {
  flex: 0 0 92px; padding: 10px 8px; font-size: 15.6px; font-weight: 800; color: #000;
  background: #f2f2f2; border-right: 1px solid #000; display: flex; align-items: center;
}
.pp-value { flex: 1; padding: 10px 10px; font-size: 16px; font-weight: 800; color: #000; display: flex; align-items: center; word-break: break-all; }
.pp-mono { font-family: Consolas, monospace; }
/* 生产工序 / 备注：左侧竖排标签 + 右侧内容 */
.pp-side-block { display: flex; margin-top: 14px; border: 1px solid #000; }
.pp-side-label {
  flex: 0 0 34px; writing-mode: vertical-rl; text-orientation: upright;
  display: flex; align-items: center; justify-content: center;
  background: #eceff3; border-right: 1px solid #000;
  font-size: 14px; font-weight: 800; letter-spacing: 3px; color: #000;
  padding: 10px 0;
}
.pp-side-block .pp-grid { flex: 1; border-top: none; border-left: none; }
.pp-remark { margin-top: 12px; }
.pp-remark-body { flex: 1; padding: 12px; font-size: 15px; font-weight: 700; line-height: 1.6; min-height: 60px; white-space: pre-wrap; color: #000; }
.pp-process-label { padding: 10px 10px; font-size: 15.6px; font-weight: 800; color: #000; text-align: center; border-right: 1px solid #000; border-bottom: none; background: #f2f2f2; }
.pp-process-label:last-child { border-right: none; }
.pp-process-label strong { color: #000; display: block; margin-top: 4px; font-size: 16px; font-weight: 900; }
.pp-footer-entry { margin-top: 16px; padding-top: 0; border-top: none; font-size: 13px; font-weight: 700; color: #000; text-align: right; }
.pp-footer-entry strong { color: #000; font-size: 15px; font-weight: 900; }
/* 其它打印模板（对账单 / 报表）共用的签字栏，订单工单已不再使用 */
.pp-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 34px; font-size: 11px; color: #333; }
/* 二维码块：订单工单已将二维码移至左上角，此样式保留给可能沿用的其它模板 */
.pp-qr-block { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px; border: 1px dashed #8a8a8a; background: #fafafa; }
.pp-qr-text strong { display: block; font-size: 13px; color: #1a1a1a; margin-bottom: 4px; }
.pp-qr-text span { display: block; font-size: 10px; color: #666; line-height: 1.6; }
.pp-qr-block {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding: 12px 14px;
  border: 1px dashed #8a8a8a; background: #fafafa;
}
.pp-qr-box {
  width: 88px; height: 88px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #ddd;
}
.pp-qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.pp-qr-fallback { font-size: 10px; font-weight: 700; word-break: break-all; text-align: center; }
.pp-qr-text strong { display: block; font-size: 13px; color: #1a1a1a; margin-bottom: 4px; }
.pp-qr-text span { display: block; font-size: 10px; color: #666; line-height: 1.6; }

/* 打印容器：屏幕上始终隐藏，避免打印预览的残留 HTML 显示在页面底部（如订单表下方出现对账单内容）；仅打印时显示 */
#printRoot { display: none; }

@media print {
  /* 纸张尺寸与页边距完全由电脑端（打印机驱动 / 打印对话框）决定，代码不指定任何纸张规则 */
  body > *:not(#printRoot) { display: none !important; }
  #printRoot { display: block !important; }
  .print-paper {
    max-width: none; min-height: auto; padding: 0;
    box-shadow: none; font-size: 11pt; width: auto;
  }
  .pp-head { padding-bottom: 6px; margin-bottom: 6px; }
  .pp-head-qr { width: calc(46px + 5mm); height: calc(46px + 5mm); border-width: 1px; }
  .pp-head h1 { font-size: 22px; letter-spacing: 5px; }
  .pp-head-right strong { font-size: 18px; }
  .pp-meta { padding: 4px 0 6px; }
  .pp-field { min-height: 26px; }
  .pp-label { flex-basis: 72px; padding: 4px 6px; font-size: 13.2px; }
  .pp-value { padding: 4px 6px; font-size: 13px; }
  .pp-side-block { margin-top: 7px; }
  .pp-remark { margin-top: 7px; }
  .pp-remark-body { padding: 6px; font-size: 12px; min-height: 34px; }
  .pp-process-label { padding: 5px 6px; font-size: 13.2px; }
  .pp-process-label strong { font-size: 13px; }
  .pp-footer-entry { margin-top: 8px; padding-top: 0; }
  .pp-qr-block { padding: 8px 10px; }
  .pp-qr-box { width: 70px; height: 70px; }
}

/* ============ 工作台 · 各机长报工统计 ============ */
.chief-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.chief-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.chief-card-clickable { cursor: pointer; transition: var(--transition); }
.chief-card-clickable:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.chief-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chief-avatar {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.chief-avatar.primary { background: var(--primary-light); color: var(--primary); }
.chief-avatar.purple { background: var(--purple-light); color: var(--purple); }
.chief-avatar.warning { background: var(--warning-light); color: var(--warning); }
.chief-avatar.success { background: var(--success-light); color: var(--success); }
.chief-name { font-size: 14px; font-weight: 700; color: var(--text); }
.chief-process-group { margin-bottom: 22px; }
.chief-process-group:last-child { margin-bottom: 0; }
/* 各机长报工统计：印刷独占一行，覆膜/模切并排一行 */
.chief-groups { display: flex; flex-wrap: wrap; gap: 18px 20px; align-items: stretch; }
.chief-groups > .chief-process-group { flex: 1 1 calc(50% - 10px); min-width: 0; margin-bottom: 0; }
.chief-groups > .chief-process-group:first-child { flex: 1 1 100%; }
.chief-groups .chief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 生产印刷机长 3 人一排 */
.chief-groups > .chief-process-group:first-child .chief-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .chief-groups > .chief-process-group { flex: 1 1 100%; }
  .chief-groups > .chief-process-group:first-child .chief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.chief-process-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  padding: 0 0 10px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.chief-process-dot { width: 4px; height: 15px; border-radius: 2px; background: var(--primary); }
.chief-process-dot.primary { background: var(--primary); }
.chief-process-dot.purple { background: var(--purple); }
.chief-process-dot.warning { background: var(--warning); }
.chief-process-count { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.chief-process-empty { padding: 14px 4px; font-size: 12px; color: var(--text-muted); }
.chief-card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chief-stat { text-align: center; padding: 8px 4px; background: var(--surface); border-radius: 8px; }
.chief-stat-clickable { cursor: pointer; transition: var(--transition); }
.chief-stat-clickable:hover { background: var(--primary-light); box-shadow: 0 0 0 1px var(--primary); }
.chief-stat-val { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.chief-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.chief-stat-clickable .chief-stat-label { color: var(--primary); font-weight: 600; }
.chief-stat-today { background: var(--primary-light); }
.chief-stat-wide { grid-column: 1 / -1; }
/* 覆膜机长卡片：今日报工单数 / 今日报工数量 / 今日平方数 三项一排 */
.chief-card-stats-3 { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chief-card-stats-3 .chief-stat { padding: 7px 2px; }
.chief-card-stats-3 .chief-stat-val { font-size: 17px; }
.chief-card-stats-3 .chief-stat-label { font-size: 10px; margin-top: 3px; }
.chief-modal-summary {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.chief-modal-summary > div { flex: 1; min-width: 90px; }
.chief-modal-summary span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.chief-modal-summary strong { font-size: 16px; color: var(--text); }
.chief-detail-table th, .chief-detail-table td { white-space: nowrap; }
.chief-detail-table .cell-sub { max-width: 200px; }

/* ============ 财务管理 ============ */
.finance-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.fin-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.fin-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.fin-card.income::before { background: var(--success); }
.fin-card.expense::before { background: var(--danger); }
.fin-card.orderamt::before { background: var(--primary); }
.fin-card.receivable::before { background: var(--warning); }
.fin-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 600; margin-bottom: 10px; }
.fin-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.fin-icon svg { width: 16px; height: 16px; }
.fin-card.income .fin-icon { background: var(--success-light); color: var(--success); }
.fin-card.expense .fin-icon { background: var(--danger-light); color: var(--danger); }
.fin-card.orderamt .fin-icon { background: var(--primary-light); color: var(--primary); }
.fin-card.receivable .fin-icon { background: var(--warning-light); color: var(--warning); }
.fin-card-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.2; }
.fin-card.income .fin-card-val { color: var(--success); }
.fin-card.expense .fin-card-val { color: var(--danger); }
.fin-card.receivable .fin-card-val { color: var(--warning); }
.fin-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ============ 财务总目录 ============ */
.dir-stats { grid-template-columns: repeat(4, 1fr); }
.dir-section { margin-bottom: 26px; }
.dir-section-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px 2px; }
.dir-section-head h3 {
  font-size: 15px; font-weight: 700; color: var(--text); margin: 0;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.dir-section-head h3::before { content: ''; width: 4px; height: 15px; border-radius: 2px; background: var(--primary); }
.dir-section-head.tone-purple h3::before { background: #9333ea; }
.dir-section-head.tone-teal h3::before   { background: #0d9488; }
.dir-section-head.tone-orange h3::before { background: #f97316; }
.dir-section-head p { font-size: 12px; color: var(--text-muted); margin: 0; }
.dir-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dir-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 17px 18px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  outline: none;
}
.dir-card:hover, .dir-card:focus-visible {
  transform: translateY(-2px); border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37,99,235,.14);
}
.dir-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.dir-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.dir-icon svg { width: 20px; height: 20px; }
.dir-icon.primary { background: var(--primary-light); color: var(--primary); }
.dir-icon.success { background: var(--success-light); color: var(--success); }
.dir-icon.danger  { background: var(--danger-light);  color: var(--danger); }
.dir-icon.warning { background: var(--warning-light); color: var(--warning); }
.dir-icon.info    { background: #e0f2fe; color: #0284c7; }
.dir-icon.purple  { background: #f3e8ff; color: #9333ea; }
.dir-arrow { color: var(--text-muted); display: inline-flex; }
.dir-arrow svg { width: 16px; height: 16px; }
.dir-card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.dir-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; min-height: 36px; }
.dir-card-stat { margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--border); display: flex; align-items: baseline; gap: 8px; }
.dir-card-stat strong { font-size: 18px; color: var(--text); }
.dir-card-stat span { font-size: 11px; color: var(--text-muted); }
.dir-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.dir-card-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.dir-chip {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 11px; padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: var(--transition);
}
.dir-chip:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
/* 应收 / 应付重点卡片：子项入口与待收待付放大突出 */
.dir-card-emphasis .dir-chip, .dir-chip-lg { font-size: 14px; font-weight: 600; padding: 7px 15px; }
.dir-card-emphasis .dir-card-sub { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-top: 6px; }
.fin-card-val.stat-highlight { font-size: 32px; }
@media (max-width: 1100px) {
  .dir-stats { grid-template-columns: repeat(2, 1fr); }
  .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.finance-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fin-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 8px; }
.fin-tab { padding: 7px 16px; border: none; background: transparent; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.fin-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.fin-actions { display: flex; gap: 10px; }
.fin-type-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.fin-type-badge.income { background: var(--success-light); color: var(--success); }
.fin-type-badge.expense { background: var(--danger-light); color: var(--danger); }
.fin-type-toggle { display: flex; gap: 10px; }
.fin-type-toggle label { flex: 1; padding: 12px; text-align: center; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; transition: var(--transition); }
.fin-type-toggle label.income { border-color: var(--success); background: var(--success-light); color: var(--success); }
.fin-type-toggle label.expense { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }
.fin-type-toggle input { display: none; }

/* ============ 订单核价 ============ */
.pricing-table { min-width: 1100px; }
.pricing-order-head { background: var(--primary-light); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.pricing-total { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 16px; background: linear-gradient(135deg, var(--primary-light), #eef2ff); border-radius: 10px; border: 1px solid var(--primary); }
.pricing-total span { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.pricing-total strong { font-size: 24px; font-weight: 800; color: var(--primary); }
.panel-header-count { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg); padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.pricing-status-badge { padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pricing-status-badge.priced { background: var(--success-light); color: var(--success); }
.pricing-status-badge.pending { background: var(--warning-light); color: var(--warning); }
.pricing-order-list .order-option-list { max-height: 620px; }
.pricing-selfbuy-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--warning-light); color: var(--warning); }
.pricing-selfbuy-hint { font-size: 11px; font-weight: 600; color: var(--warning); }
.pricing-formula-hint { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 20px; font-size: 10px; font-weight: 700; background: var(--primary-light); color: var(--primary); cursor: help; }
.pricing-cost-disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
.remark-special-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--danger-light); color: var(--danger); font-weight: 700; }
/* 备注特殊规则提示横幅（此单作废 / 仅出版未印刷） */
.pricing-rule-note { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--warning); border-radius: var(--radius); background: var(--warning-light); color: var(--warning); font-size: 13px; font-weight: 600; }
.pricing-rule-note svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* 核价表：左侧信息 + 右侧费用列上下对齐 */
.pricing-sheet { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
/* 核价表全表统一 6 列网格：列1-5 信息/参数区(弹性，列4稍宽给用纸尺寸) + 列6 费用列168px固定；
   所有行(含纸张/覆膜/模切)共用同一套列宽，字段按列上下对齐 */
.ps-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.9fr) 168px; }
.pricing-cost-auto { background: var(--primary-light); color: var(--primary); cursor: default; }
.ps-head { background: linear-gradient(135deg, var(--primary), #4338ca); }
.ps-head .ps-cell { border-top: none; padding: 10px 14px; }
.ps-head span { color: #fff; font-size: 12px; font-weight: 700; }
.ps-head .ps-fee { background: rgba(0, 0, 0, .12); text-align: center; }
.ps-cell { padding: 9px 14px; border-top: 1px solid var(--border); min-height: 60px; display: flex; flex-direction: column; justify-content: center; }
.ps-fee { border-left: 1px solid var(--border); background: #f8faff; }
.ps-cell label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; font-weight: 600; }
.ps-val { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.ps-input { padding: 6px 9px !important; font-size: 13px !important; height: auto !important; }
.ps-fee .form-control { font-weight: 700; color: var(--primary); }
.ps-total-row { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 14px; padding: 14px 18px; background: linear-gradient(135deg, var(--primary-light), #eef2ff); border: 1px solid var(--primary); border-radius: 10px; }
.ps-total-row .ps-total-label { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.ps-total-row strong { font-size: 26px; font-weight: 800; color: var(--primary); }
@media (max-width: 900px) { .ps-grid { grid-template-columns: 1fr 1fr; } .ps-fee { border-left: none; } }

/* ============ 核价记录详情 ============ */
.detail-section-title { font-size: 13px; color: var(--text-secondary); font-weight: 700; margin: 18px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-section-title:first-child { margin-top: 0; }

/* ============ 客户对账单 ============ */
.stmt-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stmt-filters label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.stmt-filters .filter-select { min-width: 180px; }
.stmt-filters input[type="month"] { width: 160px; }
.stmt-quick-range { display: flex; gap: 4px; }
.stmt-quick-btn { padding: 6px 12px !important; font-size: 12px !important; }
.stmt-quick-btn.active { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.stmt-head { display: flex; gap: 40px; flex-wrap: wrap; padding: 4px 2px 18px; }
.stmt-head > div { display: flex; flex-direction: column; gap: 4px; }
.stmt-head-label { font-size: 11px; color: var(--text-muted); }
.stmt-head-val { font-size: 16px; font-weight: 700; color: var(--text); }
.stmt-table { min-width: 1400px; }
.stmt-summary { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.stmt-summary > div { flex: 1; min-width: 180px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.stmt-summary span { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.stmt-summary strong { font-size: 20px; font-weight: 800; color: var(--text); }

/* 对账单打印（A4 横向） */
.print-doc { max-width: none; padding: 0; color: #111; font-size: 11pt; }
.print-title { text-align: center; font-size: 20pt; margin: 0 0 18px; letter-spacing: 4px; }
.print-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; font-size: 11pt; }
.print-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.print-table th, .print-table td { border: 1px solid #333; padding: 6px 5px; text-align: center; }
.print-table thead th { background: #eef2ff; font-weight: 700; }
.print-table tfoot td { font-weight: 700; background: #f5f5f5; }
.print-total-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 16px; border: 2px solid #333; font-size: 11pt; }
.ptb-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 6px; }
.ptb-item:not(:last-child) { border-right: 1px solid #999; }
.ptb-item span { font-weight: 700; white-space: nowrap; }
.ptb-item strong { color: #1a1a1a; font-size: 13pt; font-weight: 800; }
.ptb-item .ptb-orange { color: #b45309; }
.ptb-item .ptb-green { color: #15803d; }
.ptb-item.ptb-grand { background: #fff2cc; }
.ptb-item.ptb-grand span, .ptb-item.ptb-grand strong { font-size: 15pt; }
@media print {
  .print-table { font-size: 8pt; }
}

/* ============ 财务扩展：应收/应付/凭证/报表 ============ */
.fin-card.warning::before { background: var(--warning); }
.fin-card.warning .fin-icon { background: var(--warning-light); color: var(--warning); }
.fin-card.warning .fin-card-val { color: var(--warning); }

/* 回款/付款进度条 */
.ar-progress { display: inline-block; width: 90px; height: 7px; background: var(--bg); border-radius: 20px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.ar-progress-bar { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); border-radius: 20px; transition: width .3s; }

/* 凭证类型徽章 */
.vch-type-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--primary-light); color: var(--primary); }
.vch-type-badge.收款, .vch-type-badge.转账 { background: var(--success-light); color: var(--success); }
.vch-type-badge.付款 { background: var(--danger-light); color: var(--danger); }
.vch-type-badge.调整 { background: var(--warning-light); color: var(--warning); }
/* 凭证行右键菜单 */
.ctx-menu { position: fixed; z-index: 9999; min-width: 168px; display: none; background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.16); }
.ctx-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: none; background: transparent; color: var(--text); font-size: 13px; text-align: left; border-radius: 6px; cursor: pointer; }
.ctx-menu button svg { width: 15px; height: 15px; }
.ctx-menu button:hover { background: var(--bg); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger-light); }

/* 明细查询工具栏 */
.finance-detail-toolbar { align-items: flex-start; }
.finance-detail-toolbar .stmt-filters { gap: 12px; }
.finance-detail-toolbar .stmt-filters label { font-size: 12px; }
.finance-detail-toolbar input[type="date"] { width: 150px; }

/* 账务报表（科目 × 月份矩阵 / 日报月报） */
.fin-report-caption { font-size: 14px; font-weight: 700; color: var(--text); padding: 2px 2px 14px; }
.fin-report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fin-report-table th, .fin-report-table td { border: 1px solid var(--border); padding: 8px 10px; white-space: nowrap; }
.fin-report-table thead th { background: var(--bg); color: var(--text-secondary); font-weight: 700; text-align: left; }
.fin-report-table tbody tr:hover { background: var(--bg); }
.fin-report-table tfoot td { border-top: 2px solid var(--border); }
.print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-table th, .print-table td { border: 1px solid #999; padding: 5px 7px; text-align: left; }
.print-table thead th { background: #f2f2f2; }

/* ============ Excel 网格录入表单（xgrid） ============ */
.xgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.xgrid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xgrid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.xg-cell {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.xg-label {
  display: flex; align-items: center; gap: 4px;
  min-height: 28px;
  padding: 5px 9px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden;
}
.xg-label .required { color: var(--danger); }
.xg-hint { margin-left: auto; font-size: 10px; font-weight: 500; color: var(--primary); white-space: normal; }
.xg-field {
  flex: 1; min-height: 44px;
  display: flex; align-items: center;
  padding: 5px 7px;
  min-width: 0;
}
.xg-field > * { min-width: 0; width: 100%; }
.xg-field .form-control {
  border-color: transparent; background: transparent;
  box-shadow: none; padding: 6px 4px;
}
.xg-field .form-control:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.xg-field textarea.form-control { min-height: 56px; resize: vertical; }
.xg-field .readonly-box {
  border: none; background: transparent; padding: 6px 4px;
  min-height: auto; font-size: 13px;
}
.xg-field .combo { width: 100%; }
.xg-field .combo-list { z-index: 60; }
.xg-field .docno-input-row { display: flex; gap: 6px; }
.xg-cell.xg-span2 { grid-column: span 2; }
.xg-cell.xg-span3 { grid-column: span 3; }
.xg-cell.xg-span4 { grid-column: span 4; }
@media (max-width: 720px) {
  .xgrid, .xgrid.cols-3, .xgrid.cols-4 { grid-template-columns: 1fr; }
  .xg-cell.xg-span2, .xg-cell.xg-span3, .xg-cell.xg-span4 { grid-column: span 1; }
}

/* ---------- 表头点击筛选 ---------- */
.col-filter-th { cursor: pointer; user-select: none; white-space: nowrap; }
.col-filter-th:hover { color: var(--primary); }
.col-filter-th .col-filter-caret { margin-left: 4px; font-size: 10px; opacity: .6; }
.col-filter-th.col-filter-active { color: var(--primary); font-weight: 800; }
.col-filter-menu {
  position: fixed; z-index: 10000; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px;
  max-height: 320px; overflow-y: auto; font-size: 13px;
}
.cfm-head { padding: 6px 8px; font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.cfm-opt { padding: 7px 9px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.cfm-opt:hover { background: var(--bg); }
.cfm-opt.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* ---------- 报工扫码（微信扫一扫式实时识别） ---------- */
.scan-stage { position: relative; width: 100%; height: 300px; background: #111; border-radius: 10px; overflow: hidden; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-stage.scan-stage-off video { opacity: .25; }
.scan-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 220px; height: 220px; pointer-events: none; }
.scan-frame::before { content: ''; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.5); box-shadow: 0 0 0 9999px rgba(0,0,0,.32); }
.scan-frame i { position: absolute; width: 22px; height: 22px; border: 3px solid #44B36E; }
.scan-frame i:nth-child(1) { left: -1px; top: -1px; border-right: none; border-bottom: none; }
.scan-frame i:nth-child(2) { right: -1px; top: -1px; border-left: none; border-bottom: none; }
.scan-frame i:nth-child(3) { left: -1px; bottom: -1px; border-right: none; border-top: none; }
.scan-frame i:nth-child(4) { right: -1px; bottom: -1px; border-left: none; border-top: none; }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-size: 12px; text-shadow: 0 1px 4px #000; padding: 0 12px; }
.scan-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.scan-manual { display: flex; gap: 8px; margin-top: 12px; }
.scan-manual .form-control { flex: 1; }


/* ============ 订单表格：紧凑行高 + 斑马纹 + 清晰字重 ============ */
/* 行高较原来减少约 2mm：上下内边距 13px -> 9px（合计 -8px ≈ -2.1mm） */
.orders-table tbody td { padding: 9px 14px; font-weight: 600; }
/* 副文本保持常规字重，形成主次层次 */
.orders-table tbody td .cell-sub { font-weight: 400; }
/* 斑马纹：奇偶行交错，颜色明显但柔和 */
.orders-table tbody tr:nth-child(odd) { background: #ffffff; }
.orders-table tbody tr:nth-child(even) { background: #e5ecf8; }
/* 悬停高亮保持在斑马纹之上 */
.orders-table tbody tr.order-row:hover { background: var(--primary-light); }


/* ============ 待印刷表：按客户分行着色（颜色加重、相邻客户色相区分明显） ============ */
.orders-table tbody tr.cust-c0 { background: #d9e6ff; }
.orders-table tbody tr.cust-c1 { background: #ffe3bd; }
.orders-table tbody tr.cust-c2 { background: #d3f0dd; }
.orders-table tbody tr.cust-c3 { background: #e7d9ff; }
.orders-table tbody tr.cust-c4 { background: #ffd8d8; }
.orders-table tbody tr.cust-c5 { background: #d0f0f5; }
.orders-table tbody tr.cust-c6 { background: #f4e9b8; }
.orders-table tbody tr.cust-c7 { background: #dfe4ed; }
/* 悬停高亮优先级最高，覆盖客户底色 */
.orders-table tbody tr[class*="cust-c"]:hover { background: var(--primary-light) !important; }

/* ============ 订单管理：订单状态已完工整行标红 ============ */
.orders-table tbody tr.order-done,
.orders-table tbody tr.order-done td { background: #ffe0e0 !important; }
.orders-table tbody tr.order-done td { font-weight: 700; }
.orders-table tbody tr.order-done td,
.orders-table tbody tr.order-done td .cell-sub,
.orders-table tbody tr.order-done td .cell-mono { color: #b71c1c !important; }
.orders-table tbody tr.order-done:hover,
.orders-table tbody tr.order-done:hover td { background: #ffcaca !important; }


/* ============ 表格：悬浮横向滑块 + 拖动表头调列宽 ============ */
.table-wrap.enhanced-scroll { scrollbar-width: none; }
.table-wrap.enhanced-scroll::-webkit-scrollbar { display: none; }
.table-scroll-rail {
  position: sticky; bottom: 6px; height: 14px; margin: 6px 0 4px;
  border-radius: 7px; background: rgba(148,163,184,.3);
  border: 1px solid rgba(148,163,184,.4);
  box-shadow: 0 2px 8px rgba(0,0,0,.08), inset 0 1px 2px rgba(0,0,0,.06);
  z-index: 20; touch-action: none;
}
/* 表格上方那条：静态贴在表头之上，进入视图即可见 */
.table-scroll-rail.rail-top { position: relative; bottom: auto; margin: 0 0 8px; }
.table-scroll-rail.hidden { display: none; }
.table-scroll-thumb {
  position: absolute; top: 1px; bottom: 1px; left: 0; min-width: 36px;
  border-radius: 7px; background: rgba(59,130,246,.62);
  box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: grab; touch-action: none;
}
.table-scroll-thumb:active { cursor: grabbing; background: rgba(59,130,246,.72); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
.table-wrap th { position: relative; }
.col-resizer {
  position: absolute; right: -3px; top: 0; bottom: 0; width: 7px;
  cursor: col-resize; z-index: 3; touch-action: none;
}
.col-resizer::after {
  content: ''; position: absolute; left: 3px; top: 22%; bottom: 22%; width: 2px;
  border-radius: 1px; background: transparent;
}
.col-resizer:hover::after { background: var(--primary); }
/* 列宽可拖动：单元格文字强制单行（覆盖备注列的 white-space:normal），超出显示省略号，行高不再因折行跳动 */
.table-wrap.enhanced-scroll td { white-space: nowrap !important; max-width: none !important; overflow: hidden; text-overflow: ellipsis; }
.table-wrap.enhanced-scroll th { white-space: nowrap !important; }
@media print { .table-scroll-rail, .col-resizer { display: none !important; } }
/* 打印时恢复换行，保证长文本完整输出，不因屏幕上的单行省略而截断 */
@media print { .table-wrap.enhanced-scroll td { white-space: normal !important; overflow: visible; text-overflow: clip; } }


/* ============ 订单备注列：红色加粗，醒目提示 ============ */
.orders-table tbody td.remark-cell { color: var(--danger); font-weight: 800; }
.orders-table tbody td.remark-cell .cell-sub { color: var(--danger); font-weight: 800; }
/* 报工表 / 核价表同步订单备注：红色加粗 */
td .remark-cell { color: var(--danger); font-weight: 800; }


/* ============ 订单备注条：核价页 / 报工录入页同步订单备注（红色加粗） ============ */
.pricing-order-remark, .report-order-remark { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-size: 13px; }
.pricing-order-remark .por-label, .report-order-remark .por-label { flex: 0 0 auto; color: var(--text-secondary); font-weight: 700; }
.pricing-order-remark .por-text, .report-order-remark .por-text { color: var(--text-muted); }
.pricing-order-remark .por-text .remark-cell, .report-order-remark .por-text .remark-cell { color: var(--danger); font-weight: 800; }
.report-order-remark { margin: 12px 0 0; }

/* ============ 来切纸确认：状态筛选与纸到位行 ============ */
.paper-status-tabs { display: flex; gap: 6px; align-self: center; }
.paper-tab { padding: 7px 14px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all .15s; }
.paper-tab:hover { color: var(--primary); border-color: var(--primary); }
.paper-tab.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.orders-table tbody tr.paper-ready-row { background: var(--success-light); }
.orders-table tbody tr.paper-ready-row td { color: var(--text); }

/* ============ 来切纸确认表：字体加粗放大一号 + 斑马纹更明显 ============ */
/* 正文 13px→14px，表头 12px→13px，字重整体加粗 */
.paper-confirm-table thead th { font-size: 13px; font-weight: 800; padding: 12px 14px; }
.paper-confirm-table tbody td { font-size: 14px; font-weight: 700; padding: 10px 14px; }
.paper-confirm-table tbody td .cell-sub { font-size: 13px; font-weight: 500; }
/* 斑马纹加深：奇数行纯白，偶数行由 #e5ecf8 改为更明显的 #d3e0f4 */
.paper-confirm-table tbody tr:nth-child(odd) { background: #ffffff; }
.paper-confirm-table tbody tr:nth-child(even) { background: #d3e0f4; }
/* 已到位行的绿色标记优先于斑马纹，保持醒目 */
.paper-confirm-table tbody tr.paper-ready-row,
.paper-confirm-table tbody tr.paper-ready-row td { background: var(--success-light) !important; }
/* 悬停高亮优先级最高，盖过斑马纹与已到位绿色（写在最后） */
.paper-confirm-table tbody tr.order-row:hover,
.paper-confirm-table tbody tr.order-row:hover td { background: var(--primary-light) !important; }

/* ============ 订单管理：纸已到位的订单号红色加粗 ============ */
.orders-table tbody tr.order-row td.paper-ready-no,
.orders-table tbody tr.order-row td.paper-ready-no .cell-mono { color: var(--danger) !important; font-weight: 800; }

/* ============ 机长统计（印刷/覆膜/模切子菜单）：订单数链接与合计行 ============ */
.chief-stats-table th, .chief-stats-table td { white-space: nowrap; }
.chief-stats-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); background: var(--bg); }
.chief-stats-link { padding: 0; border: 0; background: none; color: var(--primary); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }
.chief-stats-link:hover { text-decoration: underline; }

/* ============ 机长统计：日期 / 机长 / 班次 工具条 ============ */
.chief-stats-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.chief-stats-toolbar-tip { font-size: 12px; color: var(--text-muted); }
.chief-stats-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ============ 页面内标题已移除：仅保留操作按钮时靠右显示 ============ */
#content .page-header.page-actions-only { justify-content: flex-end; margin-bottom: 12px; }

/* ============ 统一财务工作台 ============ */
.fs-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.fs-section { margin-bottom: 22px; }
.fs-section:last-child { margin-bottom: 4px; }
.fs-section-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px 2px; }
.fs-section-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.fs-section-head h3::before { content: ''; display: inline-block; width: 4px; height: 15px; border-radius: 2px; background: var(--primary); margin-right: 9px; vertical-align: -2px; }
.fs-section-head p { margin: 0; font-size: 12px; color: var(--text-muted); }
.fs-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fs-quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.fs-quick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; text-align: left; font-family: inherit; transition: transform .15s, box-shadow .15s; }
.fs-quick-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.fs-quick-item strong { font-size: 13px; color: var(--text); }
.fs-quick-item small { font-size: 11px; color: var(--text-muted); }
.fs-quick-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.fs-quick-icon svg { width: 17px; height: 17px; }
.fs-quick-icon.ok { background: var(--success-light); color: var(--success); }
.fs-quick-icon.bad { background: var(--danger-light); color: var(--danger); }
.fs-quick-icon.warn { background: var(--warning-light); color: var(--warning); }
.fs-quick-icon.info { background: #e0f2fe; color: #0284c7; }
.fs-quick-icon.pri { background: var(--primary-light); color: var(--primary); }
.fs-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.fs-filter .form-control { width: auto; min-width: 130px; }
.fs-filter .search-box { flex: 1; min-width: 180px; max-width: 320px; }
.fs-sumline { padding: 10px 16px; font-size: 13px; color: var(--text-secondary); background: var(--surface); border-bottom: 1px solid var(--border); }
.fs-sumline b { color: var(--text); }
.fs-note { padding: 10px 14px; font-size: 12px; color: var(--text-muted); }
.btn.btn-xs { padding: 3px 9px; font-size: 12px; line-height: 1.4; }
@media (max-width: 1100px) {
  .fs-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fs-two { grid-template-columns: minmax(0, 1fr); }
}

/* ============ 财务中心 v2（单据驱动） ============ */
.fin-page { display: flex; flex-direction: column; gap: 14px; }
.fin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fin-head h2 { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.fin-head p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.fin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger-ghost { color: var(--danger); border-color: rgba(220,38,38,.35); }
.btn.danger-ghost:hover { background: var(--danger-light); }

.fin-body { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 14px; align-items: start; }
.fin-rail { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); position: sticky; top: 10px; }
.fin-rail-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; transition: var(--transition); font-family: inherit; }
.fin-rail-item svg { width: 16px; height: 16px; opacity: .7; }
.fin-rail-item:hover { background: var(--bg); }
.fin-rail-item.active { background: var(--primary-light); color: var(--primary-dark); }
.fin-rail-item.active svg { opacity: 1; }
.fin-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.fin-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); }
.fin-period-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.fin-chips { display: flex; gap: 6px; }
.fin-chip { border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary); font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-family: inherit; transition: var(--transition); }
.fin-chip:hover { border-color: var(--primary); color: var(--primary); }
.fin-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fin-period-dates { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.fin-period-dates .form-control { padding: 5px 8px; font-size: 12px; width: auto; }
.fin-period-range { margin-left: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.fin-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.fin-kpi { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); }
.fin-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.fin-kpi span { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 700; }
.fin-kpi strong { display: block; font-size: 23px; font-weight: 800; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.fin-kpi small { font-size: 11px; color: var(--text-muted); }
.fin-kpi:nth-child(2) { border-left-color: var(--warning); }
.fin-kpi:nth-child(2) strong { color: var(--warning); }
.fin-kpi:nth-child(3) { border-left-color: var(--danger); }
.fin-kpi:nth-child(3) strong { color: var(--danger); }
.fin-kpi.net.ok { border-left-color: var(--success); }
.fin-kpi.net.ok strong { color: var(--success); }
.fin-kpi.net.bad { border-left-color: var(--danger); }
.fin-kpi.net.bad strong { color: var(--danger); }

.fin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fin-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.fin-box-head { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fin-box-head h3 { font-size: 14px; font-weight: 800; }
.fin-box-head p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.fin-box-body { padding: 12px 16px; flex: 1; min-width: 0; }
.fin-box-body .table-wrap { margin: 0; }
.fin-box-body .empty-state { padding: 24px 8px; }

.fin-bars { display: flex; align-items: flex-end; gap: 10px; height: 186px; padding-top: 6px; }
.fin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.fin-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.fin-bar { width: 38%; border-radius: 4px 4px 0 0; min-height: 3px; }
.fin-bar.income { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.fin-bar.expense { background: linear-gradient(180deg, #fdba74, #ea580c); }
.fin-bar-col b { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.fin-bar-col i { font-style: normal; font-size: 11px; font-weight: 700; }
.fin-bar-col i.ok { color: var(--success); }
.fin-bar-col i.bad { color: var(--danger); }

.fin-account-list { display: flex; flex-direction: column; gap: 6px; }
.fin-account { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.fin-account span { font-size: 13px; font-weight: 700; }
.fin-account small { grid-column: 1; font-size: 11px; color: var(--text-muted); }
.fin-account b { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-account.total { background: var(--primary-light); }

.fin-statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.fin-statline > div { display: flex; flex-direction: column; gap: 3px; }
.fin-statline span { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.fin-statline b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-statline b.hint { font-size: 12px; font-weight: 600; color: var(--text-muted); padding-top: 4px; }

.fin-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); }
.fin-toolbar .search-box { flex: 1; min-width: 200px; }
.fin-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fin-cat-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--text-secondary); }
.fin-cat-chip b { color: var(--danger); margin-left: 4px; }
.fin-note { margin-top: 8px; font-size: 12px; color: var(--text-muted); background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.fin-total-row { background: var(--primary-light); font-weight: 800; }
.ok-strong { color: var(--success); font-weight: 700; }
.bad-strong { color: var(--danger); font-weight: 700; }
.warn-strong { color: var(--warning); font-weight: 700; }
.click-cell { cursor: pointer; }
.click-cell:hover { color: var(--primary); text-decoration: underline; }
.click-row { cursor: pointer; }
.click-row:hover td { background: var(--primary-light); }

@media (max-width: 1200px) {
  .fin-grid-2 { grid-template-columns: 1fr; }
  .fin-body { grid-template-columns: 1fr; }
  .fin-rail { flex-direction: row; flex-wrap: wrap; position: static; }
  .fin-rail-item { padding: 7px 10px; }
}
