:root {
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: #eff6ff;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #eceff5;
  --fg: #1f2937;
  --muted: #94a3b8;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --side: #ffffff;
  --side-fg: #64748b;
  --side-active: #eff6ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.sidebar { width: 208px; background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid var(--border); }
.brand { padding: 22px 20px 18px; font-size: 17px; font-weight: 700; color: var(--fg); line-height: 1.45; letter-spacing: .5px; }
.nav-search { padding: 4px 12px 6px; position: relative; }
.nav-search input { width: 100%; font-size: 12.5px; padding: 6px 24px 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--fg); outline: none; }
.nav-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(14,116,144,.12); }
.nav-search button { position: absolute; right: 18px; top: 50%; transform: translateY(-40%); border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.nav-search button:hover { color: var(--fg); }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-group { margin-bottom: 2px; }
.nav-group-title { font-size: 11px; letter-spacing: 1px; color: var(--muted); padding: 8px 14px 2px; font-weight: 700; opacity: .75; }
.nav-group + .nav-group { border-top: 1px solid var(--border); padding-top: 3px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; margin: 1px 0; border-radius: 9px; color: var(--side-fg); cursor: pointer; text-decoration: none; user-select: none; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item:hover { background: #f1f5f9; color: var(--fg); }
.nav-item.active { background: var(--side-active); color: var(--accent); font-weight: 600; }
.nav-caret { font-size: 11px; color: var(--muted); transition: transform .15s; }
.nav-caret.open { transform: rotate(180deg); }
.nav-sub { padding: 0 0 3px 12px; display: flex; flex-direction: column; gap: 0; }
.nav-sub-item { padding: 4px 12px; border-radius: 7px; font-size: 12.5px; line-height: 1.35; color: var(--side-fg); cursor: pointer; text-decoration: none; user-select: none; transition: background .12s, color .12s; border-left: 2px solid transparent; }
.nav-sub-item:hover { background: #f1f5f9; color: var(--fg); }
.nav-sub-item.on { background: var(--side-active); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.side-foot { padding: 14px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); line-height: 1.6; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; background: var(--card); border-bottom: 1px solid var(--border); }
/* 采集器离线告警条：顶栏下面通栏，黄色=10分钟没数据，红色=超过60分钟 */
.collect-alert { display: flex; align-items: center; gap: 10px; padding: 10px 26px; cursor: pointer; font-size: 14px; }
.collect-alert.lv-warn { background: #fef3c7; color: #92400e; border-bottom: 1px solid #fcd34d; }
.collect-alert.lv-down { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #fca5a5; }
.collect-alert:hover { filter: brightness(.97); }
.collect-alert .ca-icon { font-size: 16px; }
.collect-alert .ca-text { font-weight: 700; }
.collect-alert .ca-sub { font-size: 12px; opacity: .85; }
.collect-alert .ca-go { margin-left: auto; font-weight: 600; text-decoration: underline; white-space: nowrap; }
.title { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.identity { display: flex; align-items: center; gap: 8px; }
.id-label { color: var(--muted); font-size: 13px; }
.id-select { padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--fg); outline: none; transition: border .15s, box-shadow .15s; }
.id-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.role-tag { background: var(--accent-soft); color: var(--accent); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

.content { flex: 1; overflow-y: auto; padding: 24px 26px; }

/* z-index 必须高于弹窗遮罩(200)，否则弹窗里点保存的提示会被盖住，用户以为没反应 */
.alert-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: min(880px, calc(100% - 24px)); background: #b91c1c; color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; z-index: 10000; box-shadow: 0 10px 28px rgba(185,28,28,.3); cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.alert-bar b { flex: 0 0 auto; font-weight: 800; }
.alert-bar span { flex: 1; }
.alert-bar i { flex: 0 0 auto; font-style: normal; opacity: .85; font-size: 12px; white-space: nowrap; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 20px; border-radius: 12px; z-index: 9999; box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: 14px; }
.loading { padding: 60px; color: var(--muted); text-align: center; }

.stat-row { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; transition: box-shadow .18s, transform .18s; }
.stat:hover { box-shadow: 0 6px 24px rgba(15,23,42,.06); transform: translateY(-1px); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--fg); letter-spacing: -.5px; }
.stat-label { color: var(--muted); margin-top: 4px; font-size: 13px; }

.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mod-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: box-shadow .18s, transform .18s; }
.mod-card:hover { box-shadow: 0 6px 24px rgba(15,23,42,.06); transform: translateY(-1px); }
.mod-card.done { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4, #fff); }
.mod-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mod-name { font-weight: 700; font-size: 15px; }
.mod-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-weight: 500; }
.mod-card.done .mod-badge { background: var(--ok-soft); color: var(--ok); }
.mod-desc { color: var(--muted); font-size: 13px; line-height: 1.6; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--fg); outline: none; transition: border .15s, box-shadow .15s; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: #fafbfd; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot td { background: #fafbfd; font-weight: 600; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.off { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.loadbar { display: flex; gap: 3px; }
.loadcell { position: relative; width: 14px; height: 34px; border-radius: 3px; background: var(--ok-soft); overflow: hidden; }
.loadcell.near { background: var(--warn-soft); }
.loadcell.over { background: var(--danger-soft); }
.loadcell.nodata { background: #e5e7eb; }
.loadcell .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ok); opacity: .85; }
.loadcell.near .fill { background: var(--warn); }
.loadcell.over .fill { background: var(--danger); }
.loadcell.nodata .fill { display: none; }
.ops { white-space: nowrap; }
.empty { padding: 44px; text-align: center; color: var(--muted); font-size: 14px; }

.btn { padding: 8px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--fg); cursor: pointer; font-size: 14px; font-weight: 500; transition: all .15s; }
.btn:hover { background: #f8fafc; border-color: #e2e8f0; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.25); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: #fca5a5; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }

.perm-layout { display: flex; gap: 16px; align-items: flex-start; }
.perm-roles { width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; flex-shrink: 0; }
.perm-title { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.perm-role { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 9px 12px; border: none; background: transparent; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--fg); text-align: left; transition: background .12s; }
.perm-role .pr-name { font-weight: 600; font-size: 14px; }
.perm-role .pr-note { font-size: 11px; color: var(--muted-foreground); line-height: 1.35; }
.perm-role:hover { background: #f1f5f9; }
.perm-role.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mini { font-size: 11px; color: var(--muted); }
.perm-grid { flex: 1; min-width: 0; overflow-x: auto; }
.perm-table td { text-align: center; }
.perm-table td:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.perm-table th:first-child { white-space: nowrap; }
.perm-table { table-layout: auto; }
.perm-table th, .perm-table td { padding-left: 10px; padding-right: 10px; }
.perm-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.perm-table tr.override td { background: var(--warn-soft); }
.perm-table tr.perm-group td { background: #eef2f7; font-weight: 700; font-size: 12px; color: var(--muted-foreground); padding: 6px 10px; }
.hint { color: var(--muted); font-size: 12px; }

.placeholder { background: var(--card); border: 1px dashed #dbe2ec; border-radius: 16px; padding: 30px; max-width: 560px; }
.ph-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.ph-list { margin: 0 0 14px 20px; color: #475569; line-height: 2; }
.ph-note { color: var(--muted); font-size: 13px; }
.deny { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 50px; text-align: center; }
.deny-title { font-size: 19px; font-weight: 700; color: var(--danger); margin-bottom: 8px; }
.deny-body { color: var(--muted); }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { width: 440px; max-width: 92vw; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(15,23,42,.22); max-height: 86vh; overflow-y: auto; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.whf-l { font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.whf-i { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--fg); outline: none; }
.whf-i:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.whf-i:disabled { background: #f8fafc; color: var(--muted); }
.form label { display: block; margin: 13px 0 5px; color: var(--muted); font-size: 13px; }
.form input, .form select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--fg); outline: none; transition: border .15s, box-shadow .15s; }
.form input:focus, .form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form input[type=checkbox] { width: auto; }
.form .check { display: flex; align-items: center; gap: 6px; color: var(--fg); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.date-in { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; outline: none; }
.date-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
td.done { text-decoration: line-through; color: #16a34a; font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); transition: all .15s; }
.tab:hover { color: var(--fg); border-color: #e2e8f0; }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(59,130,246,.25); }
.tabs.sub { margin-top: 8px; padding: 8px 10px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; }
.tab.sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.plan-detail-row > td { background: #f8fafc; padding: 10px 16px; }
.plan-detail-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-detail-card { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.pc-color { font-weight: 600; }
.pc-size { color: var(--muted); background: #eef2ff; border-radius: 6px; padding: 1px 7px; }
.pc-qty { font-weight: 700; color: #0e7490; }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.board-group { margin: 18px 0 10px; font-size: 14px; font-weight: 700; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.board-group-count { font-weight: 400; font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--border); padding: 2px 10px; border-radius: 99px; }
.board-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; transition: box-shadow .18s, transform .18s; }
.board-card:hover { box-shadow: 0 6px 24px rgba(15,23,42,.06); transform: translateY(-1px); }
.board-card.recorded { border-color: #bfdbfe; background: linear-gradient(180deg, #eff6ff, #fff); }
.board-top { display: flex; justify-content: space-between; align-items: center; }
.board-code { font-weight: 700; font-size: 15px; }
.board-status { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-weight: 500; }
.board-status.开机 { background: var(--ok-soft); color: var(--ok); }
.board-status.故障 { background: var(--danger-soft); color: var(--danger); }
.board-type { color: var(--muted); font-size: 12px; margin: 5px 0 10px; }
.board-metric { margin-bottom: 6px; }
.b-num { font-size: 26px; font-weight: 800; color: var(--fg); }
.b-unit { color: var(--muted); font-size: 12px; margin-left: 4px; }
.board-pay { font-size: 13px; color: var(--ok); font-weight: 600; }
.board-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.board-sub .warn { color: var(--warn); }
.board-extra { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.board-side { flex: 1; min-width: 300px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.board-plan { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.bp-item { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--fg); margin-bottom: 3px; }
.bp-style { font-weight: 600; }
.bp-qty { color: var(--muted); }
.bp-progress { margin-left: auto; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 99px; font-size: 11px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3dae4; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #b9c2d0; }
::-webkit-scrollbar-track { background: transparent; }

@media print {
  .sidebar, .topbar, .toolbar, .tabs, .btn, .ops, .hint, .empty, .board-extra, .board-grid, .stat-row, .ticket-actions { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .wage-print-title { display: block !important; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
  body { background: #fff !important; }
  .table { border: 1px solid #333 !important; }
  body.printing-ticket * { visibility: hidden; }
  body.printing-ticket .ticket, body.printing-ticket .ticket * { visibility: visible; }
  body.printing-ticket .ticket { position: fixed; left: 0; top: 0; width: 100%; box-shadow: none; border: none; }
  body.printing-ticket .ticket-print-area { position: fixed; left: 0; top: 0; width: 100%; }
  body.printing-ticket .ticket-print-area * { visibility: visible; }
  body.printing-ticket .ticket-print-area .ticket { position: static; margin: 0 auto 20px; border: 1px solid #ccc; }
}
.ticket-mask { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.ticket { width: 360px; background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); color: #111; }
.ticket-head { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; }
.ticket-row { display: flex; margin-bottom: 8px; font-size: 14px; }
.t-label { width: 96px; color: #666; flex-shrink: 0; }
.t-value { flex: 1; font-weight: 600; word-break: break-all; }
.ticket-no { margin-top: 14px; font-size: 12px; color: #999; text-align: center; font-family: monospace; }
.ticket-actions { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 101; }
.shift-cell { min-height: 64px; padding: 6px 4px; display: flex; flex-direction: column; justify-content: center; }
.sc-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sc-time { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sc-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.ship-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--card); }
.ship-box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

/* 数量输入框：去掉上下箭头，直接输入数字 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* 表格内输入框统一样式（可直接输入） */
.table input[type="number"], .table input[type="text"] { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--fg); outline: none; min-width: 60px; }
.table input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 拖拽排序高亮 */
.drag-over { background: var(--accent-soft) !important; }
.table tr[draggable="true"] { cursor: grab; }

/* 颜色尺码活页选择片 */
.sel-chip { display: inline-block; padding: 6px 14px; border: 1px solid var(--border); border-radius: 99px; font-size: 14px; background: #fff; color: var(--fg); user-select: none; transition: all .12s; }
.sel-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sel-chip .chip-no { margin-left: 4px; font-size: 11px; opacity: .75; }
.sel-chip.on .chip-no { color: #fff; }

/* 互动机器人 */
.bot-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 200; transition: transform .15s; }
.bot-fab:hover { transform: scale(1.07); }
.bot-panel { position: fixed; right: 24px; bottom: 92px; width: 390px; max-height: 560px; background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.28); display: flex; flex-direction: column; z-index: 210; overflow: hidden; border: 1px solid var(--border); }
.bot-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.bot-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 320px; background: #f7f9fc; }
.bot-msg { display: flex; }
.bot-msg.me { justify-content: flex-end; }
.bot-bubble { max-width: 86%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.bot-msg.bot .bot-bubble { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bot-msg.me .bot-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bot-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); }
.bot-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.bot-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; }
.bot-input-row input:focus { border-color: var(--accent); }

/* 生产进度条 */
.progress-track { height: 10px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), #16a34a); border-radius: 6px; transition: width .4s; }

/* 扫码报工：工序大按钮 */
.step-btn { padding: 12px 16px; font-size: 15px; border-radius: 12px; text-align: center; line-height: 1.4; }
.step-btn small { font-weight: 400; opacity: .85; }
.step-btn.on { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.step-btn.step-done { background: #dcfce7; color: #16a34a; border-color: #86efac; }
.row-lit td { background: #eef2ff; }

/* 总览驾驶舱 */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.ov-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ov-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-weight: 700; }
.ov-card-head:hover { background: rgba(79, 70, 229, 0.05); }
.ov-icon { font-size: 18px; }
.ov-title { flex: 1; font-size: 15px; }
.ov-go { color: #4f46e5; font-weight: 800; }
.ov-items { display: flex; flex-wrap: wrap; padding: 8px 10px 12px; gap: 6px 14px; }
.ov-item { display: flex; flex-direction: column; min-width: 70px; }
.ov-item-label { font-size: 11px; color: var(--muted-foreground); }
.ov-item-val { font-size: 16px; font-weight: 700; }
.ov-extra { padding: 0 10px 10px; font-size: 11px; color: var(--muted-foreground); cursor: pointer; }

/* 新手引导步骤条 */
.onboard { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.onboard-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.onboard-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.onboard-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 12px; border: 1px dashed #d1d5db; cursor: pointer; text-align: center; transition: background .12s; }
.onboard-step:hover { background: #f8fafc; }
.onboard-step.done { border-style: solid; border-color: #86efac; background: #f0fdf4; }
.ob-num { width: 28px; height: 28px; border-radius: 50%; background: #e5e7eb; color: #374151; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.onboard-step.done .ob-num { background: #16a34a; color: #fff; }
.ob-label { font-size: 14px; font-weight: 700; }
.ob-desc { font-size: 11px; color: var(--muted-foreground); line-height: 1.3; }

/* 低库存预警条 */
.lowstock-bar { background: #fef2f2; border: 1px solid #fecaca; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.ls-head { display: flex; align-items: center; gap: 10px; }
.ls-title { flex: 1; font-size: 15px; font-weight: 800; color: #b91c1c; }
.ls-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ls-item { background: #fff; border: 1px solid #fecaca; border-radius: 8px; padding: 4px 8px; font-size: 12px; color: #7f1d1d; }
.ls-item b { color: #dc2626; }
.ls-more { font-size: 12px; color: #b91c1c; align-self: center; }

/* 今天该做的事 */
.mytasks { background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #c7d2fe; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.mytasks-title { font-size: 15px; font-weight: 800; color: #3730a3; margin-bottom: 10px; }
.mytasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mytask { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer; border: 1px solid #dbe2ec; transition: transform .1s, box-shadow .12s; }
.mytask:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, .12); }
.mt-icon { font-size: 22px; }
.mt-label { flex: 1; font-size: 15px; font-weight: 700; }
.mt-hint { font-size: 11px; font-weight: 400; color: #64748b; }
.mt-urgent { display:inline-block; margin-left:6px; padding:0 5px; border-radius:4px; background:#ef4444; color:#fff; font-size:11px; font-weight:700; }
.mt-count { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: #ef4444; color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }

/* 空列表引导（带大按钮） */
.empty-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; }
.empty-cta .btn { font-size: 15px; padding: 10px 18px; }

/* 销售预测建议行 */
.suggest-row { padding: 10px 14px; border-radius: 10px; background: #eef2ff; color: #3730a3; margin-top: 8px; font-size: 14px; }
.suggest-row.suggest-warn { background: #fef3c7; color: #92400e; }
.suggest-row.suggest-danger { background: #fee2e2; color: #b91c1c; }

/* 详情字段值展示 */
.detail-val { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: 14px; margin-bottom: 8px; min-height: 20px; white-space: pre-wrap; }

/* 我的工作：日历 + 提醒 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.cal-head { text-align: center; font-size: 12px; color: var(--muted-foreground); padding: 4px 0; }
.cal-cell { min-height: 86px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--card); }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event { font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.dot.todo { background: #f59e0b; }
.dot.done { background: #9ca3af; }
.dot.memo { background: #3b82f6; }
.dot.lead { background: #10b981; }
.dot.customer { background: #8b5cf6; }
.reminder-box { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.reminder-item { font-size: 14px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.reminder-item:last-child { border-bottom: none; }

/* 全链路台账：宽表横向滚动 + 打印时只留表格 */
.chain-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.chain-table { min-width: 1180px; }
.chain-table th, .chain-table td { white-space: nowrap; font-size: 13px; }
.chain-table td .mini { font-weight: 400; }
@media print {
  .sidebar, .topbar, .tabs, .toolbar, .hint, .toast, .side-foot { display: none !important; }
  .content { padding: 0 !important; }
  .chain-wrap { overflow: visible; border: none; }
  .chain-table { min-width: 0; width: 100%; }
  .chain-table th, .chain-table td { font-size: 10px; padding: 3px 4px; }
}

/* 宽表：横向滚动 + 单元格不换行（人员档案/宿舍等列多的表） */
.wide-wrap { overflow-x: auto; }
.wide-table th, .wide-table td { white-space: nowrap; }
.wide-table td .mini { font-weight: 400; }

/* 未收款红章（销售订单） */
.stamp-unpaid {
  display: inline-block;
  padding: 2px 8px;
  border: 2px solid #dc2626;
  border-radius: 6px;
  color: #dc2626;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  transform: rotate(-6deg);
  background: #fff5f5;
}


/* 生命周期看板 */
.life-row { cursor: pointer; }
.life-stages { white-space: nowrap; }
.life-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: #e5e7eb; margin-right: 2px; font-size: 0; vertical-align: middle; }
.life-dot.on { background: #16a34a; }
.life-detail td { background: #f8fafc; }
.life-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; padding: 4px 0; }
.life-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.life-card .lh { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #0e7490; }
.life-card .li { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; color: var(--fg); }
.life-card .li b { color: var(--fg); }
.life-card .li.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; font-weight: 700; color: #c2410c; }
.life-card .li.muted { color: var(--muted); }
@media (max-width: 1200px) { .life-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* 总计划调度台：环节进度小格 */
.plan-seg { text-align: center; }
.seg { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 8px; font-size: 12px; background: #eef2f7; color: var(--muted); }
.seg.on { background: #dcfce7; color: #15803d; font-weight: 700; }
.seg.doing { background: #fef9c3; color: #a16207; font-weight: 700; }

/* 开单码表：颜色×尺码 格子 */
.grid-table .grid-qty { width: 72px; text-align: center; padding: 8px 4px; font-size: 16px; }
.grid-table .grid-stock { font-size: 12px; color: #64748b; line-height: 1.1; margin-bottom: 4px; text-align: center; }
.grid-table .grid-stock.over { color: #fff; font-weight: 700; background: #dc2626; border-radius: 4px; padding: 1px 2px; }
.grid-table .grid-price { width: 76px; }
.grid-table td, .grid-table th { padding: 5px 6px; }
.grid-table input { font-size: 14px; }

.plan-order-row td { background: #e8f4fa !important; color: #0e7490; font-size: 13px; border-top: 2px solid #bae6fd; }
.plan-order-row + tr td { border-top: none; }

.row-dim td { opacity: .45; }
.row-dim td b { text-decoration: line-through; }

/* 来源订单/计划追踪列 */
.trace { font-size: 12px; line-height: 1.5; max-width: 170px; }
.trace .hint { font-size: 11px; }

/* ---------- 登录页（手机号 + 验证码） ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef4ff 0%, var(--bg) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 32px 28px; box-shadow: 0 12px 40px rgba(15, 23, 42, .08); }
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.login-field input { width: 100%; padding: 14px 16px; font-size: 18px; border: 1px solid #dbe2ec; border-radius: 12px; background: #fff; color: var(--fg); outline: none; }
.login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.login-code { display: flex; gap: 10px; }
.login-code input { flex: 1; }
.login-code .btn { white-space: nowrap; padding: 0 16px; font-size: 15px; }
.login-code .btn:disabled { opacity: .55; cursor: not-allowed; }
.login-err { background: var(--warn-soft); color: #92400e; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.login-submit { width: 100%; padding: 15px; font-size: 17px; font-weight: 700; letter-spacing: 2px; border-radius: 12px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.id-name { font-weight: 600; font-size: 14px; }

/* 登录页两个页签：验证码 / 密码 */
.login-tabs { display: flex; gap: 6px; background: #f1f5f9; padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.login-tab { flex: 1; padding: 10px; border: 0; background: transparent; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.login-tab.on { background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(15, 23, 42, .07); }

/* ICP 备案号（工信部要求：首页底部展示并链接工信部） */
.icp-link { color: var(--muted); text-decoration: none; font-size: 11px; }
.icp-link:hover { color: var(--accent); text-decoration: underline; }
.login-icp { text-align: center; margin-top: 8px; font-size: 12px; }
.login-icp a { color: var(--muted); text-decoration: none; }
.login-icp a:hover { color: var(--accent); text-decoration: underline; }

/* ---- 可搜索下拉（picker.js）：选项多的下拉打字筛选，少滚轮少点错 ---- */
.pk-mask { position: fixed; inset: 0; background: transparent; z-index: 10000; display: none; }
.pk-panel {
  position: fixed; z-index: 10001; display: none; background: #fff;
  border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 12px 36px rgba(15,23,42,.22);
  overflow: hidden; display: none; flex-direction: column;
}
.pk-panel[style*="display: block"] { display: flex !important; }
.pk-input {
  border: 0; border-bottom: 1px solid #e2e8f0; outline: 0; padding: 10px 12px;
  font-size: 15px; font-family: inherit; width: 100%; box-sizing: border-box; background: #f8fafc;
}
.pk-input::placeholder { color: #94a3b8; font-size: 13px; }
.pk-list { overflow-y: auto; flex: 1 1 auto; }
.pk-item {
  padding: 9px 12px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pk-item.cur { background: #0e7490; color: #fff; }
.pk-item.sel { font-weight: 700; }
.pk-tick { float: right; opacity: .8; }
.pk-empty { padding: 18px 12px; color: #94a3b8; font-size: 13px; text-align: center; }
