:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
  --hongyu-accent: #3d7bfd;
  --hongyu-accent-text: #2b5ce6;
  --hongyu-accent-action: #2b5ce6;
  --hongyu-accent-soft: #dfe9ff;
  --hongyu-accent-rgb: 61 123 253;
  --ink: #1d1d1f;
  --blue: var(--hongyu-accent-action);
  --blue-deep: #214dc8;
  --accent: var(--hongyu-accent);
  --accent-rgb: var(--hongyu-accent-rgb);
  --success: #147a58;
  --success-soft: #e5f5ed;
  --warning: #9a6207;
  --warning-soft: #fff3d9;
  --danger: #bf3c37;
  --danger-soft: #fce8e7;
  --disabled: #646b78;
  --disabled-soft: #eceef2;
  --focus: rgb(var(--hongyu-accent-rgb) / 52%);
  /* 图表系列色：蓝、紫、青、橙、玫红、绿（2026-10-27 由偏暗的深青系调亮）。 */
  --chart-1: #3f6ff5;
  --chart-2: #7e6ce6;
  --chart-3: #2ea3b5;
  --chart-4: #e0952c;
  --chart-5: #c9638a;
  --chart-6: #5c9f72;
  --chart-text: #26354a;
  --chart-muted: #7a8699;
  --chart-axis: rgb(22 34 64 / 16%);
  --chart-grid: rgb(22 34 64 / 7%);
  --chart-line: rgb(86 111 127 / 20%);
  --chart-tooltip: rgb(255 255 255 / 96%);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --panel-gap: 12px;
  --panel-header-height: 56px;
  --ease-organic: cubic-bezier(.16, 1, .3, 1);
  --canvas: #f5f7fb;
  --canvas-secondary: #edf3fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-hover: #f2f6fd;
  --glass: rgb(255 255 255 / 78%);
  --glass-strong: rgb(255 255 255 / 92%);
  --muted: #69758a;
  --shadow: 0 18px 52px rgb(27 43 75 / 9%);
  --control-height: 36px;
  --control-radius: 8px;
  --panel-radius: 12px;
  --surface-padding: 16px;
  --line: rgb(40 57 87 / 9%);
  --line-strong: rgb(40 57 87 / 18%);
  --text: #202735;
  --text-secondary: #465166;
  --text-soft: #707b8b;
  --surface-soft: #f7f9fc;
  --soft-shadow: 0 2px 8px rgb(28 47 78 / 3%);
  --reorder-radius: 12px;
  --reorder-border: var(--accent);
  --reorder-shadow: 0 18px 40px rgb(20 37 70 / 24%), 0 0 0 3px rgb(var(--hongyu-accent-rgb) / 18%);
  /* 2026-10-26 颜色统一：页面样式只引用以下变量，直写颜色只允许出现在变量定义中。 */
  --text-faint: #9aa3b2;
  --font-metric: 24px;
  --on-accent: #ffffff;
  --surface-rgb: 255 255 255;
  --shadow-rgb: 31 47 78;
  --scrim: rgb(27 35 50 / 25%);
  --scrollbar: rgb(105 127 160 / 30%);
  --scrollbar-strong: rgb(102 119 147 / 55%);
  --info: #175cd3;
  --info-soft: #eaf2ff;
  --info-line: #7db9ff;
  --success-line: #8fd9bf;
  --warning-line: rgb(245 158 11 / 25%);
  --danger-rgb: 191 60 55;
  --danger-line: rgb(202 64 91 / 18%);
  --canvas-glow: radial-gradient(52% 58% at 82% 4%, rgb(61 123 253 / 10%), transparent 72%),
    radial-gradient(44% 46% at 12% 96%, rgb(86 169 255 / 8%), transparent 78%),
    linear-gradient(145deg, #f9fbff, var(--canvas-secondary) 58%, #f7f8f5);
  /* 排程甘特条：数据图形专用配色。 */
  --gantt-order: #5267d8; --gantt-order-line: #3448b9;
  --gantt-work-order: #7188a2; --gantt-work-order-line: #536d89;
  --gantt-pending: #ffdfad; --gantt-pending-line: #f79009; --gantt-pending-text: #6d3a00;
  --gantt-progress: #84caff; --gantt-progress-line: #1570ef; --gantt-progress-text: #073b78;
  --gantt-complete: #75e0a7; --gantt-complete-line: #079455; --gantt-complete-text: #064c37;
  --gantt-text: #17324d;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); color-scheme: light; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background-attachment: fixed;
  transition: color .25s ease, background-color .25s ease;
}
body::before { position: fixed; inset: 0; z-index: -1; content: ""; opacity: .22; }
button, input, select, textarea { min-width: 0; font: inherit; }
b, strong, th, h1, h2, h3, h4 { font-weight: 600; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, .tabulator-row:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; gap: 20px; padding: 16px; }
.sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  padding: 24px 16px;
  overflow: hidden auto;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(var(--surface-rgb) / 68%);
  backdrop-filter: blur(28px) saturate(150%);
}
.brand { display: flex; align-items: baseline; gap: 8px; margin: 2px 12px 32px; color: var(--text); letter-spacing: .04em; }
.brand strong { font-size: 17px; font-weight: 650; }
.brand span { color: var(--blue); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.nav-list { display: grid; gap: 6px; }
.nav-group { padding: 20px 16px 6px; color: var(--text-faint); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.nav-link {
  position: relative;
  width: 100%;
  overflow: hidden;
  color: var(--text-secondary);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-link:hover { color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 7%); }
.nav-link.is-active::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 15%), 0 0 14px rgb(var(--accent-rgb) / 55%);
  transform: translateY(-50%);
  animation: hongyu-nav-arrive 360ms cubic-bezier(.16, 1, .3, 1) both;
}
.workspace { width: 100%; min-width: 0; padding: 20px clamp(18px, 2.4vw, 40px) 64px 6px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin: 4px 0 24px; padding: 8px 6px; }
.topbar-actions { display: flex; align-items: flex-end; gap: 10px; flex: 0 0 auto; }
.topbar h1 { margin: 0; font-size: 23px; line-height: 1.15; letter-spacing: -.035em; }
.panel-head p, .section-intro p { line-height: 1.65; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; line-height: 1.55; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  flex: 0 0 18px;
  border: 1.5px solid var(--text-faint);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
  vertical-align: middle;
}
input[type="checkbox"]:checked { border-color: var(--blue); background: var(--blue); }
input[type="checkbox"]:checked::after {
  display: block;
  width: 4px;
  height: 8px;
  margin: 2px 0 0 6px;
  content: "";
  transform: rotate(45deg);
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
}
input[type="checkbox"]:indeterminate { border-color: var(--blue); background: var(--blue); }
input[type="checkbox"]:indeterminate::after { display: block; width: 9px; height: 2px; margin: 6px auto 0; content: ""; border-radius: 2px; background: var(--on-accent); }
.flash {
  position: fixed;
  inset: 20px auto auto 50%;
  z-index: 160;
  width: max-content;
  max-width: min(580px, calc(100vw - 32px));
  min-height: 44px;
  margin: 0;
  padding: 12px 16px;
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
  box-shadow: 0 16px 42px rgb(var(--shadow-rgb) / 16%);
  font-size: 14px;
  line-height: 1.45;
  backdrop-filter: blur(18px);
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.985);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.16, 1, .3, 1), visibility 0s linear 220ms;
}
.flash.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0) scale(1); transition-delay: 0s; }
.flash.is-leaving { pointer-events: none; }
.flash.error { color: var(--danger); border: 1px solid var(--danger-line); background: var(--danger-soft); }
.flash.success { color: var(--success); border: 1px solid var(--success-line); background: var(--success-soft); }
.flash.info {
  color: var(--hongyu-accent-text);
  border-color: rgb(var(--hongyu-accent-rgb) / 30%);
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--hongyu-accent-soft));
}
.view { display: none; }
.view.is-active { display: block; animation: breathe-in .3s ease both; }
@keyframes breathe-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hongyu-nav-arrive {
  from { opacity: 0; transform: translate(-7px, -50%) scale(.55); }
  to { opacity: 1; transform: translate(0, -50%) scale(1); }
}
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.metric-card, .data-panel { min-width: 0; border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(145%); }
.metric-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px; overflow: hidden; }
.metric-card span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 650; line-height: 1.4; }
.metric-card strong { flex: 0 0 auto; font-size: var(--font-metric); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-card span small { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; }
.data-panel { margin: 16px 0; overflow: hidden; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head > * { min-width: 0; }
.panel-head h2, .section-intro h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.panel-head p, .section-intro p { margin: 8px 0 0; font-size: 13px; }
.panel-head strong, .panel-head p, .panel-head h2 { overflow-wrap: anywhere; }
.table-scroll { width: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.data-table { width: 100%; min-width: 720px; table-layout: auto; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td {
  max-width: 320px;
  padding: 16px 16px;
  overflow-wrap: anywhere;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
}
.data-table th { position: sticky; top: 0; z-index: 1; backdrop-filter: blur(12px); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table td strong { display: block; }
.data-table td small { display: block; margin-top: 1px; }
.data-table .align-number { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .align-date, .data-table .align-status { text-align: center; }
.master-table td:nth-last-child(2) { text-align: center; }
.master-table td:last-child { text-align: right; }
.status-tag {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 6px 10px;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--disabled-soft);
  font-size: 12px;
  min-height: 24px;
  font-weight: 650;
  transition: color 200ms ease, background-color 200ms ease;
}
.status-有效, .status-已完整排期, .status-已完成 { color: var(--success); background: var(--success-soft); }
.status-待处理, .status-待补排, .status-未开始 { color: var(--warning); background: var(--warning-soft); }
.status-进行中 { color: var(--info); background: var(--info-soft); }
.status-已作废 { color: var(--danger); background: var(--danger-soft); }
.primary-button, .secondary-button, .danger-button, .text-button, .add-row, .icon-button {
  min-height: 38px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-button:hover { transform: translateY(-1px); }
.icon-button { width: 38px; padding: 8px; }
.secondary-button:hover, .danger-button:hover, .text-button:hover, .add-row:hover, .icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgb(var(--shadow-rgb) / 10%);
}
.row-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.section-intro { margin: 4px 4px 16px; }
.overview-metrics { margin-top: 12px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 20px; }
.overview-grid .data-panel { height: 100%; margin: 0; }
.business-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px 24px 24px; }
.business-form label, .field-label { display: grid; min-width: 0; gap: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 650; }
.business-form input, .business-form select, .business-form textarea { font-size: 14px; }
.business-form .wide { grid-column: 1 / -1; }
.field-label { margin-bottom: 8px; }
.entry-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(90px, .45fr) minmax(150px, 1fr) 38px; gap: 10px; margin-bottom: 10px; }
.entry-batch-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgb(var(--accent-rgb) / 14%);
  border-radius: 12px;
  background: var(--surface-hover);
}
.entry-batch-tools textarea { min-height: 74px; resize: vertical; }
.entry-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-batch-tools details > summary { color: var(--hongyu-accent-text); font-size: 13px; font-weight: 600; cursor: pointer; }
.entry-batch-tools details[open] { display: grid; gap: 10px; padding-top: 6px; }
.entry-summary { margin: 0; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.entry-summary.has-error { color: var(--danger); }
.business-form .input-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgb(var(--danger-rgb) / 12%); }
.searchable-select { position: relative; min-width: 0; }
.searchable-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0 !important;
}
.searchable-select-input {
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}
.searchable-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  max-height: 232px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgb(var(--accent-rgb) / 22%);
  border-radius: 12px;
}
.searchable-select.is-open .searchable-select-menu { display: grid; gap: 4px; }
.searchable-select-option { width: 100%; padding: 10px 12px; text-align: left; border: 0; border-radius: 8px; background: transparent; font-size: 13px; }
.searchable-select-empty { padding: 10px 12px; color: var(--text-soft); font-size: 13px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.add-row { margin-top: 4px; }
.checkbox-field { display: flex; align-items: center; grid-template-columns: auto 1fr; }
.checkbox-field input { width: 18px; height: 18px; min-height: 18px; box-shadow: none; }
.route-builder { display: grid; gap: 8px; }
.route-selected-head { gap: 8px; min-height: 40px; padding-top: 4px; border-top: 1px solid var(--line); }
.route-selected-head > strong { margin-left: auto; color: var(--muted); font-size: 12px; }
.route-step-list { display: grid; }
.route-step-row { min-height: 46px; }
.route-step-row.is-invalid { border-color: var(--danger-line); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.route-step-sequence {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--hongyu-accent-text);
  border-radius: 8px;
  background: rgb(var(--accent-rgb) / 10%);
  font-size: 12px;
  font-weight: 600;
}
.route-step-copy { display: grid; min-width: 0; gap: 2px; }
.route-step-copy strong { color: var(--text); font-size: 13px; }
.route-step-copy small { color: var(--muted); font-size: 12px; }
.route-step-actions { flex-wrap: wrap; }
.danger-context {
  margin: 24px 24px 0;
  padding: 16px;
  color: var(--danger);
  border: 1px solid var(--danger-line);
  border-radius: 12px;
  background: var(--danger-soft);
}
.danger-context p { margin: 8px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.empty-state { padding: 32px 24px; text-align: center; line-height: 1.6; }
.backup-list { display: grid; }
.backup-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.backup-list > div:last-child { border-bottom: 0; }
.backup-list > div > * { min-width: 0; overflow-wrap: anywhere; }
.drawer-layer { position: fixed; inset: 0; z-index: 100; visibility: hidden; pointer-events: none; }
.drawer-layer.is-open { visibility: visible; pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  transition: opacity .24s ease;
}
.drawer-layer.is-open .drawer-backdrop { opacity: 1; }
.action-drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgb(var(--surface-rgb) / 82%);
  backdrop-filter: blur(32px) saturate(155%);
  transform: translateX(calc(100% + 28px));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.drawer-layer.is-open .action-drawer { transform: translateX(0); }
.drawer-layer[data-action="schedule-task"] .action-drawer { width: min(820px, calc(100vw - 24px)); }
.drawer-layer[data-action="sync-issue"] .action-drawer { width: min(760px, calc(100vw - 24px)); }
.drawer-open { overflow: hidden; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.drawer-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  line-height: 1;
}
.drawer-content { min-height: 0; padding: 4px; overflow: auto; }
.drawer-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px 20px 24px; }
.drawer-hint { margin: 24px 24px 0; padding: 16px 16px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.detail-stack { display: grid; gap: 24px; padding: 24px; }
.detail-stack h3 { margin: 0 0 12px; font-size: 14px; }
.detail-summary {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.detail-summary span { color: var(--text-soft); font-size: 12px; }
.detail-summary strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.count-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.schedule-batch-list { display: grid; gap: 8px; }
.schedule-batch-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(2, minmax(150px, .8fr));
  align-items: end;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(var(--surface-rgb) / 62%);
}
.schedule-batch-row.is-requested { border-color: rgb(var(--accent-rgb) / 34%); box-shadow: inset 3px 0 0 var(--blue); }
.schedule-task-copy { display: grid; min-width: 0; align-self: center; gap: 4px; }
.schedule-task-copy strong, .schedule-task-copy span { overflow-wrap: anywhere; }
.schedule-task-copy strong { color: var(--text); font-size: 13px; }
.schedule-task-copy span { color: var(--text-soft); font-size: 12px; line-height: 1.4; }
.schedule-batch-row label { gap: 6px; font-size: 12px; }
.schedule-batch-row input { min-height: 40px; padding-block: 8px; }
.muted-text { color: var(--text-faint); font-size: 12px; }
.monthly-hours-panel { overflow: hidden; }
.hours-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.hours-month-form { display: flex; align-items: end; gap: 10px; }
.hours-month-form label { display: grid; width: 178px; gap: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.hours-month-form input, .hours-month-form button { min-height: 42px; }
.segmented-switch { max-width: 100%; overflow-x: auto; border-bottom: 1px solid var(--line); }
.segmented-button {
  white-space: nowrap;
  transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}
.segmented-button:hover { color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 6%); }
.hours-matrix-scroll { width: 100%; max-height: 62vh; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.hours-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.hours-matrix th, .hours-matrix td {
  min-width: 84px;
  height: 46px;
  padding: 10px 12px;
  color: var(--text);
  white-space: nowrap;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgb(var(--surface-rgb) / 58%);
  font-size: 13px;
}
.hours-matrix thead th { position: sticky; top: 0; z-index: 3; color: var(--text-soft); text-align: center; background: var(--surface-soft); font-weight: 600; }
.hours-matrix .hours-person {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 150px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-soft);
}
.hours-matrix thead .hours-person { z-index: 5; }
.hours-matrix .hours-total { position: sticky; right: 0; z-index: 2; min-width: 96px; color: var(--info); background: var(--surface-hover); font-weight: 600; }
.hours-matrix thead .hours-total { z-index: 5; }
.hours-matrix tbody tr:hover th, .hours-matrix tbody tr:hover td { background: var(--surface-hover); }
.hours-matrix tfoot th, .hours-matrix tfoot td { position: sticky; bottom: 0; z-index: 3; color: var(--text); background: var(--hongyu-accent-soft); font-weight: 600; }
.hours-matrix tfoot .hours-person { z-index: 5; background: var(--hongyu-accent-soft); }
.hours-matrix tfoot .hours-total { z-index: 5; background: rgb(var(--accent-rgb) / 18%); }
.task-progress-button {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) auto auto;
  align-items: center;
  width: 100%;
  min-height: 38px;
  gap: 8px;
  padding: 6px 8px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
}
.task-progress-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.task-progress-button b { font-variant-numeric: tabular-nums; font-size: 12px; }
.task-progress-button em {
  min-width: 43px;
  padding: 4px 8px;
  text-align: center;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.order-progress-list { display: grid; gap: 16px; }
.work-order-progress { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; }
.work-order-progress > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.work-order-progress > header > div:first-child { display: grid; min-width: 0; gap: 4px; }
.work-order-progress > header span { color: var(--text-soft); font-size: 12px; }
.progress-headline { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.progress-headline span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-headline b { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.progress-headline em { min-width: 44px; padding: 4px 8px; text-align: center; border-radius: 999px; font-size: 12px; font-style: normal; font-weight: 600; }
.task-timeline { display: grid; margin: 0; padding: 6px 16px 12px; list-style: none; }
.task-timeline li { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; min-height: 66px; gap: 12px; }
.task-timeline li:not(:last-child)::after { position: absolute; top: 51px; bottom: -15px; left: 22px; width: 2px; content: ""; background: var(--line-strong); }
.task-timeline li.complete:not(:last-child)::after { background: var(--success-line); }
.task-timeline li.current:not(:last-child)::after { background: linear-gradient(var(--info-line) 0 45%, var(--line-strong) 45%); }
.task-progress-circle {
  position: relative;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 3px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.task-timeline .complete .task-progress-circle { color: var(--success); border-color: var(--success-line); background: var(--success-soft); }
.task-timeline .current .task-progress-circle { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.task-timeline li > div { display: grid; min-width: 0; gap: 4px; }
.task-timeline strong { font-size: 13px; }
.task-timeline small { overflow-wrap: anywhere; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.compact-empty { min-height: 84px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.chart-card { min-width: 0; }
.chart-host { width: 100%; min-height: 270px; padding: 0 10px 10px; }
.chart-summary { margin: 0; padding: 0 20px 20px; font-size: 12px; line-height: 1.7; }
.chart-summary strong { color: var(--text); }
.filter-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px 20px 16px; }
.filter-toolbar label {
  display: grid;
  grid-template-rows: 18px 42px;
  width: 156px;
  min-width: 0;
  flex: 0 0 auto;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}
.filter-toolbar .search-field { width: min(420px, 100%); min-width: 250px; flex: 1 1 300px; }
.filter-toolbar .filter-compact { width: 156px; }
.filter-toolbar input, .filter-toolbar select, .filter-toolbar button { min-height: 42px; font-size: 14px; }
.filter-actions { display: flex; align-items: center; align-self: end; flex: 0 0 auto; gap: 12px; }
.table-host { min-height: 180px; padding: 0 20px 20px; }
.table-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 12px; font-size: 13px; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.schedule-layout.has-tray { grid-template-columns: minmax(0, 1fr) 290px; }
.schedule-board-card { min-width: 0; overflow: hidden; }
.schedule-gantt { width: 100%; border-top: 1px solid var(--line); }
.schedule-gantt[data-scale="month"] .gantt_scale_line + .gantt_scale_line .gantt_scale_cell,
.schedule-gantt[data-scale="day"] .gantt_scale_line:first-child .gantt_scale_cell { cursor: pointer; }
.schedule-gantt[data-scale="month"] .gantt_scale_line + .gantt_scale_line .gantt_scale_cell:hover,
.schedule-gantt[data-scale="day"] .gantt_scale_line:first-child .gantt_scale_cell:hover { color: var(--accent); }
/* macOS 默认隐藏滚动条，按日、周查看时横向滚动条常驻在最后一行下方。 */
.schedule-gantt .gantt_hor_scroll::-webkit-scrollbar { height: 12px; }
.schedule-gantt .gantt_hor_scroll::-webkit-scrollbar-track { background: var(--surface-soft); }
.schedule-gantt .gantt_hor_scroll::-webkit-scrollbar-thumb { border: 2px solid var(--surface-soft); border-radius: 999px; background: var(--scrollbar-strong); }
.schedule-gantt .gantt_hor_scroll::-webkit-scrollbar-thumb:hover { background: rgb(var(--hongyu-accent-rgb) / 72%); }
.schedule-mobile-list { display: none; padding: 12px; }
.schedule-tray { position: sticky; top: 20px; }
.schedule-tray-list { display: grid; gap: 10px; padding: 0 16px 20px; }
.completed-schedule-history { margin-top: 20px; }
.schedule-tray-item { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-tray-item strong, .schedule-tray-item span { overflow-wrap: anywhere; }
.schedule-tray-item span { font-size: 12px; line-height: 1.55; }
.schedule-tray-item button { justify-self: start; }
.schedule-status-key { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.schedule-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.schedule-key::before { width: 18px; height: 7px; border-radius: 2px; content: ""; }
.schedule-key.actual::before { background: var(--info); }
.schedule-key.forecast::before { background: var(--info-soft); box-shadow: inset 0 0 0 1px var(--info-line); }
.schedule-key.due::before { width: 2px; height: 12px; background: var(--text); }
.schedule-key.today::before { width: 2px; height: 12px; background: rgb(var(--danger-rgb) / 45%); }
.schedule-empty { min-height: 360px; display: grid; place-items: center; padding: 32px; text-align: center; }
.gantt_task_line.schedule-parent-order { border-color: var(--gantt-order-line); background: var(--gantt-order); }
.gantt_task_line.schedule-parent-work-order { border-color: var(--gantt-work-order-line); background: var(--gantt-work-order); }
.gantt_task_line.schedule-task-pending { border-color: var(--gantt-pending-line); background: var(--gantt-pending); }
.gantt_task_line.schedule-task-progress { border-color: var(--gantt-progress-line); background: var(--gantt-progress); }
.gantt_task_line.schedule-task-complete { border-color: var(--gantt-complete-line); background: var(--gantt-complete); }
.gantt_task_line.schedule-task-overdue { border: 2px solid var(--danger); box-shadow: 0 0 0 2px rgb(var(--danger-rgb) / 14%); }
.gantt_task_content { color: var(--gantt-text); font-weight: 600; text-shadow: none; }
.gantt_task_line.schedule-parent-order .gantt_task_content, .gantt_task_line.schedule-parent-work-order .gantt_task_content { color: var(--on-accent); }
.gantt_task_line.schedule-task-pending .gantt_task_content { color: var(--gantt-pending-text); }
.gantt_task_line.schedule-task-progress .gantt_task_content { color: var(--gantt-progress-text); }
.gantt_task_line.schedule-task-complete .gantt_task_content { color: var(--gantt-complete-text); }
.schedule-tabs-panel .panel-head { flex-wrap: wrap; gap: 12px; }
/* 计划与执行：汇总行项目名称为主、产品规格灰色小字；时间轴每行一条进度，实际实心、预计浅色。 */
.schedule-filter .segmented-switch { flex: none; }
.schedule-filter .segmented-button { min-height: 34px; white-space: nowrap; }
.schedule-filter .segmented-button span { color: var(--text-soft); }
.schedule-summary-row .gantt_cell, .schedule-summary-row .gantt_tree_content { line-height: normal; }
.schedule-summary-row .gantt_tree_content { display: flex; align-items: center; height: 100%; min-width: 0; }
.schedule-summary-row .gantt_tree_icon { height: 100%; }
.schedule-project { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.schedule-project strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.schedule-project small { overflow: hidden; color: var(--text-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-step-row .gantt_cell { color: var(--text-secondary); }
.schedule-date { font-variant-numeric: tabular-nums; }
.schedule-gantt .gantt_grid_data .record-icon-button { width: 28px; height: 28px; }
.schedule-rest { background: var(--surface-soft); }
.gantt_task_line.compare-hit { border: 0; background: transparent; box-shadow: none; }
.gantt_task_line.compare-hit .gantt_task_progress_wrapper { display: none; }
.compare-bar { position: absolute; border-radius: 2px; pointer-events: none; }
.compare-bar.actual { background: var(--info); }
.compare-bar.forecast { background: var(--info-soft); box-shadow: inset 0 0 0 1px var(--info-line); }
.compare-due { position: absolute; width: 2px; background: var(--text); pointer-events: none; }
.compare-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--disabled-soft); color: var(--text-secondary); font-size: 12px; font-weight: 500; line-height: 1.5; }
.compare-state.is-done { background: var(--success-soft); color: var(--success); }
.compare-state.is-progress { background: var(--info-soft); color: var(--info); }
.compare-state.is-delay { background: var(--danger-soft); color: var(--danger); }
.compare-state.is-warn { background: var(--warning-soft); color: var(--warning); }
/* 误期需要处理，用实心红区别于临近的浅黄。 */
.compare-state.is-alert { background: var(--danger); color: var(--on-accent); }
.compare-today { position: absolute; top: 0; width: 2px; background: rgb(var(--danger-rgb) / 45%); pointer-events: none; }
.schedule-gantt .gantt_tree_content .planning-kind { margin-left: 6px; }
.order-workspace { margin-top: 20px; scroll-margin-top: 18px; }
.subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.subsection-head h3, .subsection-head p { margin: 0; }
.subsection-head p { margin-top: 4px; color: var(--text-soft); font-size: 12px; }
.reporting-entry-panel { max-width: 980px; margin-inline: auto; }
.reporting-entry-panel > .business-form { padding-top: 16px; }
.order-sync-panel { margin-bottom: 20px; overflow: hidden; }
.sync-warning { display: grid; gap: 8px; margin: 0 24px 16px; padding: 16px 16px; border: 1px solid var(--warning-line); border-radius: 12px; }
.sync-warning strong, .sync-warning p { margin: 0; }
.sync-warning p { font-size: 12px; line-height: 1.6; }
.sync-issue-detail { display: grid; gap: 0; }
.sync-comparison { width: calc(100% - 48px); margin: 0 24px 4px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sync-comparison .table-scroll { border: 0; }
.sync-comparison th, .sync-comparison td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.sync-comparison tr:last-child td { border-bottom: 0; }
.order-edit-form { padding: 0 20px 24px; }
#order-edit-line-list { display: grid; gap: 10px; }
.order-field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.order-field-grid label { min-width: 0; }
.order-field-grid > .icon-button { align-self: end; }
.order-field-grid > .danger-button { align-self: end; }
.recovery-warning { margin: 20px; }
.exception-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.exception-list { display: grid; gap: 12px; padding: 0 20px 20px; }
.exception-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.exception-symbol { display: grid; place-items: center; width: 34px; height: 34px; color: var(--warning); border-radius: 12px; background: var(--warning-soft); font-weight: 600; }
.exception-item.danger .exception-symbol { color: var(--danger); background: var(--danger-soft); }
.exception-item.info .exception-symbol { color: var(--info); background: var(--info-soft); }
.exception-copy { display: grid; min-width: 0; gap: 4px; }
.exception-copy strong, .exception-copy span { overflow-wrap: anywhere; }
.exception-copy span { font-size: 12px; line-height: 1.55; }
.manual-line-list { display: grid; gap: 10px; }
.manual-line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.manual-line-row label { min-width: 0; }
.manual-line-row .icon-button { margin-bottom: 2px; }
.project-choice { grid-column: 1 / -1; }
.inline-note { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; }
.audit-diff { width: 100%; border-collapse: collapse; }
.audit-diff th, .audit-diff td { padding: 12px 12px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.audit-diff :is(th, td):first-child { white-space: nowrap; }
.audit-before { color: var(--danger); }
.audit-after { color: var(--success); }
.tabulator { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.tabulator .tabulator-header .tabulator-col { background: transparent; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { display: flex; min-height: 44px; align-items: center; padding: 10px 12px; }
.tabulator .tabulator-header .tabulator-col-title-holder { display: flex; width: 100%; min-width: 0; align-items: center; }
.tabulator .tabulator-header .tabulator-col-title { min-width: 0; overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.35; }
.tabulator .tabulator-header .tabulator-col-sorter { margin-left: 8px; flex: 0 0 auto; }
.tabulator .tabulator-row { min-height: 52px; }
.tabulator .tabulator-cell {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  padding: 6px 12px;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.45;
}
.tabulator .tabulator-cell.cell-number { font-variant-numeric: tabular-nums; }
.compact-cell-action { min-height: 32px; padding: 6px 10px; }
.tabulator .tabulator-cell input[type="checkbox"], .tabulator .tabulator-header input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.tabulator .tabulator-footer .tabulator-footer-contents {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
}
.tabulator .tabulator-footer .tabulator-paginator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  white-space: normal;
}
.tabulator .tabulator-footer .tabulator-page-size {
  width: auto;
  min-width: 72px;
  min-height: 34px;
  margin: 0;
  padding: 6px 28px 6px 10px;
  border-radius: 6px;
  box-shadow: none;
}
.tabulator .tabulator-footer .tabulator-pages { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.tabulator .tabulator-footer .tabulator-page {
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.2;
}
.tabulator .tabulator-footer .tabulator-page.active, .tabulator .tabulator-footer .tabulator-page.active:hover { color: var(--on-accent); }
.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
  padding: 32px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.table-primary { display: grid; gap: 2px; }
.table-primary small { font-size: 12px; line-height: 1.45; }
.order-line-table-host { width: 100%; max-width: 100%; overflow: hidden; }
.order-line-table-host .tabulator-tableholder {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  scrollbar-color: var(--scrollbar-strong) var(--surface-soft);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.order-line-table-host .tabulator-tableholder::-webkit-scrollbar { width: 9px; height: 9px; }
.order-line-table-host .tabulator-tableholder::-webkit-scrollbar-track { background: var(--surface-soft); }
.order-line-table-host .tabulator-tableholder::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface-soft);
  border-radius: 999px;
  background: var(--scrollbar-strong);
}
.order-line-table-host .tabulator-tableholder::-webkit-scrollbar-thumb:hover { background: rgb(var(--hongyu-accent-rgb) / 72%); }
.order-line-table-host .tabulator-row { min-height: 40px; }
.order-line-table-host .tabulator-cell { padding: 6px 10px; white-space: nowrap; overflow-wrap: normal; line-height: 1.3; }
.order-line-table-host .tabulator-header .tabulator-col .tabulator-col-content { min-height: 38px; padding: 8px 10px; }
.order-line-table-host .tabulator-header .tabulator-col-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-column-config { display: grid; }
.order-column-grid { display: grid; }
.order-column-choice {
  display: flex;
  align-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 650;
}
.order-column-choice input { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; box-shadow: none; }
.order-cell-text { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-cell { display: grid; width: 100%; min-width: 0; gap: 1px; }
.project-cell strong { overflow: visible; color: var(--text); text-overflow: clip; white-space: normal; font-size: 13px; font-weight: 600; line-height: 1.3; }
.project-cell small { overflow: visible; color: var(--muted); text-overflow: clip; white-space: normal; font-size: 12px; line-height: 1.3; }
.order-number-button {
  min-height: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.order-number-button:hover { color: var(--blue); text-decoration: underline; }
.order-progress-compact {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: var(--text-secondary);
  border-color: var(--line);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.order-progress-compact em { color: var(--muted); font-size: 12px; font-style: normal; }
.hongyu-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.hongyu-glow-surface { isolation: isolate; }
.hongyu-glow-surface::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  padding: 1.8px;
  content: "";
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--hongyu-accent-rgb) / 82%), rgb(var(--hongyu-accent-rgb) / 34%) 46%, rgb(var(--hongyu-accent-rgb) / 8%) 72%, transparent 88%);
  filter: drop-shadow(0 0 5px rgb(var(--hongyu-accent-rgb) / 20%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transition: opacity 260ms ease;
}
.hongyu-glow-surface > * { position: relative; z-index: 1; }
.hongyu-glow-surface:focus-within::before { opacity: .72; }
@media (hover: hover) and (pointer: fine) {
  .hongyu-glow-surface:hover::before { opacity: 1; }
}
.topbar h1, .panel-head h2, .section-intro h2 { color: var(--text); }
.panel-head p, .section-intro p, .chart-summary, .table-meta { color: var(--muted); }
input, select, textarea {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: inset 0 1px 1px rgb(var(--surface-rgb) / 48%), 0 3px 10px rgb(var(--shadow-rgb) / 4%);
}
input:hover, select:hover, textarea:hover { border-color: rgb(var(--accent-rgb) / 38%); background: var(--surface-raised); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 12%);
}
input:disabled, select:disabled, textarea:disabled { color: var(--text-soft); background: var(--surface-soft); }
input::placeholder, textarea::placeholder { color: var(--text-soft); }
.metric-card, .data-panel {
  border-color: var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgb(var(--surface-rgb) / 58%);
}
.metric-card { min-height: 76px; }
.metric-card span, .metric-card span small { color: var(--muted); }
.metric-card strong { color: var(--text); }
.panel-head, .backup-list > div, .work-order-progress > header { border-color: var(--line); }
.primary-button { color: var(--on-accent); background: var(--hongyu-accent-action); box-shadow: 0 6px 16px rgb(var(--hongyu-accent-rgb) / 22%); }
.primary-button:hover { background: color-mix(in srgb, var(--hongyu-accent-action) 88%, var(--ink)); box-shadow: 0 9px 20px rgb(var(--hongyu-accent-rgb) / 25%); }
.secondary-button { color: var(--hongyu-accent-text); border-color: rgb(var(--hongyu-accent-rgb) / 24%); background: rgb(var(--hongyu-accent-rgb) / 6%); }
.text-button, .add-row { color: var(--hongyu-accent-text); background: transparent; }
.danger-button { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.icon-button { color: var(--danger); background: var(--danger-soft); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled, .text-button:disabled, .add-row:disabled, .icon-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
.route-step-row, .schedule-tray-item, .exception-item, .manual-line-row, .work-order-progress, .detail-summary {
  color: var(--text-secondary);
  border-color: var(--line);
  background: var(--surface-soft);
}
.work-order-progress > header strong, .task-timeline strong, .detail-summary strong, .table-primary strong { color: var(--text-secondary); }
.data-table th { background: var(--surface-soft); }
.data-table th, .data-table td { border-color: var(--line); }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table td strong { color: var(--text-secondary); }
.data-table td small, .empty-state, .schedule-tray-item span, .exception-copy span, .inline-note, .table-primary small, .sync-warning p { color: var(--muted); }
.sync-warning { border-color: var(--warning-line); background: color-mix(in srgb, var(--warning-soft) 68%, var(--surface)); }
.sync-comparison { border-color: var(--line); }
.sync-comparison th { background: var(--surface-soft); }
.sync-comparison th, .sync-comparison td { border-color: var(--line); }
.searchable-select-menu {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-raised);
  box-shadow: 0 16px 42px rgb(var(--shadow-rgb) / 16%);
}
.searchable-select-option { color: var(--text-secondary); }
.searchable-select-option:hover, .searchable-select-option.is-selected, .task-progress-button:hover, .task-progress-button:focus-visible {
  color: var(--blue);
  border-color: rgb(var(--accent-rgb) / 22%);
  background: rgb(var(--accent-rgb) / 10%);
}
.action-drawer {
  border-color: var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  box-shadow: -20px 0 60px rgb(var(--shadow-rgb) / 20%), inset 0 1px 0 rgb(var(--surface-rgb) / 54%);
}
.drawer-head { border-color: var(--line); }
.drawer-head h2, .detail-stack h3 { color: var(--text); }
.drawer-close { color: var(--text-secondary); border-color: var(--line); background: var(--surface); }
.drawer-hint { color: var(--text-secondary); background: rgb(var(--accent-rgb) / 8%); }
.count-badge, .task-progress-button em, .progress-headline em { color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 9%); }
.task-progress-button { color: var(--text-secondary); background: transparent; }
.task-progress-button span { color: var(--text-secondary); }
.task-progress-button b { color: var(--muted); }
.schedule-key, .schedule-empty { color: var(--muted); }
.gantt_grid_scale, .gantt_task_scale { color: var(--text-secondary); background: var(--surface-soft); }
.tabulator { color: var(--text-secondary); border-color: var(--line); background: transparent; }
.tabulator .tabulator-header { color: var(--muted); border-bottom-color: var(--line); background: var(--surface-soft); }
.tabulator .tabulator-table { color: var(--text-secondary); background: transparent; }
.tabulator .tabulator-header .tabulator-col { border-right-color: var(--line); }
.tabulator .tabulator-row { border-bottom-color: var(--line); background: transparent; }
.tabulator .tabulator-row.tabulator-row-even { background: color-mix(in srgb, var(--surface-soft) 58%, transparent); }
.tabulator .tabulator-row:hover { background: var(--surface-hover); }
.tabulator .tabulator-cell { border-right-color: var(--line); }
.tabulator .tabulator-footer { border-top-color: var(--line); background: var(--surface-soft); }
.tabulator .tabulator-footer .tabulator-paginator { color: var(--text-soft); }
.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents { color: var(--muted); }
.tabulator .tabulator-footer .tabulator-page.active, .tabulator .tabulator-footer .tabulator-page.active:hover {
  border-color: var(--blue);
  background: var(--blue);
}
@supports not (backdrop-filter: blur(1px)) {
  .sidebar, .metric-card, .data-panel { background: var(--surface-raised); }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); gap: 16px; padding: 16px; }
  .sidebar { top: 16px; height: calc(100vh - 32px); border-radius: 18px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .schedule-layout, .schedule-layout.has-tray { grid-template-columns: 1fr; }
  .schedule-tray { position: static; }
  .exception-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
}
@media (max-width: 820px) {
  .app-shell { display: block; padding: 0; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    overflow: auto hidden;
    border-width: 0 0 1px;
    border-radius: 0 0 18px 18px;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand, .nav-group { display: none; }
  .nav-list { display: flex; width: max-content; gap: 8px; }
  .nav-link { width: auto; padding: 10px 12px; }
  .workspace { padding: 24px 16px 48px; }
  .topbar { flex-direction: column; gap: 16px; }
  .topbar-actions { width: 100%; align-items: flex-end; }
  .business-form { grid-template-columns: 1fr; padding: 20px; }
  .business-form .wide { grid-column: auto; }
  .entry-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .entry-row input[name="remark"] { grid-column: 1; }
  .entry-row .icon-button { grid-column: 2; grid-row: 2; justify-self: end; }
  .panel-head { flex-direction: column; }
  .row-actions { min-width: 0; }
  .route-step-row { grid-template-columns: 34px minmax(0, 1fr); align-items: center; }
  .route-step-actions { grid-column: 2; }
  .schedule-batch-row { grid-template-columns: minmax(0, 1fr) minmax(145px, .7fr); }
  .schedule-task-copy { grid-column: 1 / -1; }
  .route-step-actions > button { flex: 1 1 80px; }
  .backup-list > div { align-items: flex-start; flex-direction: column; }
  .chart-grid { grid-template-columns: 1fr; }
  .schedule-gantt { display: none; }
  .schedule-mobile-list { display: grid; gap: 10px; }
  .exception-item { grid-template-columns: auto minmax(0, 1fr); }
  .exception-item .row-actions { grid-column: 2; min-width: 0; }
  .manual-line-row, .order-field-grid { grid-template-columns: 1fr; align-items: stretch; }
  .sync-comparison { width: calc(100% - 40px); margin-inline: 20px; }
  .work-order-progress > header { align-items: flex-start; flex-direction: column; }
  .progress-headline { width: 100%; justify-content: flex-start; }
  .hours-controls { align-items: stretch; flex-direction: column; }
  .hours-scope-switch { width: fit-content; }
}
@media (max-width: 520px) {
  .workspace { padding-inline: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric-card { min-height: 72px; padding: 12px; border-radius: 18px; }
  .metric-card strong { font-size: var(--font-metric); }
  .data-panel { border-radius: 18px; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions { align-items: stretch; }
  .form-actions > button { flex: 1 1 130px; }
  .action-drawer {
    top: auto;
    right: 6px;
    bottom: 6px;
    left: 6px;
    width: auto;
    max-height: calc(100vh - 18px);
    border-radius: 18px;
    transform: translateY(calc(100% + 18px));
  }
  .drawer-layer.is-open .action-drawer { transform: translateY(0); }
  .drawer-form { grid-template-columns: 1fr; }
  .drawer-form .wide { grid-column: auto; }
  .schedule-batch-row { grid-template-columns: 1fr; }
  .schedule-task-copy { grid-column: auto; }
  .detail-summary { grid-template-columns: 1fr; }
  .exception-summary { grid-template-columns: 1fr 1fr; }
  .filter-toolbar { align-items: stretch; flex-direction: column; }
  .filter-toolbar label, .filter-toolbar .search-field, .filter-toolbar .filter-compact { width: 100%; min-width: 0; flex: 0 0 auto; }
  .filter-actions { width: 100%; }
  .filter-actions > button { flex: 1 1 0; }
  .manual-line-row { grid-template-columns: 1fr; }
  .manual-line-row .icon-button { justify-self: start; }
  .subsection-head { align-items: flex-start; flex-direction: column; }
  .task-progress-button { grid-template-columns: minmax(72px, 1fr) auto auto; }
  .hours-month-form { align-items: stretch; flex-direction: column; }
  .hours-month-form label { width: 100%; }
  .hours-month-form button { width: 100%; }
  .hours-scope-switch { width: 100%; }
  .hours-scope-button { flex: 1 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  html, body { color-scheme: light; }
  body {
    --canvas: #fff;
    --canvas-secondary: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --surface-soft: #f6f8fa;
    --text: #111827;
    --text-secondary: #344054;
    --muted: #667085;
    --line: rgb(52 64 84 / 20%);
    background: var(--surface);
  }
  body::before, .sidebar, .flash { display: none !important; }
  .app-shell { display: block; padding: 0; }
  .workspace { padding: 0; }
  .data-panel, .metric-card { break-inside: avoid; box-shadow: none; backdrop-filter: none; }
}
.active-exception-filter { margin: 10px 16px; padding: 8px 12px; border-radius: 8px; }
.searchable-select-option:focus-visible { color: var(--text); background: var(--surface-hover); outline: 2px solid var(--focus); outline-offset: -2px; }
html, body, button, input, select, textarea { font-family: var(--font-ui); }
body {
  font-size: 14px;
  background: var(--canvas-glow);
}
body::before {
  display: none;
  background-image: linear-gradient(rgb(var(--shadow-rgb) / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--shadow-rgb) / 5%) 1px, transparent 1px),
    linear-gradient(rgb(var(--shadow-rgb) / 2.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--shadow-rgb) / 2.5%) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  mask-image: radial-gradient(circle at 50% 38%, #000 12%, transparent 82%);
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nav-icon, .button-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.button-icon { width: 16px; height: 16px; }
.topbar-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--text-secondary);
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: color 160ms ease, background-color 160ms ease;
}
.topbar-icon-button[hidden] { display: none; }
.topbar-icon-button:hover:not(:disabled) { color: var(--hongyu-accent-text); background: var(--surface-hover); }
.topbar-icon-button:disabled { cursor: default; opacity: .55; }
.topbar-icon-button[aria-busy="true"] .button-icon { animation: aps-refresh-spin 900ms linear infinite; }
@keyframes aps-refresh-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-icon-button[aria-busy="true"] .button-icon { animation: none; }
}
@media (max-width: 520px) {
  body[data-active-view="orders"] .topbar { flex-wrap: wrap; }
  body[data-active-view="orders"] .topbar-actions { margin-left: auto; }
}
.primary-button, .secondary-button, .danger-button, .text-button, .add-row { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nav-link.is-playing .nav-icon[data-icon="layout-grid"] { animation-name: aps-nav-grid; }
.nav-link.is-playing .nav-icon[data-icon="badge-alert"] { animation-name: aps-nav-alert; }
.nav-link.is-playing .nav-icon[data-icon="clock"], .nav-link.is-playing .nav-icon[data-icon="history"], .nav-link.is-playing .nav-icon[data-icon="database-backup"] {
  animation-name: aps-nav-turn;
}
.nav-link.is-playing .nav-icon[data-icon="calendar-days"], .nav-link.is-playing .nav-icon[data-icon="calendar-check"], .nav-link.is-playing .nav-icon[data-icon="calendar-cog"] { animation-name: aps-nav-calendar; }
.nav-link.is-playing .nav-icon[data-icon="route"], .nav-link.is-playing .nav-icon[data-icon="workflow"] { animation-name: aps-nav-route; }
@keyframes aps-nav-pulse {
  0%, 100% { transform: scale(1); } 46% { transform: scale(.84); } 72% { transform: scale(1.08); }
}
@keyframes aps-nav-grid {
  0%, 100% { transform: rotate(0) scale(1); } 42% { transform: rotate(-5deg) scale(.88); } 72% { transform: rotate(2deg) scale(1.06); }
}
@keyframes aps-nav-alert {
  0%, 100% { transform: rotate(0); } 35% { transform: rotate(-6deg); } 58% { transform: rotate(5deg); } 78% { transform: rotate(-2deg); }
}
@keyframes aps-nav-turn {
  0% { transform: rotate(0); } 72% { transform: rotate(-32deg); } 100% { transform: rotate(0); }
}
@keyframes aps-nav-calendar {
  0%, 100% { transform: translateY(0); } 48% { transform: translateY(-2px); } 72% { transform: translateY(1px); }
}
@keyframes aps-nav-route {
  0%, 100% { transform: translateX(0); } 42% { transform: translateX(2px); } 68% { transform: translateX(-1px); }
}
@media (min-width: 821px) {
  .app-shell { gap: 0; }
  .sidebar { background: color-mix(in srgb, var(--glass) 88%, transparent); backdrop-filter: blur(22px) saturate(135%); }
  .brand { min-height: 42px; align-items: center; gap: 12px; margin: 0 8px 10px; letter-spacing: 0; }
  .brand-mark { display: grid; place-items: center; }
  .brand-copy { display: grid; gap: 1px; }
  .brand .brand-copy { color: var(--text); }
  .brand strong { font: 650 17px/1.2 var(--font-display); letter-spacing: .04em; }
  .brand small { color: var(--text-soft); font-size: 12px; }
  .nav-group { color: var(--text-soft); line-height: 14px; }
  .nav-link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    color: var(--text-secondary);
    letter-spacing: .01em;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  }
  .nav-link:hover { transform: none; background: rgb(var(--hongyu-accent-rgb) / 6%); }
  .nav-link.is-active { color: var(--hongyu-accent-text); border-color: transparent; box-shadow: none; }
  .nav-link:focus-visible { color: var(--hongyu-accent-text); }
  .nav-link:focus-visible > span {
    text-decoration: underline;
    text-decoration-color: rgb(var(--hongyu-accent-rgb) / 62%);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
  }
  .nav-link.is-active::after { right: 9px; width: 4px; height: 4px; box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 12%), 0 0 10px rgb(var(--accent-rgb) / 42%); }
  .workspace { max-width: none; }
  .topbar { position: relative; z-index: 1; align-items: center; border-bottom: 0; background: transparent; backdrop-filter: none; }
  .page-heading { min-width: 0; }
  .topbar h1 { margin-top: 0; color: var(--text); font: 650 23px/1.2 var(--font-display); text-wrap: balance; }
  .topbar-actions { align-items: center; }
  .view.is-active { animation: aps-view-arrive 180ms ease-out; }
  .section-intro { display: none; }
  .section-intro h2 { color: var(--text); font: 600 17px/1.3 var(--font-display); letter-spacing: -.005em; }
  .section-intro p { max-width: 780px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
  .section-intro p, .panel-head p, .subsection-head p { display: none; }
  .panel-head p.panel-evidence { display: block; }
  .primary-button { border-color: var(--hongyu-accent-action); background: var(--hongyu-accent-action); }
  .primary-button:hover { box-shadow: 0 3px 8px rgb(var(--hongyu-accent-rgb) / 18%); }
  .secondary-button, .text-button, .add-row { box-shadow: none; }
  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    gap: 0;
    margin: 0 0 var(--panel-gap);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--panel-radius);
    background: var(--surface);
    box-shadow: var(--soft-shadow);
  }
  .metrics > .metric-card {
    min-height: 68px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 12px var(--surface-padding);
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .metrics > .metric-card:last-child { border-right: 0; }
  .metrics > .metric-card span { font-size: 12px; letter-spacing: .025em; }
  .metrics > .metric-card strong { font: 600 var(--font-metric)/1.1 var(--font-display); letter-spacing: -.02em; }
  .metrics > .metric-card.is-primary { background: rgb(var(--hongyu-accent-rgb) / 6%); box-shadow: inset 0 2px var(--hongyu-accent); }
  .data-panel { background: var(--surface); backdrop-filter: none; margin: 0 0 var(--panel-gap); }
  .panel-head { align-items: center; gap: 12px; background: transparent; }
  .panel-head h2 { letter-spacing: .002em; }
  .panel-head p { margin-top: 4px; font-size: 12px; line-height: 1.55; }
  .overview-grid { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: var(--panel-gap); margin-bottom: var(--panel-gap); }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
  .chart-host { min-height: 246px; padding: 0 8px 6px; }
  .chart-summary { padding: 0 16px 16px; font-size: 12px; }
  .filter-toolbar .search-field { width: min(310px, 100%); max-width: 340px; min-width: 240px; }
  .filter-toolbar input, .filter-toolbar select, .filter-toolbar button { font-size: 12px; }
  .filter-actions { gap: 8px; margin-left: auto; }
  .order-lines-panel { margin-top: 0; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px rgb(var(--shadow-rgb) / 6%); }
  .order-command-bar {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px var(--surface-padding);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .order-command-form, .order-command-actions { display: flex; min-width: 0; align-items: center; gap: 8px; }
  .order-command-form { flex: 1 1 auto; }
  .order-command-form label { display: block; min-width: 0; }
  .order-command-form label:not(.order-search-input, .order-search-scope) { width: 112px; }
  .order-command-form .order-search-scope { width: 116px; }
  .order-command-form .order-search-input { width: clamp(190px, 20vw, 300px); }
  .order-command-form input, .order-command-form select {
    width: 100%;
    min-height: var(--control-height);
    padding-block: 8px;
  }
  .order-command-form input::placeholder, .order-command-form select:has(option[value=""]:checked) { color: var(--text-soft); }
  .order-command-actions { flex: 0 0 auto; }
  .order-table-count { min-width: 48px; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  :is(.order-icon-button, .filter-icon-button) {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--text-secondary);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    box-shadow: none;
  }
  :is(.order-icon-button, .filter-icon-button):hover {
    color: var(--hongyu-accent-text);
    border-color: rgb(var(--hongyu-accent-rgb) / 32%);
    background: var(--surface-hover);
  }
  :is(.order-icon-button, .filter-icon-button).is-primary { color: var(--on-accent); border-color: var(--hongyu-accent-action); background: var(--hongyu-accent-action); }
  :is(.order-icon-button, .filter-icon-button) .button-icon { width: 17px; height: 17px; }
  .order-command-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--line); }
  .order-line-table-host { min-height: 0; padding: 0; background: var(--surface); }
  .order-line-table-host.tabulator { height: 100%; border: 0; border-radius: 0 0 var(--panel-radius) var(--panel-radius); }
  .order-line-table-host .tabulator-row .tabulator-cell.tabulator-frozen {
    background: var(--surface);
  }
  .order-line-table-host .tabulator-row.tabulator-row-even .tabulator-cell.tabulator-frozen { background: var(--surface-soft); }
  .order-line-table-host .tabulator-row:hover .tabulator-cell.tabulator-frozen { background: var(--surface-hover); }
  .order-line-table-host .tabulator-frozen-left { box-shadow: 5px 0 12px rgb(var(--shadow-rgb) / 5%); }
  .order-line-table-host .tabulator-frozen-right { box-shadow: -5px 0 12px rgb(var(--shadow-rgb) / 5%); }
  @media (max-width: 1320px) {
    .order-command-bar { align-items: stretch; flex-direction: column; }
    .order-command-form { width: 100%; }
    .order-command-form .order-search-input { flex: 1 1 auto; width: auto; }
    .order-command-actions { justify-content: flex-end; }
  }
  input, select, textarea { border-color: var(--line-strong); box-shadow: none; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), select { height: var(--control-height); }
  input:hover, select:hover, textarea:hover { border-color: rgb(var(--hongyu-accent-rgb) / 34%); background: var(--surface); }
  input:focus, select:focus, textarea:focus {
    border-color: rgb(var(--hongyu-accent-rgb) / 55%);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgb(var(--hongyu-accent-rgb) / 9%);
  }
  .business-form { gap: 12px 16px; padding: 16px; }
  .business-form label, .field-label { gap: 6px; font-size: 12px; }
  .table-meta { min-height: 34px; padding: 8px 16px; font-size: 12px; }
  .table-host { border-radius: 0 0 var(--panel-radius) var(--panel-radius); }
  .data-table th, .data-table td { line-height: 1.45; }
  .tabulator .tabulator-row { min-height: 44px; }
  .tabulator .tabulator-cell { padding: 6px 12px; }
  .tabulator .tabulator-cell.cell-actions { justify-content: center; }
  .tabulator .tabulator-cell.cell-number { justify-content: flex-end; }
  .tabulator .tabulator-footer .tabulator-footer-contents { padding: 8px 10px; }
  .table-primary { gap: 1px; }
  .table-primary strong { font-size: 12px; }
  .table-primary small { line-height: 1.45; }
  .row-actions { align-items: center; }
  .backup-list > div { min-height: 56px; gap: 12px; padding: 8px var(--surface-padding); }
  .exception-summary { margin: 0 0 var(--panel-gap); }
  .hours-month-form { gap: 8px; }
  .hours-month-form label { font-size: 12px; }
  .hours-scope-switch { gap: 12px; }
  .hours-scope-button { padding-inline: 4px; }
  .hours-matrix th, .hours-matrix td { min-width: 78px; height: 52px; padding: 8px 10px; font-size: 12px; }
  .hours-matrix thead th { height: 40px; }
  .drawer-head h2 { letter-spacing: -.01em; }
}
.hours-matrix th, .hours-matrix td, .hours-matrix .hours-person, .hours-matrix thead .hours-total { text-align: center; }
.data-table th, .data-table td, .audit-diff th, .audit-diff td { text-align: center; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content, .tabulator .tabulator-header .tabulator-col-title-holder { justify-content: center; }
.tabulator .tabulator-header .tabulator-col-title { flex: 0 1 auto; text-align: center; }
.tabulator .tabulator-cell.cell-center, .tabulator .tabulator-cell.cell-number, .tabulator .tabulator-cell.cell-actions {
  justify-content: center;
  text-align: center;
}
.tabulator .tabulator-cell { justify-content: center; text-align: center; }
.table-primary, .project-cell { justify-items: center; text-align: center; }
.order-cell-text, .order-number-button { text-align: center; }
.order-column-choice {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
  touch-action: none;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 220ms var(--ease-organic), transform 220ms var(--ease-organic), opacity 180ms ease;
}
.drawer-layer[data-action="order-columns"] .action-drawer { width: min(450px, calc(100vw - 24px)); }
.order-column-config { gap: 12px; padding: 16px 16px 16px; }
.order-column-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.order-column-choice { min-height: 40px; gap: 8px; padding: 8px 10px; }
.order-column-choice .visibility-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--hongyu-accent-text);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.order-column-choice.is-hidden { color: var(--muted); background: transparent; }
.order-column-choice.is-hidden .visibility-icon { stroke: var(--muted); }
.order-column-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-column-grip {
  width: 18px;
  height: 24px;
  flex: 0 0 18px;
  margin-left: auto;
  color: var(--muted);
  border-radius: 6px;
  background-image: radial-gradient(circle, currentColor 1.2px, transparent 1.4px);
  background-position: center;
  background-size: 6px 6px;
  opacity: .52;
  cursor: grab;
}
.order-column-choice.is-pressing { border-color: rgb(var(--hongyu-accent-rgb) / 35%); }
.order-column-choice.is-dragging {
  z-index: 2;
  color: var(--text);
  border-color: rgb(var(--hongyu-accent-rgb) / 58%);
  background: var(--surface);
  box-shadow: 0 14px 30px rgb(var(--shadow-rgb) / 16%), 0 0 0 3px rgb(var(--hongyu-accent-rgb) / 9%);
  opacity: 1;
  transform: scale(1.015);
  cursor: grabbing;
}
.order-column-grid.is-reordering .order-column-choice:not(.is-dragging) { opacity: .66; }
body.order-column-reordering { cursor: grabbing; user-select: none; }
@keyframes aps-view-arrive {
  from { opacity: .6; }
  to { opacity: 1; }
}
@media (min-width: 821px) {
  .sidebar { overflow: hidden; }
  .sidebar .brand { flex-shrink: 0; }
  .sidebar .nav-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
body.fixed-list-view { height: 100dvh; min-height: 0; overflow: hidden; }
body.fixed-list-view .app-shell { height: 100dvh; min-height: 0; overflow: hidden; }
body.fixed-list-view .workspace { display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
body.fixed-list-view .topbar { flex: 0 0 auto; }
#orders-view.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.order-lines-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; overflow: hidden; }
.order-command-bar, .table-horizontal-scroll, .active-exception-filter { flex: 0 0 auto; }
:is(.order-line-table-host, .fixed-table-host).tabulator { flex: 1; min-height: 0; display: flex; flex-direction: column; }
:is(.order-line-table-host, .fixed-table-host) .tabulator-header, :is(.order-line-table-host, .fixed-table-host) .tabulator-footer { flex: 0 0 auto; }
:is(.order-line-table-host, .fixed-table-host) .tabulator-tableholder { flex: 1; min-height: 0; max-height: none !important; overscroll-behavior: contain; }
#orders-view .order-workspace { margin: 0; overscroll-behavior: contain; }
#orders-view:has(#order-workspace) .order-lines-panel { display: none; }
#orders-view .order-workspace > .panel-head { position: sticky; top: 0; z-index: 3; background: var(--surface); }
body.fixed-list-view .view.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
body.fixed-list-view .view > .data-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; overflow: hidden; }
body.fixed-list-view .view > .section-intro { flex: 0 0 auto; }
body.fixed-list-view .view > .data-panel > :is(.panel-head, .filter-toolbar, .table-meta) { flex: 0 0 auto; }
body.fixed-list-view .view > .master-panel { flex: 0 1 auto; max-height: 100%; }
body.fixed-list-view .list-scroll-region { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; }
.list-scroll-region { scrollbar-color: var(--line-strong) var(--surface); }
.list-scroll-region::-webkit-scrollbar { width: 10px; height: 0; }
.list-scroll-region::-webkit-scrollbar-thumb { border: 2px solid var(--surface); border-radius: 8px; background: var(--line-strong); }
.list-scroll-region::-webkit-scrollbar-track { background: var(--surface); }
.list-scroll-region .data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); }
.fixed-table-host.tabulator { border: 0; padding: 0; }
.table-horizontal-scroll {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 16px;
  margin: 0;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.table-horizontal-scroll[hidden] { display: none; }
.table-horizontal-scroll > span { flex: 0 0 auto; }
.table-horizontal-scroll input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: ew-resize;
}
.table-horizontal-scroll input::-webkit-slider-runnable-track { height: 6px; border-radius: 8px; background: var(--line-strong); }
.table-horizontal-scroll input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 64px;
  height: 10px;
  margin-top: -2px;
  border: 1px solid rgb(var(--hongyu-accent-rgb) / 25%);
  border-radius: 8px;
  background: var(--hongyu-accent-action);
  box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 12%);
}
.table-horizontal-scroll input::-moz-range-track { height: 6px; border-radius: 8px; background: var(--line-strong); }
.table-horizontal-scroll input::-moz-range-thumb { width: 64px; height: 10px; border: 0; border-radius: 8px; background: var(--hongyu-accent-action); }
:is(.order-line-table-host, .fixed-table-host) .tabulator-tableholder { scrollbar-width: auto; scrollbar-color: auto; }
:is(.order-line-table-host, .fixed-table-host) .tabulator-tableholder::-webkit-scrollbar { width: 10px; height: 0; }
:is(.order-line-table-host, .fixed-table-host) .tabulator-tableholder::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface);
  border-radius: 8px;
  background: var(--line-strong);
}
:is(.order-line-table-host, .fixed-table-host) .tabulator-tableholder::-webkit-scrollbar-track { background: var(--surface); }
#processes-view { max-width: 960px; }
#routes-view, #public-projects-view { max-width: 1080px; }
.master-panel { overflow: hidden; }
.master-panel .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.master-panel-heading { display: flex; align-items: baseline; gap: 12px; }
.master-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.master-table { table-layout: fixed; }
.master-table th:last-child { width: 160px; }
.master-table th:nth-last-child(2) { width: 100px; }
.master-table:not(.master-table-route) th:first-child { width: 120px; }
.master-table-process { min-width: 640px; }
.master-table-process th:nth-child(2) { width: 160px; }
.master-table-route { min-width: 680px; }
.master-table-route th:first-child { width: 180px; }
.master-table-route th:nth-last-child(2) { width: 160px; }
.master-table-product { min-width: 960px; }
.master-table .master-actions { min-width: 0; gap: 8px; }
.master-table td { height: 56px; padding: 8px 12px; }
.master-panel .table-scroll { max-height: calc(100dvh - 180px); overscroll-behavior: contain; }
.primary-button:active, .secondary-button:active { filter: brightness(.94); }
:is(.order-icon-button, .filter-icon-button):active { filter: brightness(.94); }
.nav-link.is-playing .nav-icon { animation: none; }
@media (max-width: 820px) {
  .nav-link { display: inline-flex; align-items: center; gap: 8px; }
  .brand-copy { display: none; }
  body[data-active-view="orders"] .app-shell { display: flex; flex-direction: column; }
  body[data-active-view="orders"] .sidebar { flex: 0 0 auto; }
  body[data-active-view="orders"] .workspace { flex: 1; padding: 12px; }
  body[data-active-view="orders"] .topbar { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 12px; }
  body[data-active-view="orders"] .topbar h1 { font-size: 23px; white-space: nowrap; }
  body[data-active-view="orders"] .topbar-actions { width: auto; align-items: center; gap: 8px; }
  .order-command-bar { padding: 8px; border-bottom: 1px solid var(--line); }
  .order-command-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .order-search-input { grid-column: span 2; }
  .order-command-form input, .order-command-form select { min-height: 40px; height: 40px; padding: 8px; font-size: 12px; }
  .order-icon-button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-secondary); background: var(--surface-soft); }
  .order-icon-button.is-primary { color: var(--on-accent); background: var(--hongyu-accent-action); }
  .order-command-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding-top: 6px; }
  .order-command-actions .order-icon-button { width: 40px; }
  .order-command-actions .primary-button, .order-command-actions .secondary-button { min-height: 40px; padding: 8px; font-size: 12px; }
  .order-table-count { margin-right: auto; color: var(--muted); font-size: 12px; }
  .order-line-table-host.tabulator { border: 0; border-radius: 0; font-size: 12px; }
  .order-line-table-host .tabulator-footer .tabulator-footer-contents { padding: 6px; }
  .order-line-table-host .tabulator-footer .tabulator-paginator { gap: 4px; font-size: 12px; }
  .order-line-table-host .tabulator-footer .tabulator-page { min-width: 28px; padding: 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-link.is-playing .nav-icon, .view.is-active { animation: none !important; }
}
@media (min-width: 821px) and (max-width: 1100px) {
  body.fixed-list-view .filter-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; padding: 10px 12px; }
  body.fixed-list-view .filter-toolbar label { width: auto; min-width: 0; max-width: none; gap: 4px; font-size: 12px; }
  body.fixed-list-view .filter-toolbar :is(input, select, button) { min-height: 40px; height: 40px; font-size: 12px; }
  body.fixed-list-view .filter-actions { margin: 0; gap: 6px; justify-content: flex-end; }
}
.nav-link[hidden] { display: none !important; }
.record-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 10px;
  color: var(--hongyu-accent-text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.record-icon-button:hover { background: var(--surface-hover); }
.record-icon-button:disabled { opacity: .45; cursor: not-allowed; }
.record-icon-button .button-icon { width: 18px; height: 18px; margin: 0; }
.public-project-panel .master-panel-heading { align-items: center; }
#reporting-view .reporting-entry-panel { max-width: none; flex: 0 1 auto; max-height: 100%; }
#reporting-view .report-guided-form {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.35fr);
  grid-template-rows: minmax(0, auto) auto;
  flex: 0 1 auto;
  min-height: 0;
  gap: 0;
  padding: 0;
}
.report-context-section, .report-people-section { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; }
.report-context-section { border-right: 1px solid var(--line); }
.report-guided-form h3 { margin: 0 0 16px; font-size: 14px; color: var(--text); }
.report-guided-form label { display: grid; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.report-date-field { max-width: 220px; margin-bottom: 16px; }
.report-context-note {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}
.report-context-note strong { color: var(--text); }
.report-context-note.is-warning { border-color: var(--warning-line); }
.report-context-note button { justify-self: start; }
.report-context-note small { color: var(--muted); }
.report-quantity-fields { display: grid; gap: 12px; }
.report-guided-form .entry-batch-tools { padding: 0; margin: 0 0 10px; border: 0; background: transparent; gap: 8px; }
.report-guided-form .entry-batch-tools textarea { min-height: 48px; height: 48px; }
.report-guided-form .entry-batch-tools .inline-note { margin: 0; }
.report-guided-form .entry-summary { padding: 8px 0; }
.report-batch-hours { display: flex; align-items: end; gap: 8px; }
.report-batch-hours label { flex: 1; min-width: 0; }
.report-batch-hours button { flex: 0 0 auto; }
.report-person-picker { position: relative; }
.report-person-picker summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--hongyu-accent-text); }
.report-person-picker[open] { width: 100%; }
.report-guided-form .entry-row, .report-entry-head {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 100px minmax(70px, 1fr) 32px;
  gap: 8px;
  padding: 0;
  margin-bottom: 8px;
}
.report-guided-form .entry-row input { min-width: 0; width: 100%; }
.report-entry-head { color: var(--muted); font-size: 12px; }
.report-submit-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  margin: 0;
  background: var(--surface);
}
.report-submit-bar > span { color: var(--muted); font-size: 12px; }
.drawer-layer[data-action="order-work-orders"] .action-drawer { width: min(700px, 65vw); }
.drawer-layer[data-action="order-work-orders"] .drawer-content { padding: 16px 20px; }
.drawer-back-button { margin-bottom: 16px; }
.report-detail-content { padding: 12px 20px 20px; }
.report-detail-fields { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; line-height: 1.6; }
.report-detail-fields dt { color: var(--muted); }
.report-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.report-detail-content .subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; font-size: 13px; }
.report-detail-content h3 { margin: 0; font-size: 14px; }
.report-detail-content .data-table { width: 100%; min-width: 0; table-layout: fixed; }
.report-detail-content .data-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.report-detail-content .data-table :is(th, td):first-child { width: 110px; }
.report-detail-content .data-table :is(th, td):nth-child(2) { width: 110px; text-align: right; }
.monthly-hours-panel .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monthly-hours-panel .hours-controls { flex: 0 0 auto; }
.monthly-hours-summary {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}
.monthly-hours-summary strong { color: var(--text-secondary); }
.employee-panel .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.employee-table { min-width: 660px; width: 100%; }
.employee-table th, .employee-table td { text-align: left; }
.employee-table th:last-child, .employee-table td:last-child { width: 70px; text-align: center; }
.entry-employee { min-width: 0; }
.entry-employee .searchable-select { width: 100%; min-width: 0; }
.entry-employee.input-error { border-radius: 8px; outline: 1px solid var(--danger); }
.entry-import-feedback { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.6; }
.employee-panel .filter-toolbar { display: flex; align-items: end; gap: 12px; }
.employee-panel .filter-toolbar .search-field { flex: 0 1 320px; min-width: 180px; }
.employee-panel .filter-toolbar .filter-actions { margin: 0; }
.report-people-section { container: report-people / inline-size; }
.report-people-section[hidden] { display: none; }
.report-external-note { margin: 16px 0 0; color: var(--text-soft); font-size: 13px; }
@container report-people (max-width: 480px) {
  .report-guided-form .entry-row { grid-template-columns: 88px minmax(100px, 1fr) 32px; row-gap: 6px; margin-bottom: 16px; }
  .report-guided-form .entry-employee { grid-column: 1 / -1; }
  .report-entry-head { display: none; }
}
.monthly-hours-panel .hours-controls { flex-wrap: wrap; row-gap: 10px; }
.monthly-hours-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.monthly-hours-filters[hidden] { display: none; }
.monthly-hours-filters label { display: grid; gap: 6px; min-width: 0; color: var(--text-secondary); font-size: 12px; }
.monthly-hours-filters select { width: 100%; min-width: 0; height: 40px; }
.monthly-filter-actions { grid-column: 1 / -1; display: flex; justify-content: end; }
.monthly-filter-actions button { min-height: 30px; }
.hours-detail-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 42px;
  min-height: 32px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.hours-detail-button:hover, .hours-detail-button:focus-visible {
  color: var(--hongyu-accent-text);
  background: var(--surface-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.drawer-layer[data-action="monthly-details"] .drawer-content { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.monthly-detail-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.monthly-detail-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.monthly-detail-summary strong { color: var(--text); }
.monthly-detail-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.monthly-detail-table { width: 100%; table-layout: fixed; }
.monthly-detail-table th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.monthly-detail-table th, .monthly-detail-table td { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.monthly-detail-table .number-cell { font-variant-numeric: tabular-nums; }
.monthly-detail-table small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.monthly-detail-table button { display: block; min-height: 40px; white-space: nowrap; }
.monthly-detail-pager {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.monthly-detail-pager > span { margin-right: auto; }
body.auth-locked .app-shell, body.auth-locked .drawer-layer { display: none; }
.auth-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 32px; overflow: auto; }
.auth-screen[hidden] { display: none; }
.auth-card {
  width: 400px;
  max-width: 100%;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.auth-card .brand { padding: 0; margin-bottom: 32px; }
.auth-card h1 { font-size: 23px; letter-spacing: -.03em; margin: 0 0 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.auth-form input { width: 100%; height: 44px; }
.auth-form button { width: 100%; min-height: 44px; }
.auth-feedback { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-feedback.is-error { color: var(--danger); }
.session-actor { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.report-duplicate-warning {
  grid-column: 1 / -1;
  padding: 12px 16px;
  margin: 10px 0;
  border: 1px solid var(--warning);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.6;
}
.report-duplicate-warning p { margin: 6px 0 0; }
.report-duplicate-warning ul { margin: 8px 0; padding-left: 20px; }
#orders-view .order-workspace { flex: 0 1 auto; min-height: 0; overflow: auto; }
#orders-view .order-workspace > .panel-head { align-items: center; padding: 12px 16px; gap: 12px; }
.order-workspace .order-edit-form { grid-template-columns: 1fr 1fr 1.1fr 1.6fr; padding: 16px 16px 128px; gap: 12px; }
.order-workspace .order-edit-form > .wide { grid-column: 1 / -1; }
.order-workspace .business-form label { gap: 4px; font-size: 12px; }
.order-workspace .order-edit-form input, .order-workspace .order-edit-form select { min-height: 36px; height: 36px; padding: 6px 10px; }
.order-workspace #order-edit-line-list { display: grid; gap: 12px; }
.order-workspace .subsection-head { margin: 0 0 8px; }
.order-workspace .subsection-head h3 { font-size: 14px; }
.order-readonly-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 12px 16px; font-size: 13px; color: var(--muted); }
.order-readonly-lines { padding: 0 16px 16px; overflow-x: auto; }
.record-icon-button { flex-shrink: 0; }
.drawer-layer[data-action="manage-tasks"] .drawer-content { padding: 16px; }
.execution-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.execution-toolbar > strong { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.execution-toolbar .row-actions { flex-shrink: 0; }
.execution-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.execution-table th, .execution-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.execution-table th:nth-child(1) { width: 25%; }
.execution-table th:nth-child(2) { width: 11%; }
.execution-table th:nth-child(3), .execution-table th:nth-child(4) { width: 19%; }
.execution-table th:nth-child(5) { width: 12%; }
.execution-table th:nth-child(6) { width: 14%; }
.execution-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.drawer-layer .execution-table input {
  min-height: 32px;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.execution-table .row-actions { flex-wrap: nowrap; gap: 4px; }
.drawer-layer .drawer-form { gap: 12px; }
.drawer-layer .drawer-form label { gap: 4px; }
.drawer-layer .drawer-form .form-actions { margin-top: 0; }
.drawer-layer .drawer-back-button { margin: 0 0 12px; }
.report-bulk-tools { margin-bottom: 0; }
.report-bulk-tools > summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 8px 0; }
.report-guided-form .report-context-note:not(.is-warning) { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 4px; margin: 10px 0; }
.report-guided-form .report-quantity-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#users-view > .data-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; }
#users-view .table-host { min-height: 0; flex: 1; }
#overview-view .overview-grid { grid-template-columns: minmax(0, 1fr); }
.report-edit-context { color: var(--muted); padding-bottom: 12px; font-size: 13px; }
.master-panel > .panel-head { padding-block: 8px; }
.drawer-layer[data-action="manual-order"] .action-drawer { width: min(1040px, calc(100vw - 48px)); }
.drawer-layer[data-action="manual-order"] .drawer-content { padding: 16px; }
.drawer-layer[data-action="manual-order"] .drawer-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.drawer-layer[data-action="manual-order"] .manual-line-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 12px 0;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
}
.manual-line-row .order-specification-field { grid-column: span 2; }
.manual-line-row .order-product-name-field { grid-column: span 3; }
.manual-line-row > button { align-self: end; justify-self: end; }
.schedule-pending-group header { display: grid; gap: 4px; padding: 10px 0; }
.schedule-pending-group header span { color: var(--muted); font-size: 12px; }
.schedule-pending-group > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.schedule-pending-group small { flex-shrink: 0; color: var(--muted); }
.order-workspace .order-reporting-setup { display: block; padding: 16px 16px 192px; }
.order-setup-context { display: flex; align-items: center; justify-content: space-between; }
.order-setup-context > span { font-size: 14px; color: var(--text); }
.order-setup-context small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.order-setup-context label { width: 190px; flex-shrink: 0; }
.order-setup-table { width: 100%; table-layout: fixed; }
.order-workspace .order-setup-table #order-edit-line-list { display: table-row-group; }
.order-setup-table th, .order-setup-table td { padding: 10px 8px; overflow-wrap: anywhere; }
.order-setup-table .searchable-select-menu { max-height: 168px; }
.order-setup-table .secondary-button { white-space: nowrap; }
.drawer-layer[data-action="manage-tasks"] .action-drawer { width: min(760px, calc(100vw - 48px)); }
.process-only-table { min-width: 0; }
.process-only-table td { height: 44px; }
.drawer-layer:is([data-action="edit-task"], [data-action="create-task"]) .drawer-content { padding: 16px 20px; }
.drawer-layer:is([data-action="edit-task"], [data-action="create-task"]) .drawer-form { padding: 0; }
.order-setup-table th, .order-setup-table td, .process-only-table th, .process-only-table td { text-align: center; vertical-align: middle; }
.order-setup-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-setup-table td:last-child { text-align: center; }
.order-setup-table .searchable-select-input { text-align: center; padding-right: 28px; font-size: 13px; text-overflow: ellipsis; }
.order-setup-context { gap: 16px; margin-bottom: 16px; }
.order-date-shell { position: relative; display: block; width: 152px; }
.order-workspace .order-date-shell input {
  width: 100%;
  height: 36px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 400;
  border-radius: 8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.order-date-shell input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.order-date-shell.is-empty input::-webkit-datetime-edit { color: transparent; }
.order-date-placeholder {
  display: none;
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.order-date-shell.is-empty .order-date-placeholder { display: block; }
.process-inline-editor.business-form { display: block; padding: 0; }
.process-only-table th:nth-child(1) { width: 7%; }
.process-only-table th:nth-child(2) { width: 41%; }
.process-only-table th:nth-child(3) { width: 14%; }
.process-only-table th:nth-child(4) { width: 14%; }
.process-only-table th:nth-child(5) { width: 24%; }
.process-only-table .row-actions { justify-content: center; }
.process-only-table label { display: block; margin: 0; }
.process-only-table .searchable-select-input { text-align: center; font-size: 13px; padding: 6px 24px 6px 8px; }
.process-only-table .searchable-select-menu { max-height: 156px; text-align: left; }
.process-only-table .process-insert-before, .process-only-table .process-insert-after { position: relative; }
.process-insert-before::before, .process-insert-after::after { content: ''; position: absolute; width: 18px; left: 8px; border-top: 1.5px solid currentColor; }
.process-insert-before::before { top: 5px; }
.process-insert-after::after { bottom: 5px; }
.process-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.process-grip { width: 12px; height: 18px; background: radial-gradient(circle, currentColor 1.3px, transparent 1.5px) 0 0 / 6px 6px; }
.process-drag-handle:hover, .process-drag-handle:focus-visible { color: var(--accent); background: var(--surface-soft); }
.is-process-dragging { outline: none; }
.is-process-dragging .process-drag-handle { cursor: grabbing; }
.process-draft-row { background: var(--surface-soft); }
.process-inline-editor[aria-busy="true"] { opacity: .65; }
.process-only-table .searchable-select-menu[popover]:not(:popover-open) { display: none; }
body.auth-loading #login-form { display: none; }
body.auth-loading #auth-screen h1 { display: none; }
.topbar-actions [hidden] { display: none !important; }
body { letter-spacing: 0; line-height: 1.5; }
@media (min-width: 821px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); padding: 0; }
  .sidebar { top: 0; height: 100dvh; padding: 24px 12px 12px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .sidebar .brand { margin: 0 10px 24px; }
  .brand-mark { border-radius: 12px; width: 40px; height: 40px; box-shadow: none; }
  .brand small { font-weight: 400; letter-spacing: .04em; }
  .nav-group { padding: 16px 12px 6px; font-size: 12px; font-weight: 500; letter-spacing: .05em; }
  .nav-list { gap: 2px; }
  .nav-link { min-height: 36px; padding: 0 12px; font-weight: 500; gap: 10px; border-radius: var(--control-radius); }
  .nav-icon { width: 17px; height: 17px; stroke-width: 1.65; }
  .nav-link.is-active { background: rgb(var(--hongyu-accent-rgb) / 10%); font-weight: 600; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-playing .nav-icon { animation: none; }
  .nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .workspace { padding: 0 32px 32px; }
  .topbar { min-height: 84px; margin: 0 0 4px; padding: 20px 0; gap: 16px; }
  .page-heading { display: flex; align-items: center; gap: 20px; }
  .topbar h1 { font-size: 23px; font-weight: 650; line-height: 1.3; letter-spacing: 0; }
  .topbar-actions { gap: 6px; }
  .session-actor { font-size: 12px; color: var(--text-soft); }
  .topbar-icon-button { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; border-radius: 8px; border-color: transparent; background: transparent; }
  .data-panel { border-radius: var(--panel-radius); box-shadow: var(--soft-shadow); }
  .panel-head { min-height: 54px; padding: 16px 20px; }
  .panel-head h2 { font-size: 14px; font-weight: 600; }
  .primary-button { box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 9%); }
  .secondary-button, .add-row { background: var(--surface); border-color: var(--line-strong); color: var(--text-secondary); }
  .primary-button:hover, .secondary-button:hover, .danger-button:hover, .add-row:hover { transform: none; }
  .page-create-button { display: inline-flex; align-items: center; }
  input, select, textarea, .business-form input, .business-form select, .business-form textarea, .filter-toolbar input, .filter-toolbar select {
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
  }
  input::placeholder, textarea::placeholder { color: var(--text-soft); font-weight: 400; }
  .business-form label, .filter-toolbar label { color: var(--text-secondary); font-weight: 500; font-size: 12px; gap: 6px; }
  .record-icon-button, .data-table .record-icon-button, .tabulator .record-icon-button {
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
  }
  :is(.record-icon-button, .process-action) {
    --action-color: var(--hongyu-accent-text);
    --action-soft: var(--hongyu-accent-soft);
    color: var(--action-color);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
  }
  :is(.record-icon-button, .process-action).is-neutral { --action-color: var(--text-soft); --action-soft: var(--surface-hover); }
  :is(.record-icon-button, .process-action).is-positive { --action-color: var(--success); --action-soft: var(--success-soft); }
  :is(.record-icon-button, .process-action).is-danger { --action-color: var(--danger); --action-soft: var(--danger-soft); }
  :is(.record-icon-button, .process-action):hover:not(:disabled) {
    color: var(--action-color);
    background: var(--action-soft);
    border-color: transparent;
    box-shadow: none;
    transform: none;
  }
  :is(.record-icon-button, .process-action):focus-visible { outline: 2px solid var(--action-color); outline-offset: 2px; }
  :is(.record-icon-button, .process-action):disabled {
    color: var(--text-soft);
    background: transparent;
    border-color: transparent;
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }
  .row-actions, .master-table .master-actions { justify-content: center; gap: 6px; }
  .filter-toolbar { padding: 16px 20px; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); align-items: end; }
  .filter-toolbar .search-field { flex: 0 1 300px; }
  .filter-toolbar .filter-actions { gap: 6px; }
  .table-host { padding: 0; }
  .data-table th, .data-table td, .employee-table th, .employee-table td, .audit-diff th, .audit-diff td { text-align: center; vertical-align: middle; }
  .data-table th { height: 40px; padding: 10px 12px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
  .data-table td { height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--line); line-height: 1.35; }
  .data-table tbody tr:last-child td { border-bottom: 0; }
  .data-table tbody tr:hover { background: var(--surface-hover); }
  .master-table th:last-child { width: 104px; }
  .master-table th:nth-last-child(2) { width: 100px; }
  .master-table-route th:nth-last-child(2) { width: 100px; }
  #processes-view, #routes-view, #public-projects-view { max-width: none; }
  .employee-table { table-layout: fixed; }
  .employee-table th:first-child { width: 18%; }
  .employee-table th:last-child { width: 100px; }
  .employee-table th:nth-last-child(2) { width: 110px; }
  .employee-table td:last-child { text-align: center; }
  .tabulator { background: var(--surface); border: 0; font-size: 12px; }
  .tabulator .tabulator-header { background: var(--surface-soft); border-bottom: 1px solid var(--line); }
  .tabulator .tabulator-header .tabulator-col { background: transparent; border-right: 0; }
  .tabulator .tabulator-header .tabulator-col .tabulator-col-content { min-height: 40px; padding: 6px 12px; text-align: center !important; }
  .tabulator .tabulator-header .tabulator-col .tabulator-col-title { width: 100%; text-align: center; }
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-arrow { opacity: .3; }
  .tabulator-row { background: var(--surface); border-bottom: 1px solid var(--line); }
  .tabulator-row.tabulator-row-even { background: var(--surface); }
  /* 抽屉内工序编辑表使用 32px 行内控件，行高 44px。 */
  .data-table.process-only-table td { height: 44px; padding-block: 6px; }
  .data-table.process-only-table .process-drag-handle, .data-table.process-only-table .searchable-select > input.searchable-select-input { height: 32px; min-height: 32px; }
  /* 行高 52px＝单元格 51px＋1px 底线；两行内容按 1.35 行高同样落在 52px 内。 */
  .tabulator-row .tabulator-cell { min-height: 51px; padding: 8px 12px; border-right: 0; line-height: 1.35; text-align: center !important; justify-content: center; }
  .tabulator .tabulator-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px; }
  .tabulator .tabulator-footer .tabulator-page {
    min-width: 28px;
    min-height: 28px;
    margin: 0 2px;
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: var(--text-secondary);
  }
  .tabulator .tabulator-footer .tabulator-page.active { color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 10%); }
  .tabulator .tabulator-footer .tabulator-page-size { min-height: 28px; height: 28px; padding: 2px 6px; font-size: 12px; border-color: var(--line); }
  .tabulator .tabulator-footer .tabulator-paginator { color: var(--text-soft); font-size: 12px; font-weight: 400; }
  .status-tag { min-height: 23px; padding: 4px 8px; font-size: 12px; font-weight: 500; border-radius: 6px; line-height: 1.5; }
  .table-primary strong { font-weight: 600; line-height: 1.35; }
  .table-primary small { font-size: 12px; font-weight: 400; line-height: 1.35; }
  .empty-state { padding: 48px 20px; color: var(--text-soft); font-size: 13px; }
  .action-drawer { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 90px rgb(var(--shadow-rgb) / 22%); }
  .drawer-head { min-height: 60px; padding: 16px 20px; background: var(--surface); }
  .drawer-head h2 { font-size: 17px; font-weight: 600; }
  .drawer-close { width: 32px; height: 32px; min-height: 32px; border: 0; background: transparent; border-radius: var(--control-radius); color: var(--text-soft); }
  .drawer-close .button-icon { width: 18px; height: 18px; }
  .drawer-close:hover { background: var(--surface-hover); }
  .drawer-content { padding: 20px; }
  .drawer-layer[data-action="order-progress"] .action-drawer { height: min(640px, calc(100dvh - 64px)); }
  .drawer-layer[data-action="order-progress"] .drawer-content { display: flex; flex: 1; overflow: auto; }
  .order-progress-detail { flex: 1; min-width: 0; min-height: 0; grid-template-rows: auto minmax(80px, 1fr); gap: 12px; padding: 0; }
  .order-progress-scroll { display: flex; flex-direction: column; min-height: 0; overflow: auto; overscroll-behavior: contain; border-radius: 18px; }
  .order-progress-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .order-progress-scroll > .order-progress-list { display: flex; flex-direction: column; flex: 1 0 auto; }
  .order-progress-scroll .work-order-progress { flex: 0 0 auto; overflow: clip; }
  .order-progress-scroll .work-order-progress:only-child { flex-grow: 1; }
  .order-progress-scroll .work-order-progress > header { position: sticky; top: 0; z-index: 2; background: var(--surface-soft); border-color: var(--line); }
  .order-progress-scroll .work-order-progress > header strong { color: var(--text); }
  .order-progress-scroll .work-order-progress > header :is(span, b) { color: var(--text-secondary); }
  .order-progress-context {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
  }
  .order-progress-project { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
  .order-progress-project-name { font-weight: 500; }
  .order-progress-project small { color: var(--muted); font-size: 12px; }
  .order-progress-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    line-height: 19.5px;
  }
  .order-progress-status::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--muted); }
  .order-progress-status[data-status="进行中"]::before { background: var(--hongyu-accent); }
  .order-progress-status[data-status="已完成"]::before { background: var(--success); }
  .order-progress-status[data-status="已作废"]::before { background: var(--danger); }
  .order-progress-compact {
    display: inline-grid;
    grid-template-columns: 64px 34px;
    align-items: center;
    gap: 8px;
    width: 118px;
    min-height: 32px;
    margin: 0 auto;
    padding: 6px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
  }
  .order-progress-compact:hover:not(:disabled) { background: var(--surface-hover); }
  .order-progress-compact:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
  .order-progress-compact:disabled { opacity: .5; cursor: wait; }
  .order-progress-track { display: block; height: 4px; overflow: hidden; border-radius: 999px; background: var(--line-strong); }
  .order-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--hongyu-accent); }
  .order-progress-compact.is-complete .order-progress-fill { background: var(--success); }
  .order-progress-compact em {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .order-progress-empty { color: var(--muted); font-size: 12px; text-align: left; }
  .order-table-due { width: 142px; margin-inline: auto; }
  .order-date-shell.order-table-due input[type="date"] {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    background-position: right 8px center;
  }
  .order-table-due .order-date-placeholder { left: 8px; font-size: 12px; }
  .order-table-due[aria-busy="true"] { opacity: .55; }
  .order-table-due[aria-busy="true"] input { cursor: wait; }
  .drawer-form { gap: 16px; padding: 0; }
  .form-actions { padding-top: 12px; }
}
.collection-toolbar { display: flex; align-items: center; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
/* 分段切换：月度工时范围、排程看板刻度共用。 */
.segmented-switch {
  display: inline-flex;
  align-items: center;
  height: var(--control-height);
  padding: 0 4px;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.segmented-switch .segmented-button {
  height: 28px;
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
}
.segmented-switch .segmented-button.is-active { color: var(--text); background: var(--surface); box-shadow: 0 1px 4px rgb(var(--shadow-rgb) / 9%); }
.inline-search { display: flex; gap: 8px; align-items: center; }
.inline-search label { display: flex; align-items: center; position: relative; }
.inline-search label > .button-icon { position: absolute; left: 10px; color: var(--text-soft); pointer-events: none; }
.inline-search input { width: 250px; padding-left: 34px; }
@media (min-width: 821px) {
  .tabulator .tabulator-cell.cell-actions .row-actions { width: 100%; justify-content: center; }
  #users-table .tabulator-cell.cell-actions { justify-content: center !important; }
  .filter-toolbar .filter-actions { margin-left: 0; }
  .public-project-table { table-layout: fixed; }
  .public-project-table th:first-child { width: 180px; }
  .public-project-table th:nth-child(2) { width: 38%; }
  .public-project-table th:nth-last-child(2) { width: 100px; }
  .public-project-table th:last-child { width: 104px; }
  .drawer-backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
  .action-drawer {
    left: 50%;
    right: auto;
    top: 50%;
    max-height: calc(100dvh - 64px);
    width: min(520px, calc(100vw - 64px));
    transform: translate(-50%, calc(-50% + 10px));
    opacity: 0;
    transition: transform 180ms ease, opacity 150ms ease;
  }
  .drawer-layer.is-open .action-drawer { transform: translate(-50%, -50%); opacity: 1; }
  .drawer-layer:is([data-action="create-route"], [data-action="edit-route"]) .action-drawer { width: min(650px, calc(100vw - 64px)); }
  .drawer-layer .drawer-form { gap: 16px; }
  .drawer-layer .drawer-form label { gap: 6px; min-width: 0; }
  .drawer-form label > input:not([type=checkbox]), .drawer-form label > select, .drawer-form label > textarea { width: 100%; }
  input[type=checkbox], .business-form input[type=checkbox], .business-form .checkbox-field input[type=checkbox] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin: 0;
    border-radius: 6px;
  }
  .checkbox-field { gap: 8px; min-height: 28px; }
  .business-form input[type=checkbox]:checked { background: var(--hongyu-accent-action); border-color: var(--hongyu-accent-action); }
  .drawer-content .business-form > .muted-text { margin-block: 0; }
  .route-step-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0; background: transparent; }
  .route-step-sequence { background: transparent; color: var(--text-soft); font-weight: 500; }
  .overview-date { margin: -2px 0 16px; color: var(--text-soft); font-size: 12px; }
  .overview-metrics { margin-bottom: 20px; }
  .overview-metrics .metric-card { min-height: 88px; gap: 10px; padding: 16px 20px; }
  .overview-metrics .metric-card strong { font-size: var(--font-metric); font-weight: 600; letter-spacing: -.03em; }
  .overview-metrics .metric-card span { font-size: 12px; font-weight: 400; }
  .chart-grid { gap: 16px; }
  .chart-card .chart-host { height: 245px; min-height: 245px; }
  .hours-controls { min-height: 72px; padding: 16px 20px; gap: 16px; align-items: center; flex-wrap: wrap; }
  .hours-month-form { align-items: center; }
  .hours-month-form label { display: flex; width: auto; align-items: center; gap: 10px; }
  .hours-scope-switch { margin-left: auto; }
  .monthly-hours-summary { padding: 10px 20px; background: var(--surface-soft); }
  .monthly-hours-summary strong { font-weight: 500; }
  #reporting-view .report-guided-form { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.4fr); }
  .report-context-section, .report-people-section { padding: 24px; }
  .report-context-section { background: var(--surface-soft); }
  .report-guided-form h3 { font-size: 14px; font-weight: 600; margin-bottom: 20px; }
  .report-guided-form .entry-row, .report-entry-head { grid-template-columns: minmax(140px, 1.15fr) 100px minmax(110px, 1fr) 30px; }
  .report-entry-head { text-align: center; margin-bottom: 8px; }
  .report-guided-form .entry-row input { text-align: center; }
  .report-guided-form .entry-row input[role=combobox] { text-align: left; }
  .report-guided-form .entry-row .icon-button {
    min-height: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    align-self: center;
  }
  .report-guided-form .entry-summary { font-weight: 500; color: var(--text-secondary); }
  .report-date-field { max-width: 190px; }
  .report-context-note { padding: 12px 0; border: 0; border-radius: 0; background: transparent; }
  .report-context-note.is-warning { padding: 12px; background: var(--warning-soft); border-radius: 8px; }
  .report-bulk-tools summary { font-weight: 500; font-size: 12px; }
  .report-submit-bar { padding: 16px 24px; }
  .schedule-board-card .panel-head { min-height: 54px; }
}
.searchable-select-menu[popover] {
  position: fixed;
  inset: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(var(--shadow-rgb) / 16%);
  overflow: auto;
  overscroll-behavior: contain;
}
.searchable-select-menu[popover]:not(:popover-open) { display: none; }
.searchable-select-menu[popover]:popover-open { display: block; }
.drawer-layer .project-adopt-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.project-adopt-form > .project-choice { grid-column: auto; }
.project-adopt-form > .primary-button { white-space: nowrap; }
.project-adopt-form .searchable-select-input { height: 40px; min-height: 40px; }
.searchable-select-menu .searchable-select-option {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}
.searchable-select-menu .searchable-select-option.is-selected { color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 8%); }
@media (prefers-reduced-motion: reduce) {
  .action-drawer { transition: none; }
}
@media (min-width: 821px) {
  .nav-link { font-size: 13px; }
  .order-workspace .order-reporting-setup { padding-bottom: 24px; }
  .order-workspace .order-edit-form input:not([type=checkbox]) { font-weight: 400; }
  .order-workspace .order-setup-table td { padding-block: 8px; }
  .process-insert-before::before, .process-insert-after::after { display: none; }
  .process-only-table .record-icon-button .button-icon { width: 18px; height: 18px; }
  .process-only-table .searchable-select-input { box-shadow: none; border-color: transparent; background: transparent; }
  .process-only-table .searchable-select-input:hover { border-color: var(--line-strong); background: var(--surface-soft); }
  .process-only-table .searchable-select-input:focus { border-color: var(--hongyu-accent); background: var(--surface); }
  .process-draft-row .searchable-select-input { border-color: var(--hongyu-accent); background: var(--surface); }
  .hours-matrix thead th, .hours-matrix thead .hours-person, .hours-matrix thead .hours-date, .hours-matrix tbody th, .hours-matrix td, .hours-matrix tfoot th {
    text-align: center;
  }
  .hours-matrix .hours-person { min-width: 150px; width: 190px; }
  .hours-matrix thead th { font-weight: 600; font-size: 12px; background: var(--surface-soft); }
  .hours-matrix tbody th { font-weight: 500; background: var(--surface); }
  .hours-matrix tbody td { background: var(--surface); }
  .hours-matrix td.hours-total, .hours-matrix th.hours-total, .hours-matrix tfoot td, .hours-matrix tfoot th {
    background: color-mix(in srgb, var(--surface) 93%, var(--hongyu-accent));
  }
  .hours-matrix .hours-detail-button { width: 100%; text-align: center; font-weight: 500; }
  :is(.tabulator, .data-table) [data-report-detail] { white-space: nowrap; padding: 0; font-weight: 500; min-height: 32px; }
  .tabulator .tabulator-header .tabulator-col-title-holder { padding: 0; }
  .tabulator .tabulator-header .tabulator-col .tabulator-col-title { padding-inline: 0; }
  .tabulator .tabulator-header .tabulator-col .tabulator-arrow { right: 4px; }
  .report-guided-form .entry-batch-tools { gap: 0; }
  .report-guided-form .entry-summary { padding: 8px 0; margin: 4px 0 10px; }
  .report-guided-form .report-entry-head { margin-top: 0; }
  .report-context-section > label { margin-bottom: 20px; }
  .report-submit-bar .primary-button { min-width: 104px; }
  .exception-summary { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .exception-summary .metric-card { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 16px 20px; }
  .exception-summary .metric-card:last-child { border-right: 0; }
  .exception-list { padding: 0; }
  .exception-item { margin: 0; padding: 16px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); }
  .exception-item:last-child { border-bottom: 0; }
  .schedule-status-key { gap: 16px; }
  .auth-card {
    width: min(400px, calc(100vw - 48px));
    padding: 32px;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 16px 60px rgb(var(--shadow-rgb) / 10%);
    background: var(--surface);
  }
  .auth-card .brand { margin: 0 0 32px; }
  .auth-card h1 { font-size: 23px; font-weight: 600; margin-bottom: 24px; }
  .auth-form { gap: 20px; }
  .auth-form label { font-size: 12px; font-weight: 500; }
  .auth-form input { min-height: 40px; }
}
@media (min-width: 821px) {
  #reports-filter-form { display: grid; gap: 10px; }
  #schedule-filter-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 12px; }
  :is(#reports-filter-form, #schedule-filter-form) > label { width: auto; min-width: 0; }
  :is(#reports-filter-form, #schedule-filter-form) .filter-actions { flex-wrap: nowrap; padding-bottom: 0; }
  #exceptions-view .overview-grid { grid-template-columns: minmax(220px, .65fr) minmax(0, 1.6fr); }
  #exceptions-view .data-table { min-width: 0; table-layout: fixed; }
  #exceptions-view .overview-grid > :last-child th:first-child { width: 27%; }
  #exceptions-view .overview-grid > :last-child th:nth-child(4) { width: 25%; }
  #exceptions-view .data-table td, #exceptions-view .data-table th { padding-inline: 8px; }
}
@media (min-width: 821px) {
  .data-table :is(th, td).align-number, .data-table :is(th, td).align-text { text-align: center; }
  .drawer-layer:is([data-action="report-detail"], [data-action="edit-report"]) .action-drawer { width: min(680px, calc(100vw - 64px)); }
  .report-detail-content { padding: 0; }
  .report-detail-content .data-table :is(th, td) { text-align: center; }
  .report-detail-content .data-table :is(th, td):first-child { width: 55%; }
  .report-detail-content .data-table :is(th, td):nth-child(2) { width: 110px; text-align: center; }
  .report-edit-context { padding: 0 0 20px; color: var(--text-secondary); font-size: 12px; }
  #edit-report-form [hidden] { display: none; }
  #edit-report-form .entry-batch-tools { padding: 0; margin: 0 0 12px; border: 0; border-radius: 0; background: transparent; gap: 0; }
  #edit-report-form .entry-summary { padding: 0; color: var(--text-secondary); font-weight: 400; }
  #edit-report-form .entry-row, #edit-report-form .report-entry-head { display: grid; margin-bottom: 8px; }
  #edit-report-form .entry-row input { text-align: center; }
  #edit-report-form .entry-row input[role=combobox] { text-align: left; }
  #edit-report-form .entry-row .icon-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    align-self: center;
  }
}
@media (min-width: 821px) {
  .searchable-select::after {
    content: '';
    position: absolute;
    right: 13px;
    top: calc(50% - 4px);
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--text-soft);
    border-bottom: 1.5px solid var(--text-soft);
    transform: rotate(45deg);
    pointer-events: none;
  }
  .searchable-select.is-open::after { top: calc(50% - 1px); transform: rotate(225deg); }
  .searchable-select .searchable-select-input { background-image: none; padding-right: 30px; }
}
@media (min-width: 821px) {
  .action-drawer { overflow: clip; }
  .drawer-head { flex-shrink: 0; }
}
@media (min-width: 821px) {
  .order-column-config { padding: 0; gap: 10px; }
  .order-column-grid { gap: 0; }
  .order-column-choice {
    min-height: 36px;
    padding: 8px 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 400;
  }
  .order-column-choice:hover { background: var(--surface-hover); }
  .order-column-grip { opacity: .5; }
  .order-sync-panel .panel-evidence { margin: 0; font-size: 12px; }
  .sync-issue-detail { padding: 0; }
  .sync-comparison .data-table td { height: 38px; padding-block: 8px; }
}
@media (min-width: 761px) {
  .sync-pending-table { width: 100%; min-width: 1080px; table-layout: fixed; }
  .sync-pending-table .pending-order { width: 128px; }
  .sync-pending-table .pending-product { width: 21%; }
  .sync-pending-table .pending-spec { width: 22%; }
  .sync-pending-table .pending-type { width: 108px; }
  .sync-pending-table .pending-action { width: 224px; }
  .sync-pending-table th, .sync-pending-table td { text-align: center; vertical-align: middle; padding: 8px 12px; white-space: normal; overflow-wrap: anywhere; }
  .sync-pending-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); }
  .sync-pending-table .row-actions { justify-content: center; }
}
@media (min-width: 821px) {
  .drawer-layer:is([data-action="delete-order"], [data-action="delete-report"]) { --danger-content-inset: 22px; }
  .drawer-layer:is([data-action="delete-order"], [data-action="delete-report"]) .danger-context { margin-inline: var(--danger-content-inset); }
  .drawer-layer:is([data-action="delete-order"], [data-action="delete-report"]) :is(#delete-order-form, #delete-report-form) {
    margin-inline: var(--danger-content-inset);
    padding: 12px 0 0;
  }
}
body.is-reordering { cursor: grabbing; user-select: none; }
.reorder-preview {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  box-sizing: border-box;
  border: 2px solid var(--reorder-border);
  border-radius: var(--reorder-radius);
  background: var(--surface);
  box-shadow: var(--reorder-shadow);
  overflow: hidden;
}
.reorder-preview > .order-column-choice { margin: 0; border: 0; border-radius: inherit; background: var(--surface); }
.reorder-preview .data-table { margin: 0; width: 100%; table-layout: fixed; }
.reorder-preview .data-table td { border-bottom: 0; }
.reorder-preview .process-drag-handle, .reorder-preview .order-column-grip { color: var(--accent); opacity: 1; }
.process-only-table tbody.is-reordering > tr:not(.is-reorder-source) { opacity: .55; }
.process-only-table tr.is-reorder-source { outline: none; background: transparent; }
.process-only-table tr.is-reorder-source > td { background: var(--hongyu-accent-soft); border-block: 2px dashed var(--reorder-border); }
.process-only-table tr.is-reorder-source > td > * { opacity: .25; }
.process-only-table tr.is-reorder-source > td:first-child {
  border-left: 2px dashed var(--reorder-border);
  border-radius: var(--reorder-radius) 0 0 var(--reorder-radius);
}
.process-only-table tr.is-reorder-source > td:last-child {
  border-right: 2px dashed var(--reorder-border);
  border-radius: 0 var(--reorder-radius) var(--reorder-radius) 0;
}
.order-column-choice.is-dragging.is-reorder-source {
  transform: none;
  box-shadow: none;
  border: 2px dashed var(--reorder-border);
  border-radius: var(--reorder-radius);
  background: var(--hongyu-accent-soft);
  opacity: 1;
}
.order-column-choice.is-reorder-source > * { opacity: .25; }
@media (min-width: 821px) {
  .filter-toolbar label { grid-template-rows: auto 36px; }
  .filter-toolbar :is(input, select, button) { height: 36px; min-height: 36px; box-sizing: border-box; }
  .filter-toolbar .filter-actions { align-self: end; padding: 0; }
  #reports-filter-form { grid-template-columns: minmax(200px, 1fr) auto; align-items: center; }
  #reports-filter-form > label { display: flex; gap: 0; align-items: center; }
  #reports-filter-form > label > :is(input, select) { width: 100%; min-width: 0; }
}
.process-only-table { border-collapse: separate; border-spacing: 0; }
#reports-filter-form .search-field { max-width: none; }
@media (min-width: 821px) and (max-width: 1200px) {
  #reports-filter-form { grid-template-columns: minmax(180px, 1fr) auto; }
  #reports-filter-form .filter-actions { margin-left: 0; justify-content: flex-end; }
}
@media (min-width: 821px) {
  #processes-view .master-panel { width: 100%; }
  .master-table-process { min-width: 0; }
  .master-table-process th:first-child { width: 88px; }
  .master-table-process th:nth-child(2) { width: auto; }
  .master-table-process th:nth-last-child(2) { width: 88px; }
  .master-table-process th:last-child { width: 100px; }
  .master-name-copy { display: grid; gap: 4px; justify-items: center; padding-block: 2px; }
  .master-name-copy strong { font-weight: 500; color: var(--text); }
  .master-name-copy small { max-width: 100%; color: var(--muted); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .master-table-route th:first-child { width: 140px; }
  .master-table-route th:nth-child(2) { width: 210px; }
  .master-table-route th:nth-child(3) { width: auto; }
}
@media (min-width: 821px) {
}
@media (min-width: 821px) {
  .report-edit-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding-bottom: 16px; }
  .report-edit-context > span { color: var(--muted); }
  #edit-report-form { gap: 12px; }
  #edit-report-form .report-correction-list { max-height: min(48dvh, 420px); overflow-y: auto; scrollbar-gutter: stable; }
  #edit-report-form .entry-row, #edit-report-form .report-entry-head {
    grid-template-columns: minmax(150px, 1fr) 100px minmax(160px, 1.15fr);
    align-items: center;
    gap: 12px;
    margin: 0;
  }
  #edit-report-form .report-entry-head { position: sticky; top: 0; z-index: 1; padding: 10px 8px; background: var(--surface-soft); font-size: 12px; }
  #edit-report-form .entry-row { padding: 8px; border-bottom: 1px solid var(--line); }
  .report-correction-person { display: grid; gap: 2px; text-align: center; min-width: 0; overflow-wrap: anywhere; }
  .report-correction-person strong { font-size: 13px; font-weight: 500; }
  .report-correction-person small { font-size: 12px; color: var(--muted); }
  #edit-report-form .entry-summary { margin: 0; font-size: 12px; }
  #edit-report-form .form-actions { margin-top: 0; }
}
input:is([name="hours"], [data-batch-hours], [data-report-fill-value]) { appearance: textfield; -moz-appearance: textfield; }
input:is([name="hours"], [data-batch-hours], [data-report-fill-value])::-webkit-inner-spin-button, input:is([name="hours"], [data-batch-hours], [data-report-fill-value])::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
@media (min-width: 821px) {
  .sync-row-actions { gap: 4px; flex-wrap: nowrap; }
  .sync-row-actions .text-button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
  .drawer-layer[data-action="sync-issue"] .sync-comparison { width: 100%; margin: 0; }
  .drawer-layer[data-action="sync-issue"] .sync-comparison .data-table { width: 100%; min-width: 0; table-layout: fixed; }
  .drawer-layer[data-action="sync-issue"] .sync-comparison :is(th, td) {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    vertical-align: middle;
  }
  .drawer-layer[data-action="sync-issue"] .sync-comparison :is(th, td):first-child { width: 18%; }
}
.business-form .order-quantity-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.order-quantity-control input { width: 64px; min-width: 0; text-align: center; }
.business-form .order-quantity-control span { flex: 0 0 auto; white-space: nowrap; }
#reports-table-meta { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.report-hours-summary { white-space: nowrap; }
.report-hours-summary strong { font-variant-numeric: tabular-nums; }
#employees-view .employee-panel { min-height: 0; }
#employees-view .collection-toolbar, #employees-view .worker-footer, #employees-view .worker-add-bar, #employees-view .worker-delete-bar { flex: 0 0 auto; }
#employees-view .collection-toolbar { justify-content: space-between; }
#employees-view .employee-table { table-layout: fixed; min-width: 680px; }
#employees-view .employee-table :is(th, td) { width: auto; }
#employees-view .employee-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.worker-footer { padding: 12px 20px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
.worker-add-bar, .worker-delete-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.worker-add-bar label { display: grid; gap: 8px; flex: 1; font-size: 14px; font-weight: 600; }
.worker-add-bar textarea { width: 100%; min-height: 82px; max-height: 130px; resize: vertical; }
.worker-inline-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.worker-add-bar .worker-trade-field { flex: 0 0 200px; }
[data-worker-trade] { width: 132px; }
.worker-delete-bar { justify-content: space-between; }
.worker-editing { background: var(--surface-soft); }
.worker-editing input[name="name"] { width: min(100%, 300px); text-align: center; }
.worker-editing select[name="trade"] { width: min(100%, 132px); }
#worker-edit-form { display: none; }
#employees-view.is-active { padding-bottom: 20px; }
.filter-icon-button { width: var(--control-height); height: var(--control-height); min-height: var(--control-height); }
@media (min-width: 821px) {
  #monthly-hours-view .hours-month-form :is(input, button) { height: var(--control-height); min-height: var(--control-height); }
}
.filter-icon-button:disabled { opacity: .45; cursor: not-allowed; }
.filter-icon-button:focus-visible { outline: 2px solid var(--hongyu-accent-text); outline-offset: 2px; }
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  padding: 24px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.loading-state.is-inline { justify-content: flex-start; min-height: 0; padding: 12px; font-size: 12px; }
.loading-spinner {
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid rgb(var(--hongyu-accent-rgb) / 20%);
  border-top-color: var(--hongyu-accent-text);
  border-radius: 50%;
  animation: aps-loading-spin .8s linear infinite;
}
.tabulator .tabulator-alert { background: color-mix(in srgb, var(--surface) 78%, transparent); }
.tabulator .tabulator-alert .tabulator-alert-msg:is(.tabulator-alert-state-msg, .tabulator-alert-state-error) {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  box-shadow: 0 3px 16px rgb(var(--shadow-rgb) / 6%);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
}
.tabulator-alert-msg .loading-state { min-height: 0; padding: 16px 20px; }
.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error { border: 0; background: transparent; }
/* 行内错误：字段、表格或面板内的失败提示统一为浅红框；顶部提示只用于提交结果。 */
.inline-error, .load-error { margin: 0; padding: 10px 12px; color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: 8px; font-size: 13px; line-height: 1.6; }
.inline-error[hidden] { display: none; }
.load-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px; }
.tabulator-alert-msg .load-error { margin: 0; }
@keyframes aps-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation: none; }
}
@media (min-width: 821px) {
  .master-table-process { width: 100%; table-layout: fixed; }
  .master-table-process th:first-child { width: 120px; }
  .master-table-process td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #processes-view .master-panel .table-scroll { max-height: none; }
  #workspace-drawer:has(#process-form) .action-drawer, #workspace-drawer:has(#delete-process-form) .action-drawer { width: min(460px, calc(100vw - 48px)); }
  #process-form, #delete-process-form { grid-template-columns: 1fr; }
  #delete-process-form .danger-context { margin: 0; }
  #process-form input[readonly] { color: var(--text-soft); background: var(--surface-soft); }
}
#processes-view .master-table-process th:nth-child(1), #processes-view .master-table-process td:nth-child(1) { width: 18%; }
#processes-view .master-table-process th:nth-child(2), #processes-view .master-table-process td:nth-child(2) { width: 38%; }
#processes-view .master-table-process th:nth-child(3), #processes-view .master-table-process td:nth-child(3) { width: 16%; }
#processes-view .master-table-process th:nth-child(4), #processes-view .master-table-process td:nth-child(4), #processes-view .master-table-process th:nth-child(5), #processes-view .master-table-process td:nth-child(5) {
  width: 14%;
}
.process-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 16px; white-space: nowrap; }
.process-action svg { width: 16px; height: 16px; }
.order-setup-table th:nth-child(1), .order-setup-table td:nth-child(1) { width: 130px; }
.order-setup-table th:nth-child(2), .order-setup-table td:nth-child(2) { width: 23%; }
.order-setup-table th:nth-child(3), .order-setup-table td:nth-child(3) { width: 24%; }
.order-setup-table th:nth-child(4), .order-setup-table td:nth-child(4) { width: 116px; }
.order-setup-table th:nth-child(5), .order-setup-table td:nth-child(5) { width: 130px; }
.order-setup-table th:nth-child(6), .order-setup-table td:nth-child(6) { width: 166px; }
.order-setup-table th:nth-child(7), .order-setup-table td:nth-child(7) { width: 68px; }
.order-setup-table td > .searchable-select { width: 100%; min-width: 0; }
.whole-order-tasks { margin: 12px 0 24px; }
.whole-order-tasks .panel-head { padding: 12px 20px; }
#routes-view .master-table-route th:nth-child(1), #routes-view .master-table-route td:nth-child(1) { width: 24%; }
#routes-view .master-table-route th:nth-child(2), #routes-view .master-table-route td:nth-child(2) { width: 26%; }
#routes-view .master-table-route th:nth-child(3), #routes-view .master-table-route td:nth-child(3) { width: 20%; }
#routes-view .master-table-route th:nth-child(4), #routes-view .master-table-route td:nth-child(4), #routes-view .master-table-route th:nth-child(5), #routes-view .master-table-route td:nth-child(5) {
  width: 15%;
}
#processes-view .master-table-process td:last-child { text-align: center; }
#reports-table .report-column-filter, #reports-table .report-date-column-filter .aps-range-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
#reports-table .report-date-column-filter, #reports-table .report-date-column-filter .aps-date-range { display: inline-flex; width: auto; min-width: 0; }
#reports-table .report-column-filter svg, #reports-table .report-date-column-filter svg { width: 12px; height: 12px; opacity: .35; flex-shrink: 0; }
#reports-table .report-column-filter:hover svg, #reports-table .report-column-filter:focus-visible svg, #reports-table .report-date-column-filter .aps-range-trigger:hover svg, #reports-table .report-date-column-filter .aps-range-trigger:focus-visible svg {
  opacity: .9;
}
#reports-table .report-column-filter.is-active, #reports-table .report-date-column-filter.is-active .aps-range-trigger { color: var(--hongyu-accent-text); }
#reports-table .report-column-filter.is-active svg, #reports-table .report-date-column-filter.is-active svg { opacity: 1; }
#reports-table .report-column-filter:focus-visible, #reports-table .report-date-column-filter .aps-range-trigger:focus-visible {
  outline: 2px solid var(--hongyu-accent-text);
  outline-offset: 2px;
}
.report-column-popover {
  position: fixed;
  z-index: 2500;
  box-sizing: border-box;
  width: 272px;
  padding: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 36px rgb(var(--shadow-rgb) / 16%);
  font-size: 13px;
}
.report-column-popover strong { font-weight: 600; }
.report-column-popover label { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: var(--text-secondary); }
.report-column-popover input { width: 100%; min-width: 0; box-sizing: border-box; }
.report-column-popover .filter-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0; }
.report-hour-bounds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#reports-table .report-date-column-filter svg { color: currentColor; flex-basis: 12px; }
.report-hour-bounds input::-webkit-inner-spin-button, .report-hour-bounds input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.report-search-options {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 30px rgb(var(--shadow-rgb) / 13%);
  font-size: 13px;
}
.report-search-options [role="option"] { padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.report-search-options [role="option"]:hover, .report-search-options [aria-selected="true"] {
  background: rgba(var(--hongyu-accent-rgb), .09);
  color: var(--hongyu-accent-text);
}
.report-search-note { padding: 8px 10px; color: var(--text-secondary); font-size: 12px; }
.route-count-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--hongyu-accent-soft);
  color: var(--hongyu-accent-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}
