:root {
  --navy: #263463;
  --navy-2: #34457f;
  --teal: #2fb594;
  --teal-soft: #e3f6f0;
  --ink: #1d2433;
  --ink-2: #4a5366;
  --muted: #6b7385;
  --line: #e2e6ee;
  --line-2: #eef1f6;
  --bg: #f4f6fa;
  --card: #fff;
  --red: #c23a2b;
  --red-soft: #fdecea;
  --amber: #a86400;
  --amber-soft: #fff4e0;
  --green: #1d8a5f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 4px 16px rgba(20, 30, 60, .05);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/1.5 "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif; color: var(--ink); background: radial-gradient(1200px 500px at 85% -10%, #e4f4ef 0%, transparent 60%), radial-gradient(900px 500px at 30% 0%, #e9edf8 0%, transparent 55%), var(--bg); background-attachment: fixed; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--navy); }
p { margin: 4px 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 181, 148, .35); border-color: var(--teal); }
input:disabled, select:disabled, textarea:disabled { background: #f7f8fb; color: var(--ink-2); }
textarea { resize: vertical; width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.b { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pre { white-space: pre-line; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.ok-text { color: var(--green); }
.err-text { color: var(--red); }
.warn-text { color: var(--amber); }
.danger-text { color: var(--red) !important; }
.dim { opacity: .5; }
.full { width: 100%; }
.pad { padding: 10px; }

/* ── 布局 ── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 212px; flex: none; background: linear-gradient(180deg, #1f2b55 0%, #22345f 55%, #1d4a55 100%); color: #d9def0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; }
.sidebar .brand img { width: 32px; height: 32px; background: #fff; border-radius: 50%; padding: 3px; }
.sidebar .brand b { display: block; color: #fff; letter-spacing: .08em; font-size: 14px; }
.sidebar .brand span { font-size: 11px; color: #9fb0e0; }
.sidebar nav { flex: 1; padding: 4px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: #d9def0; margin-bottom: 2px; }
.nav-item i { font-style: normal; width: 16px; text-align: center; opacity: .7; }
.nav-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-item.router-link-active { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.me { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; }
.me b { display: block; color: #fff; font-size: 13px; }
.me span { font-size: 11px; color: #9fb0e0; }
.me .btn.link { color: #9fb0e0; }
.main { flex: 1; min-width: 0; }
.page { padding: 22px 28px 60px; max-width: 1480px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head.sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0 10px; margin-top: -12px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2-1, .grid-main-side, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.sub-title { font-size: 13px; margin: 14px 0 6px; color: var(--navy); }

/* ── 按钮 ── */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; line-height: 1.4; }
.btn:hover:not(:disabled) { border-color: #c8cfdc; background: #fafbfd; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #2c3d72, var(--navy)); border-color: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(38, 52, 99, .25); }
.btn.primary:hover:not(:disabled) { background: var(--navy-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--navy-2); padding: 2px 4px; }
.btn.full { width: 100%; padding: 9px; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 2px 6px; font-size: 16px; color: var(--muted); border-radius: 4px; }
.icon-btn:hover { background: var(--line-2); }

/* ── 工具条 / 分段 ── */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search { width: 280px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--teal); font-weight: 600; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px; }

/* ── 表格 ── */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: #f8f9fc; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 5px 8px; }
.table .clickable { cursor: pointer; }
.table .clickable:hover td { background: #f8faff; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }
.table .row-tools { white-space: nowrap; text-align: right; }
.table .row-tools .btn { margin-left: 4px; }
.table-scroll { overflow-x: auto; margin-bottom: 8px; }
.card .table { border: 0; box-shadow: none; }
.stock-table th.wh-head { border-left: 1px solid var(--line); color: var(--navy); }
.stock-table tr td:nth-child(4n+2) { border-left: 1px solid var(--line-2); }
.detail-cell { max-width: 520px; overflow-wrap: anywhere; }
.labels-table textarea { min-height: 30px; }

/* ── 徽章 ── */
.badge { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-weight: 500; vertical-align: middle; white-space: nowrap; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.st-draft { background: #eef0f4; color: #5b6475; }
.st-issued { background: #e6edff; color: #2f4aa8; }
.st-confirmed { background: var(--teal-soft); color: #13785f; }
.st-shipped { background: #e1f4e8; color: var(--green); }
.st-superseded { background: #f1f1f1; color: #8a8a8a; text-decoration: line-through; }
.st-void { background: var(--red-soft); color: var(--red); }
.stage-quote { background: #eef0f4; } .stage-pi { background: #e6edff; color: #2f4aa8; } .stage-contract { background: #efe8ff; color: #6a43c2; }
.stage-shipping { background: var(--amber-soft); color: var(--amber); } .stage-shipped { background: #e1f4e8; color: var(--green); }
.stage-closed { background: var(--teal-soft); color: #13785f; } .stage-lost { background: var(--red-soft); color: var(--red); }
.doc-tag { display: inline-block; min-width: 30px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; color: #fff; background: var(--navy); vertical-align: middle; }
.dt-QT { background: #6b7385; } .dt-PI { background: #2f4aa8; } .dt-SC { background: #6a43c2; } .dt-CI { background: #13785f; } .dt-PL { background: #a86400; }

/* ── 表单 ── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid label, .card > fieldset > label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: span 3; }
.form-grid .span4 { grid-column: span 4; }
@media (max-width: 900px) { .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span3, .form-grid .span4 { grid-column: span 2; } }
.input-row { display: flex; gap: 6px; align-items: center; }
.input-row input { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; align-content: start; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-inline { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.row-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
select.small { padding: 3px 6px; font-size: 12.5px; }

/* ── 单据编辑 ── */
.lines td { padding: 6px 6px; }
.lines input, .lines select, .lines textarea { font-size: 13px; padding: 4px 6px; }
.lines input.sub { margin-top: 4px; width: 100%; font-size: 12px; color: var(--ink-2); }
.lines textarea { min-width: 140px; font-size: 12px; }
.w-num { width: 64px; text-align: right; }
.w-price { width: 92px; text-align: right; }
.w-unit { width: 52px; }
.w-hs { width: 100px; }
input.manual { background: #fffaf0; border-color: #f0c57a; }
.hint { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.totals-panel { display: flex; justify-content: space-between; gap: 20px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.fees { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.fees label { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2); gap: 3px; }
.fees input { width: 110px; text-align: right; }
.sum { display: grid; grid-template-columns: auto auto; gap: 4px 24px; margin: 0; align-self: flex-end; min-width: 240px; }
.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum .grand { font-size: 17px; font-weight: 700; color: var(--navy); border-top: 1px solid var(--line); padding-top: 6px; }
.clause { margin-bottom: 8px; }
.clause .input-row input { font-weight: 600; }
.version-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.version-row.current { font-weight: 700; }
.picker { position: relative; }
.picker input { width: 100%; font-weight: 600; }
.picker-menu { position: absolute; z-index: 30; top: 100%; left: 0; width: 360px; max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(20, 30, 60, .14); }
.picker-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker-item.active, .picker-item:hover { background: #f1f5ff; }
.picker-item.dim { opacity: .55; }

/* ── 订单详情 ── */
.doc-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.doc-row:last-child { border-bottom: 0; }
.doc-row-main { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.doc-row-main > div { flex-basis: 100%; }
.versions { font-size: 12px; color: var(--muted); }
.versions a { margin-right: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* ── 库存 ── */
.stat-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 150px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-size: 20px; color: var(--navy); }
.stat small { display: block; color: var(--muted); font-size: 11.5px; }

/* ── 设置 ── */
.seal-box { display: flex; gap: 16px; flex-wrap: wrap; }
.seal-slot { display: flex; flex-direction: column; gap: 6px; width: 220px; }
.seal-slot img, .seal-empty { width: 120px; height: 120px; object-fit: contain; border: 1px dashed var(--line); border-radius: 6px; background: repeating-conic-gradient(#f3f4f7 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.seal-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 3px 4px 3px 12px; font-size: 13px; }

/* ── 弹窗 / 提示 ── */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 28, 50, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px; overflow: auto; }
.modal { background: #fff; border-radius: 10px; width: 640px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: 920px; }
.modal.small { width: 440px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h3 { font-size: 16px; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
.pick-item { display: flex !important; flex-direction: row !important; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px !important; color: var(--ink) !important; }
.pick-item.active { background: #eef3ff; }
.alert { background: #eef1f7; border-radius: 6px; padding: 9px 12px; margin: 8px 0 12px; font-size: 13px; }
.alert.warn { background: var(--amber-soft); color: #7a4a00; }
.alert.error { background: var(--red-soft); color: var(--red); }
.toast-host { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 7px; box-shadow: 0 6px 20px rgba(0,0,0,.2); white-space: pre-line; font-size: 13px; }
.toast.error { background: var(--red); }
.toast.warn { background: #8a5a00; }
.import-preview { margin-top: 12px; }

/* ── 登录 ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2a52 0%, #263463 55%, #1f6f62 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 12px; padding: 32px 30px; width: 360px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.login-card h1 { font-size: 19px; margin-top: 6px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.login-card input { padding: 9px 10px; }
.login-logo { height: 34px; align-self: flex-start; }

/* ── 1.1：工作台 / 产品卡片 / 选品面板 / 附件 ── */
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--teal); margin-bottom: 4px; }
.spacer { flex: 1; }
.btn.big { padding: 10px 18px; font-size: 15px; border-radius: 9px; }
.nav-label { font-size: 11px; color: #8fa0cf; padding: 8px 10px 6px; letter-spacing: .08em; }
.nav-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 0 7px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); position: relative; overflow: hidden; }
.stat-card:hover { text-decoration: none; border-color: #c9d3e6; }
.stat-card span { font-size: 12.5px; color: var(--muted); }
.stat-card b { display: block; font-size: 30px; color: var(--navy); line-height: 1.2; margin-top: 6px; }
.stat-card small { color: var(--muted); }
.stat-card::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 34px; height: 3px; background: var(--teal); border-radius: 2px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.todo-card h2 .count { font-size: 12px; background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 1px 8px; margin-left: 4px; }
.todo-item { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 13px; }
.todo-item:hover { text-decoration: none; background: #f8faff; }
.todo-right { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hero-card { border-radius: 16px; padding: 30px 34px; margin-bottom: 16px; background: linear-gradient(120deg, #eef7f3 0%, #f3f6fc 60%, #ffffff 100%); border: 1px solid #dceee6; box-shadow: var(--shadow); }
.hero-card h2 { font-size: 26px; color: var(--navy); margin: 10px 0 8px; line-height: 1.35; }
.hero-card .tag { font-size: 12px; background: #dff1e9; color: #1f7a63; padding: 3px 10px; border-radius: 6px; }
.hero-card .btn { margin-top: 12px; }
.lang-pill { font-size: 12px; background: var(--teal-soft); color: #167a62; padding: 2px 9px; border-radius: 6px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-auto-rows: max-content; gap: 16px; }
.p-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; cursor: pointer; }
.p-card:hover { border-color: #c4cfe4; box-shadow: 0 6px 22px rgba(20,30,60,.10); transform: translateY(-1px); }
.p-card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(47,181,148,.35), var(--shadow); }
.p-media { position: relative; height: 150px; background: linear-gradient(180deg, #f7f9fc, #eef2f8); display: flex; align-items: center; justify-content: center; }
.p-media img { max-width: 86%; max-height: 132px; object-fit: contain; }
.p-placeholder { font-size: 40px; opacity: .55; }
.p-cat { position: absolute; left: 10px; top: 10px; font-size: 11px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); }
.p-un { position: absolute; right: 10px; top: 10px; font-size: 10.5px; background: #fff4e0; color: #8a5a00; border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.p-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.p-sku { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.p-name { font-size: 12.5px; color: var(--ink-2); }
.p-spec { font-size: 12px; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.p-price { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.p-price b { font-size: 18px; color: #157a62; font-variant-numeric: tabular-nums; }
.p-tier { font-size: 11.5px; color: var(--muted); }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; margin-top: 4px; }
.p-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); gap: 8px; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: 0; background: #f6f8fb; width: 30px; cursor: pointer; font-size: 16px; }
.stepper input { width: 54px; border: 0; border-radius: 0; text-align: center; padding: 4px; }
.p-card.compact .p-media { height: 110px; }

.modal.browser { width: min(1240px, 96vw); display: flex; flex-direction: column; max-height: 92vh; }
.modal.browser header h3 { font-size: 18px; }
.browser-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 18px 6px; }
.browser-filters .search { flex: 1; min-width: 260px; }
.browser-cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 4px 18px 10px; border-bottom: 1px solid var(--line); }
.browser-cats button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 3px 12px; cursor: pointer; font-size: 13px; }
.browser-cats button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.browser-grid { flex: 1; overflow: auto; padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; background: #f7f9fc; align-content: start; grid-auto-rows: max-content; }
.browser-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.tray { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; max-height: 64px; overflow: auto; }
.tray .chip { padding: 2px 4px 2px 10px; }
.tray-total { font-weight: 700; color: var(--navy); }

.line-item { position: relative; padding-left: 52px !important; }
.line-thumb { position: absolute; left: 6px; top: 8px; width: 40px; height: 40px; object-fit: contain; background: #f6f8fb; border-radius: 6px; }
.line-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.empty-lines { margin-top: 10px; border: 2px dashed #cdd6e6; border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; background: #fafbfe; }
.empty-lines:hover { border-color: var(--teal); color: var(--teal); }
.alert.ok { background: var(--teal-soft); color: #136b56; }
.alert.ok a { margin-left: 8px; font-weight: 600; }
.attach-row { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.attach-row .muted { grid-column: 2 / 4; }
.attach-name { overflow-wrap: anywhere; font-size: 13px; }
.res-row { display: flex; gap: 6px; align-items: center; padding: 4px 0; font-size: 13px; }
.file-btn { position: relative; overflow: hidden; display: inline-block; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.product-head { display: grid; grid-template-columns: 160px 1fr; gap: 18px; margin-bottom: 14px; align-items: start; }
.product-image { width: 160px; height: 140px; border-radius: 12px; background: linear-gradient(180deg, #f7f9fc, #eef2f8); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { max-width: 92%; max-height: 92%; object-fit: contain; }
.product-image.large { height: 180px; }
.files-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.files-inline .chip { font-size: 12px; padding: 2px 10px; }
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; max-height: 240px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.sku-item { font-size: 12.5px; padding: 2px 4px; border-radius: 4px; }
.sku-item.on { background: var(--teal-soft); }
.thumb-cell { width: 52px; }
.thumb-cell img { width: 44px; height: 44px; object-fit: contain; }
.table.lines { overflow: visible; }
.lines .row-tools { width: 1%; white-space: nowrap; }
.lines .row-tools .icon-btn { padding: 0 3px; font-size: 14px; }
