/* ================= 基础 ================= */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f3f5f9; --card: #ffffff; --line: #e3e7ee; --line-2: #eef1f5; --text: #1f2633; --muted: #6b7684; --muted-2: #98a2b3;
  --primary: #2563eb; --primary-d: #1d4fd7; --primary-l: #e8efff; --success: #16a34a; --success-l: #e5f7ec;
  --warn: #d97706; --warn-l: #fff4e0; --danger: #dc2626; --danger-l: #fde8e8; --info: #0891b2; --info-l: #e0f5fa;
  --side: #ffffff; --side-2: #eef2f8; --side-text: #3d4756; --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif; }
[v-cloak] { display: none; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); } .muted-2 { color: var(--muted-2); } .small { font-size: 12px; } .bold { font-weight: 600; }
.r { text-align: right !important; } .c { text-align: center !important; } .nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; }
.money { font-variant-numeric: tabular-nums; }
.danger-text { color: var(--danger); } .success-text { color: var(--success); } .warn-text { color: var(--warn); } .primary-text { color: var(--primary); }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .ml { margin-left: 8px; } .mr { margin-right: 8px; }
.flex { display: flex; align-items: center; gap: 8px; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; } .between { justify-content: space-between; }
.hidden { display: none !important; }

/* ================= 登录 ================= */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #17202c 0%, #24344a 60%, #2563eb 140%); padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 36px 32px 24px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 20px; text-align: center; margin-top: 8px; }
.login-box p { text-align: center; margin: 4px 0 14px; }
.login-box label { margin-bottom: 12px; }
.login-box .err { color: var(--danger); font-size: 13px; margin-bottom: 10px; }
.login-logo { text-align: center; }
.logo-img { width: 72px; height: 72px; border-radius: 50%; } .logo-img.small { width: 40px; height: 40px; flex-shrink: 0; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary); font-size: 22px; }