.route-count-link:hover { background: var(--hongyu-accent-soft); }
.route-count-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.route-unconfigured { color: var(--text-faint); }
.drawer-layer[data-action="route-detail"] .action-drawer { width: min(420px, calc(100vw - 64px)); background: var(--surface); }
.drawer-layer[data-action="route-detail"] .drawer-content { padding: 20px 32px 32px; }
.route-process-detail:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 2px; }
.route-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  color: var(--text-soft);
  font-size: 12px;
}
.route-detail-sequence { list-style: none; padding: 0; margin: 0; }
.route-detail-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 16px; min-height: 52px; }
.route-detail-step:not(:last-child)::after { content: ''; position: absolute; top: 30px; bottom: 2px; left: 13px; width: 1px; background: var(--line-strong); }
.route-detail-step:last-child { min-height: 28px; }
.route-detail-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hongyu-accent-soft);
  color: var(--hongyu-accent-text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.route-detail-name { padding: 4px 0 16px; color: var(--text); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.route-detail-step:last-child .route-detail-name { padding-bottom: 0; }
.route-detail-name small { margin-left: 10px; color: var(--danger); font-size: 12px; }
.route-detail-step.is-invalid .route-detail-number { background: var(--danger-soft); color: var(--danger); }
.route-context { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.route-context strong { font-size: 14px; }
.route-context > span { color: var(--text-soft); font-size: 12px; }
.route-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-soft);
}
.route-step-row {
  display: grid;
  grid-template-columns: 28px 26px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
}
.route-step-row .route-step-copy strong { font-size: 13px; font-weight: 500; }
.route-step-row .route-step-copy small { display: block; color: var(--danger); }
.route-step-row .route-step-sequence { width: auto; height: auto; font-size: 12px; background: none; color: var(--text-soft); }
.route-step-actions { display: flex; gap: 4px; }
.route-step-row.is-dragging { background: var(--surface-soft); outline: 1px solid var(--accent); }
.route-inline-picker { padding: 10px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 6px; margin: 6px 0; }
.route-picker-search { display: flex; gap: 8px; align-items: center; }
.route-picker-search input { flex: 1; min-width: 0; }
.route-picker-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
  overscroll-behavior: contain;
}
.route-picker-options button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.route-picker-options button:hover, .route-picker-options button:focus-visible { background: var(--accent-soft); color: var(--accent); }
.route-picker-options small { color: var(--text-soft); font-size: 12px; }
.route-start { margin-top: 8px; }
.catalog-filter { flex: 0 0 auto; margin-bottom: 12px; }
.catalog-filter label { max-width: 320px; }
.sync-unchanged { margin-top: 12px; }
.sync-unchanged > summary { cursor: pointer; color: var(--text-soft); font-size: 12px; padding: 8px 0; }
.route-builder [hidden], [data-worker-action="delete-selected"][hidden] { display: none !important; }
.master-panel .catalog-filter { margin: 0; }
.route-step-list { gap: 0; }
.route-selected-head > span { font-size: 12px; font-weight: 500; color: var(--text-soft); }
.order-back-button { white-space: nowrap; }
.drawer-layer[data-action="monthly-details"] .action-drawer { width: min(1120px, calc(100vw - 64px)); }
.monthly-detail-table { min-width: 800px; }
.monthly-detail-table :is(th, td) { text-align: center; vertical-align: middle; }
.monthly-detail-table th:first-child { width: 13%; }
.monthly-detail-table th:nth-child(2) { width: 17%; }
.monthly-detail-table th:nth-child(3) { width: 24%; }
.monthly-detail-table th:nth-child(4) { width: 27%; }
.monthly-detail-table th:nth-child(5) { width: 9%; }
.monthly-detail-table th:nth-child(6) { width: 10%; text-align: center; }
.monthly-detail-table .number-cell { text-align: center; }
.monthly-detail-table button { margin-inline: auto; text-align: center; }
.route-picker-error { color: var(--danger); font-size: 12px; margin: 8px 0 0; }

/* 管理看板：项目交付层（全部已授权级别）与生产运行层（L3 及以上）。 */
.delivery-panel { margin-bottom: var(--panel-gap); padding: 0; }
.delivery-head { align-items: center; gap: 12px; }
.delivery-head h2 { flex: 0 0 auto; }
.delivery-filter { justify-content: flex-end; margin-left: auto; padding: 0; }
.delivery-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.delivery-stat { display: grid; gap: 2px; padding: 12px var(--surface-padding); border-left: 1px solid var(--line); }
.delivery-stat:first-child { border-left: 0; }
.delivery-stat span { color: var(--text-soft); font-size: 12px; }
.delivery-stat strong { font-size: var(--font-metric); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.delivery-stat.is-danger strong { color: var(--danger); }
.delivery-stat.is-warning strong { color: var(--warning); }
.delivery-stat.is-muted strong { color: var(--text-secondary); }
.delivery-table { table-layout: fixed; width: 100%; }
.delivery-table th:first-child, .delivery-table td:first-child { text-align: left; }
.delivery-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.delivery-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.delivery-chevron { flex: 0 0 auto; color: var(--text-soft); transition: transform .16s var(--ease-organic); }
.delivery-project.is-expanded .delivery-chevron { transform: rotate(90deg); }
.delivery-project-name { display: grid; min-width: 0; }
.delivery-project-name strong, .delivery-project-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-project-name small { color: var(--text-soft); font-size: 12px; }
.delivery-project:hover { background: var(--surface-hover); }
.risk-chips { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.risk-chip { padding: 1px 8px; border-radius: 6px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.risk-chip.is-overdue { background: var(--danger-soft); color: var(--danger); }
.risk-chip.is-due_soon { background: var(--warning-soft); color: var(--warning); }
.risk-chip.is-no_due { background: var(--disabled-soft); color: var(--disabled); }
.risk-chip.is-normal { background: var(--success-soft); color: var(--success); }
.delivery-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.delivery-progress-bar { position: relative; width: 72px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--disabled-soft); }
.delivery-progress-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.delivery-muted { color: var(--text-soft); font-size: 12px; }
.delivery-orders > td { padding: 0 0 8px 34px; background: var(--surface-soft); }
.delivery-order-table { table-layout: fixed; width: 100%; background: transparent; }
.delivery-order-table th { background: transparent; }
.delivery-order-table th:nth-child(-n+2), .delivery-order-table td:nth-child(-n+2) { text-align: left; }
.delivery-product span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-due.is-overdue { color: var(--danger); font-weight: 600; }
.delivery-due.is-due_soon { color: var(--warning); font-weight: 600; }
.delivery-due.is-no_due { color: var(--text-soft); }
/* 管理看板“生产运行”：待处理一行，排产执行与用工两张摘要卡，周工时趋势。 */
.overview-head-panel { margin-bottom: var(--panel-gap); padding: 0; }
.attention-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px var(--surface-padding); border-top: 1px solid var(--line); }
.attention-strip-label { margin-right: 4px; color: var(--text-soft); font-size: 13px; }
.attention-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.attention-chip:hover { background: var(--surface-hover); }
.attention-chip strong { font-variant-numeric: tabular-nums; }
.attention-chip.is-warning strong { color: var(--warning); }
.attention-chip.is-danger strong { color: var(--danger); }
.attention-chip.is-info strong { color: var(--info); }
.attention-chip b { color: var(--hongyu-accent-text); font-size: 12px; font-weight: 500; }
.attention-clear-line { color: var(--success); font-size: 13px; }
.overview-card { display: flex; min-width: 0; flex-direction: column; padding: 0; }
.overview-card .panel-head { justify-content: space-between; }
.overview-card .text-button { min-height: 32px; padding: 0 8px; font-size: 13px; }
.overview-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.overview-stat { display: grid; gap: 2px; justify-items: center; padding: 12px 6px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--text-secondary); cursor: pointer; }
.overview-stat:first-child { border-left: 0; }
.overview-stat:hover { background: var(--surface-hover); }
.overview-stat span { color: var(--text-soft); font-size: 12px; }
.overview-stat strong { color: var(--text); font-size: var(--font-metric); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.overview-stat.is-alert strong { color: var(--danger); }
.overview-stat.is-warn strong { color: var(--warning); }
.overview-plan-list { margin: 0; padding: 4px 0; list-style: none; }
.overview-plan-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 84px; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px var(--surface-padding); border: 0; background: transparent; color: var(--text); font-size: 13px; text-align: center; cursor: pointer; }
.overview-plan-list button:hover { background: var(--surface-hover); }
.overview-plan-list button > span:not(.overview-plan-name, .compare-state) { white-space: nowrap; color: var(--text-secondary); }
.overview-plan-list .compare-state { justify-self: center; }
.overview-plan-name { display: grid; min-width: 0; text-align: left; }
.overview-plan-name strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.overview-plan-name small { color: var(--text-soft); font-size: 12px; }
.overview-empty, .overview-more { margin: 0; padding: 20px var(--surface-padding); color: var(--text-soft); font-size: 13px; }
.overview-more { padding-block: 4px 12px; }
.overview-staff-table { width: 100%; min-width: 0; table-layout: fixed; }
.overview-staff-table :is(th, td):first-child { width: 76px; }
.overview-staff-table :is(th, td):nth-child(2) { width: 52px; }
.overview-staff-table :is(th, td) { padding: 8px 6px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.overview-staff-table th[scope="row"] { font-weight: 600; }
.overview-staff-table td:nth-child(2) { color: var(--text-soft); }
.overview-staff-empty { color: var(--text-faint); }
.overview-staff-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 8px; border-radius: 8px; font-size: 13px; }
.overview-staff-cell small { color: var(--text-soft); font-size: 12px; }
.overview-staff-cell small span { white-space: nowrap; }
.overview-staff-cell.is-overtime { background: var(--warning-soft); }
.overview-staff-cell.is-overtime small { color: var(--warning); }
.overview-staff-cell:is(.is-short, .is-missing) { background: var(--danger-soft); color: var(--danger); }
.overview-staff-cell:is(.is-short, .is-missing) small { color: var(--danger); }