/* ================= 布局 ================= */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line-2); }
.brand-name { color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.2; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--muted-2); }
.sidebar nav { padding: 10px 10px; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--side-text); font-size: 14px; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--side-2); color: var(--primary); }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav .ico { width: 18px; height: 18px; display: inline-flex; }
.sidebar nav .ico svg { width: 18px; height: 18px; }
.nav-badge { margin-left: auto; background: var(--warn); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-chip { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip b { color: var(--text); font-weight: 500; }
.sidebar-foot .btn.ghost { color: var(--side-text); }
.sidebar-mask { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.page-title { font-size: 17px; flex: 1; }
.menu-btn { display: none; font-size: 18px; padding: 4px 8px; }
.content { padding: 20px 24px 60px; flex: 1; }

/* ================= 卡片 / 网格 ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 12px 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: 1 / -1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > * { min-width: 0; }
.modal-body { overflow-x: hidden; }
.three-two { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }

/* ================= 表单 ================= */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
label > span.req::after { content: " *"; color: var(--danger); }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 36px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
input:disabled, select:disabled, textarea:disabled { background: #f7f8fa; color: var(--muted); }
textarea { resize: vertical; min-height: 60px; }
input[type=number] { text-align: right; }
input[type=checkbox] { width: auto; min-height: 0; }
.input-group { display: flex; gap: 6px; align-items: center; }
.input-group input { flex: 1; }
.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }

/* ================= 按钮 ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 8px; font-size: 13.5px; cursor: pointer; line-height: 1.4; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #f5f7fa; border-color: #d3d9e2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3c2c2; }
.btn.danger:hover { background: var(--danger-l); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.link { border: none; background: none; color: var(--primary); padding: 2px 6px; }
.btn.link.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.large { padding: 10px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
.edit-wrap { overflow: visible; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; white-space: nowrap; }
table.tbl th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 12.5px; position: sticky; top: 0; }
table.tbl tbody tr:hover td { background: #f8fafc; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.sel td { background: var(--primary-l); }
.toolbar label { flex-direction: column; }
table.tbl tfoot td { font-weight: 600; background: #fafbfc; }
table.tbl td.wrap { white-space: normal; }
table.tbl .empty { text-align: center; color: var(--muted-2); padding: 30px; }
table.edit td { padding: 4px 6px; }
table.edit input, table.edit select { min-height: 34px; padding: 5px 8px; border-radius: 6px; }
table.edit .del { border: none; background: none; color: var(--muted-2); font-size: 18px; cursor: pointer; padding: 2px 6px; line-height: 1; }
table.edit .del:hover { color: var(--danger); }

/* ================= 标签 / 状态 ================= */
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.badge.received { background: var(--info-l); color: var(--info); }
.badge.working { background: var(--warn-l); color: var(--warn); }
.badge.done { background: var(--success-l); color: var(--success); }
.badge.settled { background: #eceff3; color: var(--muted); }
.badge.void { background: var(--danger-l); color: var(--danger); }
.badge.gray { background: #eceff3; color: var(--muted); }
.badge.blue { background: var(--primary-l); color: var(--primary); }
.badge.red { background: var(--danger-l); color: var(--danger); }
.badge.green { background: var(--success-l); color: var(--success); }
.badge.orange { background: var(--warn-l); color: var(--warn); }
.plate { display: inline-block; font-family: Consolas, "SF Mono", Menlo, monospace; font-weight: 600; letter-spacing: .5px; background: #1e3a8a; color: #fff; padding: 1px 8px; border-radius: 5px; font-size: 13px; }
.plate.green { background: #15803d; }

/* ================= 工具栏 / 筛选 ================= */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }
.toolbar .search { min-width: 240px; flex: 1; max-width: 360px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 9px 14px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tabs button .cnt { margin-left: 4px; font-size: 12px; background: #eceff3; color: var(--muted); padding: 0 6px; border-radius: 8px; }
.tabs button.active .cnt { background: var(--primary-l); color: var(--primary); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.summary-line { color: var(--muted); font-size: 13px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }

/* ================= 统计卡 ================= */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .sub { color: var(--muted-2); font-size: 12px; margin-top: 4px; }
.stat.accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.stat.accent.green::before { background: var(--success); } .stat.accent.orange::before { background: var(--warn); } .stat.accent.red::before { background: var(--danger); } .stat.accent.cyan::before { background: var(--info); }

/* ================= 看板 ================= */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.board-col { background: #eef1f5; border-radius: var(--radius); padding: 10px; min-height: 160px; }
.board-col h4 { font-size: 13.5px; color: var(--muted); display: flex; justify-content: space-between; padding: 4px 6px 10px; }
.board-card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; border-left: 3px solid var(--info); }
.board-card.working { border-left-color: var(--warn); } .board-card.done { border-left-color: var(--success); }
.board-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); }
.board-card .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.board-card .desc { font-size: 12.5px; color: var(--text); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-empty { color: var(--muted-2); font-size: 12.5px; text-align: center; padding: 20px 0; }

/* ================= 弹窗 ================= */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 860px; } .modal.xl { max-width: 1100px; }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-close { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }

/* ================= 提示 ================= */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1f2633; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toast-in .2s ease-out; }
.toast.success { background: var(--success); } .toast.error { background: var(--danger); } .toast.warn { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ================= 下拉搜索 ================= */
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.15); z-index: 50; max-height: 260px; overflow-y: auto; margin-top: 3px; min-width: 280px; }
.suggest-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.suggest-item:hover, .suggest-item.active { background: var(--primary-l); }
.suggest-item .sub { color: var(--muted); font-size: 12px; }

/* ================= 工单编辑 ================= */
.order-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.order-head .no { font-size: 20px; font-weight: 700; }
.order-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.steps { display: flex; gap: 0; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { flex: 1; padding: 10px 14px; text-align: center; font-size: 13px; color: var(--muted-2); position: relative; background: #fff; }
.step.done { color: var(--success); background: var(--success-l); }
.step.current { color: #fff; background: var(--primary); font-weight: 600; }
.step .t { font-size: 11px; opacity: .8; display: block; }
.totals-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 20px; }
.totals-box .tot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.totals-box .tot span { color: var(--muted); font-size: 13px; }
.totals-box .tot b { font-size: 17px; font-variant-numeric: tabular-nums; }
.totals-box .tot.big b { font-size: 24px; color: var(--danger); }
.totals-box .tot input { width: 130px; }
.vehicle-hint { background: var(--info-l); color: var(--info); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vehicle-hint.warn { background: var(--warn-l); color: var(--warn); }

/* 附件 */
.file-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.file-stage h4 { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.file-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #111; cursor: pointer; }
.file-item img, .file-item video { width: 100%; height: 100%; object-fit: cover; }
.file-item .vid-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff; font-size: 26px; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.file-item .del { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 13px; line-height: 1; }
.file-add { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; font-size: 12px; }
.file-add:hover { border-color: var(--primary); color: var(--primary); }
.file-add input { display: none; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 300; display: flex; align-items: center; justify-content: center; }
.lightbox img, .lightbox video { max-width: 96vw; max-height: 92vh; }
.lightbox .close { position: absolute; top: 14px; right: 20px; color: #fff; font-size: 34px; cursor: pointer; }
.upload-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.upload-bar i { display: block; height: 100%; background: var(--primary); transition: width .2s; }

/* 报告 / 二维码 */
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-box canvas, .qr-box img { border: 1px solid var(--line); padding: 6px; background: #fff; border-radius: 8px; }
.report-link { font-family: Consolas, monospace; font-size: 12.5px; word-break: break-all; background: #f7f8fa; padding: 8px 10px; border-radius: 6px; }

/* 简单柱状图 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 10px 4px 0; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar i { display: block; width: 100%; max-width: 34px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar i.today { background: var(--success); }
.bar .lbl { font-size: 10.5px; color: var(--muted-2); }
.bar .val { font-size: 11px; color: var(--muted); }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; min-width: 110px; }
.desc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; }
.desc-list div { font-size: 13.5px; } .desc-list div span { color: var(--muted); margin-right: 8px; font-size: 12.5px; }

/* ================= 工单页（4S DMS 版式） ================= */
.wo { padding-bottom: 74px; }
.wo-top { display: grid; grid-template-columns: 250px 250px 250px 1fr; gap: 10px; margin-bottom: 12px; }
.wo-card { border-radius: 10px; padding: 12px 14px; color: #fff; min-height: 104px; display: flex; flex-direction: column; gap: 3px; cursor: default; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.wo-card.c-order { background: linear-gradient(135deg, #1e3a8a, #2f5bb7); }
.wo-card.c-car { background: linear-gradient(135deg, #1f3f78, #2d6cc0); cursor: pointer; }
.wo-card.c-cust { background: linear-gradient(135deg, #253a5e, #3b6aa8); cursor: pointer; }
.wo-card::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.07); }
.wo-card-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .95; }
.wo-card-h b { font-size: 13px; }
.wo-card-h .small { opacity: .8; }
.wo-card-big { font-size: 18px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-card-big .plate.big { font-size: 17px; padding: 2px 10px; background: rgba(255,255,255,.18); }
.wo-card-l { font-size: 12px; opacity: .88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-card .badge { background: rgba(255,255,255,.22); color: #fff; }
.wo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.wo-actions .btn { padding: 6px 11px; font-size: 13px; }
.wo-steps { margin-bottom: 12px; }
.wo-steps .step { padding: 8px 6px; }
.wo-steps .step .n { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; border: 1px solid currentColor; align-items: center; justify-content: center; font-size: 11px; margin-right: 5px; }
.wo-steps .step.done .n { background: var(--success); color: #fff; border-color: var(--success); }
.wo-steps .step.current .n { background: #fff; color: var(--primary); border-color: #fff; }
.wo-body { margin-bottom: 12px; }
.wo-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.wo-tabs button { border: none; background: none; padding: 11px 14px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.wo-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.wo-tabs button .cnt { margin-left: 5px; font-size: 11px; background: #eceff3; color: var(--muted); padding: 0 6px; border-radius: 8px; }
.wo-tabs button.active .cnt { background: var(--primary-l); color: var(--primary); }
.wo-pane { padding: 14px 16px 18px; }
.wo-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.wo-sec-h h4 { font-size: 14px; }
table.pkgs td, table.items td { padding: 3px 5px; }
table.items input, table.items select, table.pkgs input, table.pkgs select { min-height: 31px; padding: 4px 7px; font-size: 13px; }
table.items input[type=checkbox] { min-height: 0; }
table.items tr.row-text td { background: #fbfcfe; }
table.items tr.row-text input.name-input { color: var(--muted); }
table.items tr.row-done td { background: #f5fbf7; }
table.items .check { gap: 4px; }
table.items .check input { display: none; }
table.items .badge { cursor: pointer; }
.batch-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f7f9fc; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.batch-bar input, .batch-bar select { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.batch-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.quick-panel { background: var(--primary-l); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.quick-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick-list .btn { max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: block; text-align: left; }
.due-panel { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.due-panel h4 { font-size: 13.5px; }
.due-tiles { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 6px; }
.due-tile { flex: 0 0 118px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 8px; text-align: center; cursor: pointer; background: #fff; transition: box-shadow .12s, transform .12s; }
.due-tile:hover { box-shadow: 0 4px 14px rgba(16,24,40,.14); transform: translateY(-1px); }
.due-tile .ico { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.due-tile .nm { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-tile .st { font-size: 11.5px; margin-top: 4px; padding: 2px 4px; border-radius: 6px; background: #eceff3; color: var(--muted); }
.due-tile .last { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-tile.ok .st { background: var(--success-l); color: var(--success); }
.due-tile.due { border-color: #f5c27a; }
.due-tile.due .st { background: var(--warn-l); color: var(--warn); font-weight: 600; }
.wo-bottom { position: sticky; bottom: 0; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -4px 20px rgba(16,24,40,.10); padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wo-bottom .tot { display: flex; flex-direction: column; line-height: 1.2; }
.wo-bottom .tot span { color: var(--muted); font-size: 11.5px; }
.wo-bottom .tot b { font-size: 15px; font-variant-numeric: tabular-nums; }
.wo-bottom .tot.big b { font-size: 22px; color: var(--danger); }
.wo-bottom .tot input { width: 100px; min-height: 30px; padding: 3px 8px; }
.wo-bottom .btn-group { margin-left: auto; }
.pay-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-chips .chip { font-size: 12px; background: #eef1f5; border-radius: 12px; padding: 3px 10px; color: var(--text); }
.pay-chips .chip.settled { background: var(--success-l); color: var(--success); }
.pay-chips .chip i { font-style: normal; margin-left: 4px; }
.settle-groups { display: flex; flex-direction: column; gap: 6px; }
.settle-group { flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.settle-group.on { border-color: var(--primary); background: var(--primary-l); }
.settle-group.settled { opacity: .6; cursor: default; }
.settle-group input { width: auto; min-height: 0; }
/* VHC 车检 */
.vhc-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.vhc-head label { flex-direction: column; }
.vhc-legend { display: flex; gap: 4px; }
.vs { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; line-height: 1.5; }
.vs.urgent.on, .vhc-legend .vs.urgent { background: var(--danger); color: #fff; border-color: var(--danger); }
.vs.warn.on, .vhc-legend .vs.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.vs.note.on, .vhc-legend .vs.note { background: var(--info); color: #fff; border-color: var(--info); }
.vs.ok.on, .vhc-legend .vs.ok { background: var(--success); color: #fff; border-color: var(--success); }
.vs.none.on, .vhc-legend .vs.none { background: #6b7684; color: #fff; border-color: #6b7684; }
.vhc-btns { display: flex; gap: 3px; }
.vhc-group { margin-bottom: 14px; }
.vhc-group-h { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
table.vhc td { padding: 4px 8px; }
table.vhc input { min-height: 30px; padding: 3px 8px; font-size: 13px; }
table.vhc tr.vhc-urgent td { background: #fff1f1; }
table.vhc tr.vhc-warn td { background: #fff8ec; }
table.vhc tr.vhc-ok td { background: #f3fbf5; }
/* 看板 4 列 */
.board.four { grid-template-columns: repeat(4, 1fr); }
.board-card.booked { border-left-color: var(--muted-2); } .board-card.partial { border-left-color: var(--primary); }
.badge.booked { background: #eceff3; color: var(--muted); }
.badge.partial { background: var(--primary-l); color: var(--primary); }
.badge.closed { background: #e2e5ea; color: #4b5563; }
.prog { height: 4px; background: var(--line-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--success); }

/* ================= 响应式 ================= */
@media (max-width: 1300px) { .wo-top { grid-template-columns: 1fr 1fr 1fr; } .wo-actions { grid-column: 1 / -1; } }
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .board.four { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .totals-box { grid-template-columns: repeat(2, 1fr); }
  .three-two, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .edit-wrap { overflow-x: auto; }
  .sidebar { position: fixed; left: -240px; z-index: 60; transition: left .2s; height: 100vh; }
  .sidebar.open { left: 0; }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 14px 12px 60px; }
  .board, .board.four { grid-template-columns: 1fr; }
  .file-stages { grid-template-columns: 1fr; }
  .wo-top { grid-template-columns: 1fr; }
  .wo-card { min-height: 0; }
  .wo-bottom { position: static; gap: 10px 14px; padding: 8px 12px; }
  .wo-bottom .btn-group { margin-left: 0; width: 100%; }
  .wo-pane { padding: 12px; }
  .wo { padding-bottom: 20px; }
  .wo-steps { overflow-x: auto; }
  .wo-steps .step { font-size: 11.5px; white-space: nowrap; padding: 7px 8px; }
  .wo-steps .step .n { width: 15px; height: 15px; font-size: 10px; margin-right: 3px; }
  .wo-steps .step .t { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .step { padding: 8px 4px; font-size: 12px; } .step .t { display: none; }
  .order-head .no { font-size: 17px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .totals-box { grid-template-columns: 1fr; }
  .toolbar .search { min-width: 0; max-width: none; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 13px; }
  .modal { max-height: 96vh; }
  .card-body { padding: 12px; }
}

/* ================= 打印（4S 版式） ================= */
#print-sheet { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm 10mm 10mm 12mm; }
  html, body { background: #fff; }
  #app { display: none !important; }
  #print-sheet { display: block; color: #000; font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; }
}
#print-sheet .sheet { position: relative; min-height: 272mm; padding: 0 10mm 30mm 0; page-break-after: always; font-size: 11px; line-height: 1.45; color: #000; }
#print-sheet .sheet:last-child { page-break-after: auto; }
#print-sheet .mono { font-family: Consolas, "Courier New", monospace; }
#print-sheet .n { text-align: right; font-variant-numeric: tabular-nums; }
#print-sheet .grow { flex: 1; }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ph-shop { font-size: 19px; font-weight: 700; letter-spacing: 1px; line-height: 1.3; }
.ph-addr { font-size: 10.5px; color: #333; }
.ph-r { margin-left: auto; text-align: right; }
.ph-title { font-size: 27px; font-weight: 400; letter-spacing: 5px; line-height: 1.2; }
.ph-sub { font-size: 10px; margin-top: 6px; color: #222; }
.ph-logo { width: 84px; text-align: center; font-size: 9.5px; color: #333; }
.ph-logo img { max-width: 72px; max-height: 52px; display: block; margin: 0 auto 2px; }
.p-tag { display: inline-block; border-left: 2px solid #000; padding: 1px 8px 1px 6px; font-size: 12px; }
.pc { display: flex; justify-content: space-between; align-items: flex-end; margin: 22px 0 10px; gap: 12px; }
.pc-name { font-size: 15px; font-weight: 600; }
.pc-sub { font-size: 10.5px; color: #444; white-space: pre-wrap; max-width: 220px; }
.pc-phone { font-weight: 600; font-size: 12px; }
.pc-qr img { width: 66px; height: 66px; display: block; }
.pc-meta { font-size: 11px; text-align: right; line-height: 1.5; }
.pc-meta span { color: #555; margin-right: 8px; }
.pc-meta b { font-weight: 600; }
.pv { width: 100%; border-collapse: collapse; margin-bottom: 14px; border-top: 1.5px solid #000; border-bottom: 1.5px solid #000; }
.pv th { font-weight: 600; padding: 3px 4px; border-bottom: .5px solid #888; font-size: 11px; text-align: left; }
.pv td { padding: 5px 4px; font-size: 11px; }
.pi { width: 100%; border-collapse: collapse; border-top: 1.5px solid #000; }
.pi th { font-weight: 600; text-align: left; padding: 4px; border-bottom: 1.5px solid #000; font-size: 11.5px; }
.pi td { padding: 3px 4px; font-size: 11px; vertical-align: top; }
.pi tr.g td { font-weight: 700; padding-top: 6px; border-top: .5px solid #aaa; }
.pi tbody tr.g:first-child td { border-top: none; }
.pi td.t { color: #444; font-weight: 400; }
.pi .sp { color: #666; font-size: 10px; margin-left: 8px; }
.pi tr.end td { padding: 0; border-bottom: 1.5px solid #000; }
.p-desc { margin-top: 10px; font-size: 11px; line-height: 1.6; }
.p-desc b { font-weight: 600; }
.p-opts { margin: 16px 0 22px; font-size: 11.5px; display: flex; gap: 22px; flex-wrap: wrap; }
.p-opts .bx { display: inline-block; width: 11px; height: 11px; border: 1px solid #000; vertical-align: -1px; margin-right: 5px; text-align: center; line-height: 9px; font-size: 10px; font-style: normal; }
.p-legal { font-size: 9.5px; color: #222; line-height: 1.55; white-space: pre-wrap; margin-top: 6px; }
.p-legal b { display: block; margin-bottom: 2px; font-size: 10px; }
.p-side { position: absolute; right: 0; top: 34%; writing-mode: vertical-rl; font-size: 21px; letter-spacing: 12px; }
.p-bill-low { display: flex; gap: 24px; align-items: flex-start; margin-top: 12px; }
.p-tot { width: 300px; border-collapse: collapse; font-size: 11.5px; flex-shrink: 0; }
.p-tot th { font-weight: 500; color: #555; text-align: right; padding: 2px 6px; border-bottom: .5px solid #888; }
.p-tot td { text-align: right; padding: 4px 6px; border-bottom: .5px solid #ccc; font-variant-numeric: tabular-nums; }
.p-tot td.k { text-align: left; }
.p-tot tr.sum td { font-weight: 700; border-top: 1.5px solid #000; font-size: 12.5px; }
.p-wm { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-28deg); font-size: 64px; font-weight: 700; letter-spacing: 10px; color: rgba(0,0,0,.06); white-space: nowrap; pointer-events: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.p-foot { position: absolute; left: 0; right: 10mm; bottom: 0; font-size: 10.5px; }
.p-foot .sig { display: flex; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.p-foot .sig span { display: inline-block; min-width: 110px; border-bottom: 1px solid #000; }
.p-foot .meta { display: flex; justify-content: space-between; font-size: 9.5px; color: #333; border-top: .5px solid #999; padding-top: 4px; }

/* 小程序员工邀请码 */
.invite { background: #eef4ff; border: 1px solid #c9dafc; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; font-size: 15px; }
.invite b { font-size: 26px; letter-spacing: 6px; color: #1d4ed8; margin: 0 6px; font-family: Consolas, monospace; }

/* 客户消息 */
.msg-page { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 120px); min-height: 480px; }
.msg-page .card { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.msg-convs { overflow-y: auto; flex: 1; }
.msg-conv { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.msg-conv:hover { background: #f6f8fc; }
.msg-conv.on { background: #eef4ff; }
.msg-conv .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; display: inline-block; }
.msg-box { flex: 1; overflow-y: auto; padding: 16px; background: #f6f7fb; }
.msg-row { margin-bottom: 14px; display: flex; flex-direction: column; align-items: flex-start; }
.msg-row.me { align-items: flex-end; }
.msg-meta { font-size: 12px; color: #98a2b3; margin-bottom: 4px; }
.msg-bubble { max-width: 70%; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; word-break: break-word; }
.msg-row.me .msg-bubble { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.msg-bubble img { max-width: 220px; max-height: 220px; border-radius: 6px; cursor: zoom-in; display: block; }
.msg-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.msg-input textarea { flex: 1; resize: none; }
@media (max-width: 800px) { .msg-page { grid-template-columns: 1fr; height: auto; } .msg-convs { max-height: 240px; } .msg-box { min-height: 360px; } }
.wx-card { width: 170px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wx-card img, .wx-card .wx-empty { width: 100%; height: 150px; object-fit: contain; background: #f6f7fb; border-radius: 6px; }
.wx-card .wx-empty { display: flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 13px; }

/* 小程序展示 */
.sc-media { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-cell { position: relative; width: 120px; height: 120px; border-radius: 8px; overflow: hidden; background: #e9edf5; cursor: zoom-in; }
.sc-cell img { width: 100%; height: 100%; object-fit: cover; }
.sc-vid { width: 100%; height: 100%; background: linear-gradient(135deg, #334155, #0f172a); }
.sc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 26px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sc-del { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; text-decoration: none; }

/* 增项确认 / 选照片 */
.prop-edit { border: 1px solid #c9dafc; margin-bottom: 12px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 3px solid transparent; }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick i { display: none; position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: #1d4ed8; color: #fff; font-style: normal; font-size: 12px; }
.pick.on { border-color: #1d4ed8; }
.pick.on i { display: block; }
.prop-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; margin-right: 4px; cursor: zoom-in; }