/* 工厂日历：全年 12 个月平铺，点选日期切换上班／休息。 */
.calendar-panel { padding: 0; }
.calendar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; min-height: var(--panel-header-height); padding: 10px var(--surface-padding); border-bottom: 1px solid var(--line); }
.calendar-year { display: inline-flex; align-items: center; gap: 6px; }
.calendar-year strong { min-width: 72px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.calendar-summary { color: var(--text-secondary); }
.calendar-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.calendar-legend { display: inline-flex; align-items: center; gap: 16px; color: var(--text-soft); font-size: 13px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 2px; }
.legend-rest { background: var(--danger-soft); }
.legend-adjusted { border: 1px solid var(--line-strong); background: linear-gradient(var(--warning), var(--warning)) center bottom 2px / 6px 2px no-repeat; }
.calendar-save { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-secondary); }
.calendar-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; padding: var(--surface-padding); }
.calendar-month header { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 6px; }
.calendar-month header span { color: var(--text-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.calendar-weekday { padding: 4px 0; color: var(--text-soft); font-size: 12px; text-align: center; }
.calendar-day { position: relative; display: grid; place-items: center; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
button.calendar-day { cursor: pointer; }
button.calendar-day:hover { background: var(--surface-hover); }
button.calendar-day:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.calendar-day.is-rest { background: var(--danger-soft); color: var(--danger); }
button.calendar-day.is-rest:hover { background: color-mix(in srgb, var(--danger-soft) 70%, var(--danger) 12%); }
.calendar-day.is-adjusted::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 6px; height: 2px; border-radius: 2px; background: var(--warning); transform: translateX(-50%); }
.calendar-day.is-today { font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-day.is-pending { border-color: var(--accent); border-style: dashed; }
@media (max-width: 1280px) { .calendar-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 统一组件：同一类控件只在此处定义尺寸、字体与状态外观，页面样式只负责布局。 */
@media (min-width: 821px) {
  :is(.primary-button, .secondary-button, .danger-button, .text-button, .add-row) {
    min-height: var(--control-height); padding: 0 12px; gap: 6px; border-radius: var(--control-radius);
    font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: .01em;
  }
  :is(.primary-button, .secondary-button, .danger-button, .text-button, .add-row) .button-icon { width: 15px; height: 15px; }
  :is(.page-create-button, .topbar-actions .text-button) { min-height: 32px; padding: 0 12px; }
  :is(.filter-icon-button, .order-icon-button) {
    width: var(--control-height); height: var(--control-height); min-height: var(--control-height); padding: 0;
    border-radius: var(--control-radius); font-size: 13px;
  }
  :is(.record-icon-button, .process-action, .compact-cell-action) {
    height: 32px; min-height: 32px; gap: 6px; border-radius: var(--control-radius); font-size: 12px; font-weight: 600;
  }
  .record-icon-button { width: 32px; padding: 0; }
  :is(.process-action, .compact-cell-action) { padding: 0 10px; }
  :is(.record-icon-button, .process-action) :is(.button-icon, svg) { width: 16px; height: 16px; }
  .count-badge {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
    color: var(--hongyu-accent-text); background: rgb(var(--hongyu-accent-rgb) / 9%); font-size: 12px; font-weight: 600;
  }
  :is(.data-table, .master-table, .sync-comparison, .audit-diff, .execution-table, .order-setup-table, .monthly-detail-table) th,
  .tabulator .tabulator-header :is(.tabulator-col, .tabulator-col-title, .tabulator-col-content) {
    color: var(--text-soft); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  .tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col { background: var(--surface-soft); }
  /* 原生下拉与可搜索下拉使用同一箭头：细线、浅灰、距右侧 12px。 */
  select:not([multiple]):not(.searchable-select-native) {
    appearance: none; -webkit-appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23707b8b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
  }
  .tabulator .tabulator-footer select.tabulator-page-size { padding-right: 24px; background-position: right 7px center; background-size: 8px 5px; }
  :is(.data-table, .master-table, .sync-comparison, .audit-diff, .execution-table, .order-setup-table, .monthly-detail-table) td,
  .tabulator .tabulator-cell { color: var(--text); font-size: 13px; }
}

/* 启用/停用类状态统一为圆点加文字；执行状态保留胶囊。 */
.status-tag:is(.status-启用, .status-停用, .status-禁用, .status-工序已禁用, .status-待配置),
:is(.master-table-process, .master-table-route) .status-tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 0; padding: 0;
  border: 0; border-radius: 0; color: var(--text-soft); background: transparent; font-size: 12px; font-weight: 500;
}
:is(.status-tag:is(.status-启用, .status-停用, .status-禁用, .status-工序已禁用, .status-待配置), :is(.master-table-process, .master-table-route) .status-tag)::before {
  content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor;
}
.status-tag.status-启用 { color: var(--success); }
.status-tag.status-工序已禁用 { color: var(--warning); }

/* 2026-10-10 用户确认保留改版前外观，仅采纳四项：交期文字点击修改、删除放进详情、右侧抽屉、列宽按内容分配。 */
/* 交期：列表显示为文字，逾期红字、未设置灰字；点击打开共享日历修改隐藏的日期字段。 */
.order-date-shell.order-table-due { position: relative; display: block; width: auto; margin-inline: auto; }
.order-due-button { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.order-due-button:hover:not(:disabled), .order-due-button:focus-visible { border-color: rgb(var(--hongyu-accent-rgb) / 34%); background: var(--surface); }
.order-due-button:disabled { cursor: wait; opacity: .55; }
:is(.order-due-button, .order-due-text).is-overdue { color: var(--danger); font-weight: 600; }
:is(.order-due-button, .order-due-text, .order-cell-text).is-empty { color: var(--text-soft); }
.order-date-shell .order-due-input { position: absolute; top: 0; left: 0; width: 1px !important; min-width: 0 !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }

/* 删除放进详情：订单详情页头、报工详情底部、编辑弹窗左下角。 */
.order-workspace .panel-head .row-actions { gap: 10px; }
.report-detail-actions { justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.report-detail-actions .danger-button, .form-actions .form-actions-start { margin-right: auto; }

/* 右侧抽屉：看着列表改的场景（工序、路线、报工详情与修改、来源明细、审计差异、待处理对照、工序进度、字段配置）。 */
@media (min-width: 821px) {
  .drawer-layer:is([data-action="manage-tasks"], [data-action="route-detail"], [data-action="create-route"], [data-action="edit-route"], [data-action="report-detail"], [data-action="edit-report"], [data-action="order-progress"], [data-action="work-order-progress"], [data-action="sync-issue"], [data-action="audit-detail"], [data-action="order-columns"], [data-action="monthly-details"], [data-action="planning"]) .action-drawer {
    top: 12px; right: 12px; bottom: 12px; left: auto;
    width: min(600px, calc(100vw - 48px)); height: auto; max-height: none;
    transform: none; translate: 24px 0; opacity: 0;
    transition: translate 180ms ease, opacity 150ms ease;
  }
  .drawer-layer.is-open:is([data-action="manage-tasks"], [data-action="route-detail"], [data-action="create-route"], [data-action="edit-route"], [data-action="report-detail"], [data-action="edit-report"], [data-action="order-progress"], [data-action="work-order-progress"], [data-action="sync-issue"], [data-action="audit-detail"], [data-action="order-columns"], [data-action="monthly-details"], [data-action="planning"]) .action-drawer { translate: 0 0; opacity: 1; }
  .drawer-layer[data-action="manage-tasks"] .action-drawer { width: min(760px, calc(100vw - 48px)); }
  .drawer-layer:is([data-action="sync-issue"], [data-action="audit-detail"]) .action-drawer { width: min(760px, calc(100vw - 48px)); }
  .drawer-layer:is([data-action="create-route"], [data-action="edit-route"]) .action-drawer { width: min(650px, calc(100vw - 48px)); }
  .drawer-layer:is([data-action="report-detail"], [data-action="edit-report"]) .action-drawer { width: min(680px, calc(100vw - 48px)); }
  .drawer-layer:is([data-action="route-detail"], [data-action="order-columns"]) .action-drawer { width: min(450px, calc(100vw - 48px)); }
  .drawer-layer[data-action="monthly-details"] .action-drawer { width: min(1120px, calc(100vw - 48px)); }
  .drawer-layer:is([data-action="order-progress"], [data-action="work-order-progress"]) .action-drawer { width: min(640px, calc(100vw - 48px)); height: auto; }
}

/* 排产沿用右侧抽屉，普通表单与紧凑工序表。 */
.drawer-layer[data-action="planning"] .action-drawer { width: min(1080px, calc(100vw - 48px)); }
.planning-form { display: grid; gap: 16px; }
.planning-form > * { min-width: 0; }
.planning-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.planning-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.planning-form label { display: grid; gap: 6px; color: var(--text-soft); font-size: 13px; }
.planning-form :where(input:not([type="checkbox"]), select) { width: 100%; min-width: 0; height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.planning-form input[readonly] { background: var(--surface-soft); color: var(--text-soft); }
.planning-note { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.7; }
.planning-context { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.planning-context span, .planning-form small, #planning-board small { color: var(--text-soft); font-size: 12px; }
.planning-batches { display: flex; flex-wrap: wrap; gap: 8px; }
.planning-batches [aria-current="true"] { border-color: var(--blue); color: var(--blue); }
.planning-step-settings { display: grid; gap: 8px; }
.planning-section, .planning-step-settings details { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.planning-form summary { cursor: pointer; font-weight: 600; }
.planning-form summary small { margin-left: 10px; font-weight: 400; }
.planning-form details[open] > summary { margin-bottom: 16px; }
.planning-step-settings details > .secondary-button { margin-top: 12px; }
.planning-crews { display: grid; gap: 8px; margin: 12px 0; justify-items: start; }
.planning-step-settings .planning-note { margin: 12px 0; }
.planning-crews [data-crew-row] { display: grid; grid-template-columns: 180px 130px 32px; align-items: end; gap: 10px; }
.planning-predecessors { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.planning-predecessors legend { margin: 4px 0 10px; font-size: 13px; color: var(--text-soft); }
.planning-predecessors label { display: flex; align-items: center; gap: 6px; }
.planning-table-scroll { overflow: auto; max-width: 100%; }
.planning-form .data-table, #planning-board .data-table { width: 100%; }
.planning-form .data-table :is(th, td), #planning-board .data-table :is(th, td) { text-align: center; vertical-align: middle; padding: 8px; }
.planning-plan-table { min-width: 960px; table-layout: fixed; }
.planning-plan-table th:nth-child(1) { width: 150px; }
.planning-plan-table th:nth-child(2), .planning-plan-table th:nth-child(3) { width: 64px; }
.planning-plan-table th:nth-child(4) { width: 136px; }
.planning-plan-table th:nth-child(5) { width: 104px; }
.planning-plan-table th:nth-child(6) { width: 80px; }
.planning-plan-table th:nth-child(7), .planning-plan-table th:nth-child(8) { width: 148px; }
.planning-plan-table th:nth-child(9) { width: 44px; }
.planning-plan-table td:is(:nth-child(5), :nth-child(6)) { font-variant-numeric: tabular-nums; }
/* DSR 以组小时代替标准工时与作业量两列，其后依次为人时、开始、结束。 */
.planning-plan-table.is-dsr th:nth-child(6), .planning-plan-table.is-dsr th:nth-child(7) { width: 148px; }
.planning-plan-table.is-dsr th:nth-child(8) { width: 44px; }
.planning-plan-table .planning-hours { font-variant-numeric: tabular-nums; }
/* 标准工时单位作为框内后缀（输入组），数字靠右紧接单位，避免第二行说明撑高行。 */
.planning-unit-input, .capacity-unit { display: flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.planning-unit-input:hover, .capacity-unit:hover { border-color: rgb(var(--accent-rgb) / 38%); }
.planning-unit-input:focus-within, .capacity-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 12%); }
.planning-form .planning-unit-input input, .capacity-unit input { flex: 1; min-width: 0; width: 100%; height: 34px; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: right; font-variant-numeric: tabular-nums; appearance: textfield; }
.planning-unit-input input::-webkit-inner-spin-button, .planning-unit-input input::-webkit-outer-spin-button, .capacity-unit input::-webkit-inner-spin-button, .capacity-unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.planning-unit-input input:focus-visible, .capacity-unit input:focus-visible { outline: none; }
.planning-unit-input > span, .capacity-unit > span { flex: none; color: var(--text-soft); font-size: 12px; white-space: nowrap; }
/* 日期为空时在框内显示“待补／送出／返回”，手排日期用主色边框区分。 */
.planning-date { position: relative; display: block; }
.planning-date:has(input.is-empty)::after { content: attr(data-hint); position: absolute; inset: 0 34px 0 10px; display: flex; align-items: center; justify-content: center; color: var(--text-soft); font-size: 13px; pointer-events: none; }
.planning-date input.is-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
:is(.planning-date input, .planning-hours).is-manual { border-color: var(--blue); background: var(--hongyu-accent-soft); }
.planning-late { color: var(--danger); }
.planning-plan-table [data-planning-action="auto-dates"][hidden] { display: none; }
/* 用工需求：每格为需要人数，缺口加班可补为黄、补不上为红。 */
.planning-staff-summary { margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 13px; line-height: 1.6; }
.planning-staff-summary b { font-weight: 600; }
.planning-staff-summary .is-short { color: var(--danger); }
.planning-staff-summary .is-overtime { color: var(--warning); }
.planning-staff-table { min-width: 100%; }
.planning-staff-table :is(th, td) { min-width: 132px; padding: 6px 4px; text-align: center; vertical-align: middle; }
.planning-staff-table :is(th[scope="row"], thead th:first-child) { position: sticky; left: 0; z-index: 1; min-width: 104px; background: var(--surface); }
.planning-staff-table thead th:first-child { z-index: 2; background: var(--surface-soft); }
.planning-staff-table :is(thead th:nth-child(2), td:nth-child(2)) { min-width: 64px; color: var(--text-soft); }
.planning-staff-empty { color: var(--text-faint); }
.planning-staff-cell { display: inline-flex; min-width: 124px; flex-direction: column; align-items: center; gap: 1px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; }
.planning-staff-cell small { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.planning-staff-cell:hover { background: var(--surface-hover); }
.planning-staff-cell.is-overtime { background: var(--warning-soft); }
.planning-staff-cell.is-overtime small { color: var(--warning); }
.planning-staff-cell:is(.is-short, .is-missing) { background: var(--danger-soft); color: var(--danger); }
.planning-staff-cell:is(.is-short, .is-missing) small { color: var(--danger); }
.planning-staff-cell[aria-pressed="true"] { border-color: var(--accent); }
.planning-staff-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.planning-load-detail { display: grid; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.planning-load-detail p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 0; }
.planning-load-detail :is(p span, small) { color: var(--text-soft); font-size: 12px; }
.planning-load-detail .data-table :is(th, td) { text-align: center; vertical-align: middle; padding: 8px; }
.planning-load-detail small { display: block; }
.capacity-table-host { display: grid; justify-items: start; gap: 12px; overflow-x: auto; padding: 16px var(--surface-padding) 20px; }
.capacity-table { width: auto; table-layout: fixed; }
.capacity-trade-col { width: 200px; }
.capacity-people-col { width: 132px; }
.capacity-hours-col { width: 140px; }
.capacity-action-col { width: 72px; }
.capacity-table :is(th, td) { padding: 8px 12px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.capacity-table :is(th, td):first-child { text-align: left; }
.capacity-table input[name="trade"] { width: 100%; height: 36px; }
.capacity-note { margin: 0; color: var(--text-secondary); font-size: 13px; }
.capacity-note .text-button { margin-left: 8px; }
.capacity-setting { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }
.capacity-setting .capacity-unit { width: 112px; }
#calendar-capacity-form .calendar-save[hidden] { display: none; }
#calendar-capacity-form .inline-error { margin: 0 var(--surface-padding) 16px; }
.planning-plan-table small, #planning-board small { display: block; margin-top: 1px; }
.planning-specs input { min-width: 90px; }
.planning-specs td:first-child input { min-width: 220px; }
.planning-specs th { white-space: nowrap; }
.planning-form .form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.planning-form [data-planning-action="delete-plan"] { margin-right: auto; color: var(--danger); }
.planning-error { margin-bottom: 12px; }
.planning-result { display: grid; gap: 8px; }
.planning-result > p { margin: 0; }
.planning-result details { margin: 12px 0; font-size: 13px; }

.planning-plan-table input { text-align: center; }
.master-table-process td strong:has(+ .planning-kind) { display: inline; }
.planning-kind { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 8px; min-height: 20px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 12px; font-weight: 500; vertical-align: middle; }
.planning-plan-table td:first-child .planning-kind { display: table; margin: 4px auto 0; }
.planning-crew-toggle { display: block; margin: 2px auto 0; padding: 0; border: 0; background: none; color: var(--text-soft); font: inherit; font-size: 12px; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.planning-crew-toggle:hover, .planning-crew-toggle[aria-expanded="true"] { color: var(--accent); }
.planning-plan-table [data-crew-edit] > td { padding: 4px 8px 12px; background: var(--surface-soft); }
.planning-plan-table [data-crew-edit] .planning-crews { margin: 0; justify-items: center; }
.planning-plan-table [data-crew-edit] input { text-align: left; }

.planning-step-settings summary .process-drag-handle { vertical-align: middle; margin-right: 4px; }
.planning-step-settings .is-dragging { opacity: .55; border-color: var(--blue); }
