:root {
  --navy: #1f4e79;
  --navy-deep: #12304d;
  --navy-ink: #0d1f31;
  --accent: #2f8f83;
  --gold: #b8892f;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-soft: #eef1f6;
  --text: #1c2733;
  --muted: #6b7a8c;
  --faint: #94a1b2;
  --red: #c0392b;
  --red-bg: #fdecea;
  --green: #1f7a52;
  --green-bg: #e8f5ee;
  --amber: #a46a12;
  --amber-bg: #fdf3e2;
  --blue-bg: #eaf1f9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 48, .04), 0 8px 24px -16px rgba(16, 30, 48, .18);
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd4e0; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: linear-gradient(180deg, #163a5b 0%, #0e2539 100%);
  color: #cdd9e6; display: flex; flex-direction: column; padding: 18px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #3c7fb8, #1f4e79);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-name { font-size: 14px; font-weight: 650; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 10px; color: #7e93a9; letter-spacing: 1.6px; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; }
.nav-group { margin: 12px 0 4px; padding: 0 8px; font-size: 10px; letter-spacing: 1.4px; color: #6f8399; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
  color: #c3d1e0; font-size: 13px; margin-bottom: 2px; border: 0; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.11); color: #fff; box-shadow: inset 2px 0 0 #6fb3e0; }
.nav-item .ico { width: 16px; display: inline-flex; justify-content: center; opacity: .85; }
.nav-item .dot {
  margin-left: auto; background: #d9694a; color: #fff; font-size: 10px; line-height: 1;
  border-radius: 9px; padding: 2px 5px; min-width: 16px; text-align: center;
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 10px 8px 0; font-size: 11px; color: #7e93a9; display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2a5f8c; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: 0 0 30px; }
.avatar.lg { width: 42px; height: 42px; font-size: 13px; flex-basis: 42px; }
.who { line-height: 1.35; }
.who b { color: #eaf1f8; font-weight: 600; font-size: 12px; display: block; }
.who span { color: #7e93a9; font-size: 10px; }
/* 构建指纹：刻意压得很淡，只在需要核对版本时才看得见 */
.who .build { display: block; color: #4d6076; font-size: 9px; letter-spacing: .02em; margin-top: 1px; cursor: help; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: 0 0 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
}
.crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 10px; width: 260px; color: var(--muted);
}
.search input { border: 0; background: none; outline: none; width: 100%; font-size: 12px; }
.content { flex: 1; overflow-y: auto; padding: 22px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.page-head p { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.page-head .spacer { flex: 1; }

/* ---------- 基础组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.card-h h3 { margin: 0; font-size: 13px; font-weight: 650; }
.card-h .spacer { flex: 1; }
.card-b { padding: 16px; }
.card-b.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 6px 12px; border-radius: 7px; font-size: 12px; color: var(--text); white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #c3cedd; background: #fafcff; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #183f63; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg); color: var(--text); }
.btn.danger { color: var(--red); border-color: #f0c8c2; background: #fff; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 4px 9px; font-size: 11.5px; }
.btn.xs { padding: 2px 7px; font-size: 11px; border-radius: 5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 顶栏语言菜单：每项用该语言自己的写法，不翻译 */
.lang-wrap { position: relative; }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 132px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.10); padding: 4px;
}
.lang-wrap.open .lang-menu { display: block; }
.lang-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 10px; border-radius: 6px; font-size: 12.5px; color: var(--text); cursor: pointer;
}
.lang-menu button:hover { background: var(--bg); }
.lang-menu button.on { background: #eef4fb; color: var(--navy); font-weight: 600; }

/* 脱敏行下方的权限提示条：说明为什么看不全，并把申请入口放在手边 */
.lock-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 9px; padding: 7px 10px; border-radius: 7px;
  background: #fbf7ec; border: 1px solid #efe2c8; font-size: 11.5px; color: #8a6420;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1.5px 7px;
  border-radius: 5px; background: var(--line-soft); color: var(--muted); white-space: nowrap;
}
.badge.blue { background: var(--blue-bg); color: var(--navy); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: #f0f2f6; color: #6b7a8c; }
.badge.gold { background: #fbf2df; color: #8a5b00; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.small { font-size: 11.5px; }

/* KPI */
.kpi { padding: 15px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .label { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.kpi .value { font-size: 25px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 11px; color: var(--faint); }
.kpi::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 68px; height: 68px;
  border-radius: 50%; background: var(--blue-bg); opacity: .7;
}
.kpi.teal::after { background: #e4f2f0; }
.kpi.gold::after { background: #fbf2df; }
.kpi.red::after { background: var(--red-bg); }

/* 表格 */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; letter-spacing: .3px;
  padding: 10px 12px; background: #fafbfd; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.name { font-weight: 550; }
table.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--muted); }
.field input, .field select, .field textarea, .input {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; outline: none;
  font-size: 12.5px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: #8fb4d6; box-shadow: 0 0 0 3px rgba(31,78,121,.08);
}
.field textarea { resize: vertical; min-height: 72px; }
.field .hint { font-size: 11px; color: var(--faint); }

/* 抽屉 */
.overlay {
  position: fixed; inset: 0; background: rgba(13,31,49,.34); backdrop-filter: blur(1px);
  z-index: 40; opacity: 0; animation: fade .18s forwards;
}
@keyframes fade { to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 94vw; background: #fff;
  z-index: 41; display: flex; flex-direction: column; box-shadow: -18px 0 48px -24px rgba(13,31,49,.4);
  animation: slide .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes slide { from { transform: translateX(28px); opacity: .6; } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: #fcfdff; }
.icon-btn { border: 0; background: none; font-size: 18px; color: var(--faint); line-height: 1; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }

.modal {
  position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 560px; max-width: 94vw; background: #fff; border-radius: 12px; box-shadow: 0 24px 64px -24px rgba(13,31,49,.5);
  display: flex; flex-direction: column; max-height: 88vh; animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: .5; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* 提示条 */
.banner { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 12px; align-items: flex-start; }
.banner.warn { background: var(--amber-bg); color: #7a4e0a; border: 1px solid #f3e0bd; }
.banner.info { background: var(--blue-bg); color: #17405f; border: 1px solid #d7e5f2; }
.banner.danger { background: var(--red-bg); color: #8d2b1f; border: 1px solid #f3d2cc; }
.banner.ok { background: var(--green-bg); color: #145c3c; border: 1px solid #cfe9dc; }
/* 单号在窄横幅里被从连字符处拆成两行（FA-2026- / 001），看着像两个号 */
.banner .mono { white-space: nowrap; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -18px; top: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; border: 2px solid #9fb6cc;
}
.tl-item.hot::before { border-color: var(--navy); background: var(--navy); }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tl-head b { font-weight: 600; }
.tl-body { color: #33414f; font-size: 12.5px; margin-top: 2px; }

/* 审批步骤 */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.step:not(:last-child)::before {
  content: ''; position: absolute; left: 11px; top: 32px; bottom: -2px; width: 1px; background: var(--line);
}
.step .bubble {
  width: 23px; height: 23px; border-radius: 50%; flex: 0 0 23px; display: grid; place-items: center;
  font-size: 11px; background: #f0f3f7; color: var(--muted); border: 1px solid var(--line); z-index: 1;
}
.step.done .bubble { background: var(--green-bg); color: var(--green); border-color: #cfe9dc; }
.step.current .bubble { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(31,78,121,.1); }
.step.reject .bubble { background: var(--red-bg); color: var(--red); border-color: #f3d2cc; }
.step .st-main { flex: 1; }
.step .st-title { font-size: 12.5px; font-weight: 550; }
.step .st-sub { font-size: 11.5px; color: var(--muted); }

/* 聊天 */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 340px; overflow-y: auto; padding: 4px 2px; }
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .av { width: 26px; height: 26px; border-radius: 50%; background: #dce7f2; color: #2c567c; display: grid; place-items: center; font-size: 10px; font-weight: 600; flex: 0 0 26px; }
.msg.member .av { background: #f6e8d2; color: #8a5b00; }
.msg .bubble2 { background: #f3f6fa; padding: 8px 11px; border-radius: 3px 10px 10px 10px; font-size: 12.5px; }
.msg.me .bubble2 { background: var(--blue-bg); border-radius: 10px 3px 10px 10px; }
.msg .meta { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.msg.me .meta { text-align: right; }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: none; padding: 9px 14px; font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

/* 空状态 */
.empty { padding: 46px 20px; text-align: center; color: var(--faint); font-size: 12.5px; }
.empty .big { font-size: 28px; opacity: .35; margin-bottom: 6px; }

/* toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #0f2233; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 12.5px;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); animation: toastIn .2s ease-out;
}
.toast.err { background: #8d2b1f; }
.toast.ok { background: #14603f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #0e2539;
}
.login-art {
  position: relative; overflow: hidden; padding: 56px; color: #dbe7f3;
  background: radial-gradient(1200px 600px at 10% 10%, #1e4f7a 0%, #0e2539 55%, #081a28 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-size: 30px; line-height: 1.35; margin: 0 0 14px; color: #fff; font-weight: 600; letter-spacing: .5px; }
.login-art p { color: #9db3c7; max-width: 420px; font-size: 13px; line-height: 1.9; }
.login-art .glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .35; }
/* 限定在登录页内，避免与全局布局类 .g2/.g3 冲突（曾把 grid g2 容器染成深蓝） */
.login-art .g1 { background: #2f8f83; right: -120px; top: -80px; }
.login-art .g2 { background: #2b6da3; left: -140px; bottom: -140px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.pill { border: 1px solid rgba(255,255,255,.16); padding: 5px 11px; border-radius: 20px; font-size: 11.5px; color: #b7c9da; }
.login-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; }
/* 登录页语言切换：俄语客户第一屏就得能读懂「账号 / 密码」 */
.login-lang { position: absolute; top: 18px; right: 22px; display: flex; gap: 2px; background: var(--bg); border-radius: 8px; padding: 2px; }
.login-lang button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.login-lang button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.login-box { width: 100%; max-width: 340px; }
.login-box h2 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
.login-box .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.seg { display: flex; background: var(--bg); border-radius: 8px; padding: 3px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.seg button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; }
.demo-accounts .t { font-size: 11px; color: var(--faint); margin-bottom: 8px; letter-spacing: .5px; }
.demo-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line); background: #fff;
  border-radius: 7px; padding: 6px 10px; margin-bottom: 6px; text-align: left; font-size: 12px;
}
.demo-chip:hover { border-color: #b9cde0; background: #fafcff; }
.demo-chip b { font-weight: 600; }
.demo-chip .tag { margin-left: auto; font-size: 10.5px; color: var(--faint); }

/* 明细键值 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 7px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.code {
  background: #f7f9fc; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px;
  font-family: var(--mono); font-size: 11px; color: #3b4b5c; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.quote-warn { border-left: 3px solid var(--amber); background: #fffdf8; padding: 10px 12px; border-radius: 0 7px 7px 0; }
.amount { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.amount.big { font-size: 20px; font-weight: 650; }
.progress { height: 5px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.masked { color: var(--faint); letter-spacing: .5px; }
/* 脱敏值本身当申请入口：点一下就去提申请，不必先找顶部按钮 */
.masked-hit { color: #b07722; background: #fff8e8; border: 1px dashed #e0c188; border-radius: 4px;
  padding: 0 4px; cursor: pointer; text-decoration: none; }
.masked-hit:hover { background: #fdf0d5; border-style: solid; color: #8f5e14; }
.lock-note { font-size: 11px; color: var(--faint); display: inline-flex; gap: 4px; align-items: center; }
.section-title { font-size: 11px; letter-spacing: 1.2px; color: var(--faint); text-transform: uppercase; margin: 18px 0 8px; }

/* ---- 客户导入预览 ----
   弹窗只有 ~640px，六列表格按内容撑开会把「说明」列顶出可视区（用户得横向拖才能看到
   判定原因，等于没看到）。改成固定布局 + 允许换行，六列一次看全。 */
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tbl tr.row-invalid td { background: #fff7f7; }
#imp-result .tbl { table-layout: fixed; width: 100%; }
#imp-result .tbl th, #imp-result .tbl td {
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  padding-left: 6px; padding-right: 6px; vertical-align: top;
}
#imp-result .tbl td.name { white-space: normal; font-size: 12.5px; }
#imp-result .tbl .note { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.tbl tr.row-invalid td.name { color: var(--red); }

/* ---- 屏幕水印（T17） ----
   平铺在内容之上、不接收鼠标事件。它只是「威慑 + 溯源」：截图、拍照、远程录屏都拦不住，
   真正守住数据边界的是后端字段脱敏、导出审批与审计日志。别把它当防泄密方案。 */
#wm-layer {
  position: fixed; inset: 0; z-index: 9990; pointer-events: none;
  background-repeat: repeat; background-position: 0 0;
}
@media print {
  #wm-layer { position: fixed; inset: 0; opacity: 1; }
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
}

@media (max-width: 1100px) {
  .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 780px) {
  .sidebar { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}

/* 询价单多行明细（V1.13）：展开行与内嵌明细表 */
.caret {
  border: 0; background: none; color: var(--faint); cursor: pointer;
  font-size: 11px; line-height: 1; padding: 2px 4px; margin-right: 3px; border-radius: 4px;
}
.caret:hover { background: var(--bg); color: var(--text); }
/* 询价单「产品明细」列：箭头固定占位，品名逐行左对齐，不会因为有没有箭头而错位 */
.inq-lines { display: flex; align-items: flex-start; gap: 2px; }
.inq-lines .caret { margin-top: 1px; flex: none; }
.inq-names { min-width: 0; line-height: 1.45; }
.tbl tr.sub-row > td { background: #fbfcfd; padding: 6px 10px 10px 32px; border-bottom: 1px solid var(--line); }
.sub-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.sub-tbl thead th {
  text-align: left; font-weight: 500; color: var(--faint); font-size: 11px;
  padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.sub-tbl thead th.num { text-align: right; }
.sub-tbl tbody td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.sub-tbl tbody tr:last-child td { border-bottom: 0; }

/* 转报价：商品行表格（V1.15）
   原来是一个下拉，一单三行只能逐条翻，数量/进价/售价没法横向对比；
   改成表格后一行一个商品，选中行决定下面的成本核算表。 */
.q-lines { table-layout: fixed; }
.q-lines tbody tr { cursor: pointer; }
.q-lines tbody tr.sel, .q-lines tbody tr.sel:hover { background: var(--blue-bg); }
.q-lines tbody tr.sel td { border-bottom-color: #cfe0ee; }
.q-lines .q-pick { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.q-lines .q-pick input[type="radio"] { margin: 3px 0 0; flex: none; }
/* 不给 width，输入框会按默认 20 字符撑开，把「商品行」挤成一列竖排字 */
.q-lines .input { width: 100%; padding: 6px 8px; font-size: 12.5px; }
.q-lines .q-name { font-weight: 600; }
.q-lines .q-meta { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; line-height: 1.35; }
/* 不要的行直接删掉（可撤销）：删除按钮低调一点，避免误点 */
.q-lines .q-del { color: var(--faint); font-weight: 400; }
.q-lines .q-del:hover { color: var(--red); border-color: var(--red); }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer;
  text-decoration: underline; font-size: 12px; font-family: inherit; }

/* ---- 询价列表（V1.14）：范围筛选 / 单号折叠 / 分页 / 只读标记 ---- */
.inq-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: #fcfdfe;
}
.inq-bar .spacer { flex: 1; }
.inq-bar .input.sm, .inq-bar select.input.sm { padding: 5px 8px; font-size: 12px; border-radius: 6px; }
.chip-row { display: flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); border-radius: 999px; padding: 4px 11px; font-size: 12px;
  transition: all .15s;
}
.chip:hover { border-color: #c3cedd; color: var(--text); }
.chip b { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--faint); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.chip.active b { color: rgba(255,255,255,.78); }
.chip .ro { font-style: normal; font-size: 10px; padding: 0 4px; border-radius: 4px; background: var(--amber-bg); color: var(--amber); }
.chip.active .ro { background: rgba(255,255,255,.18); color: #fff; }

/* 单号即折叠开关：点单号展开/收起内嵌明细 */
.no-cell { white-space: nowrap; }
.no-link {
  border: 0; background: none; padding: 0; font: inherit; color: var(--navy);
  font-family: var(--mono); font-size: 12px; display: inline-flex; align-items: center; gap: 4px;
}
.no-link:hover { text-decoration: underline; }
.no-plain { font-family: var(--mono); font-size: 12px; color: var(--text); }
.caret-lite { font-size: 10px; color: var(--faint); width: 9px; display: inline-block; }
.no-link:hover .caret-lite { color: var(--navy); }
.ro-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px;
  background: #f0f2f6; color: #6b7a8c; font-size: 10px; font-family: inherit; vertical-align: 1px;
}
/* 已作废：整行压暗，单号加删除线，一眼能区分「这单不再流转」 */
table.tbl tbody tr.voided > td { background: #fbfbfc; }
table.tbl tbody tr.voided .no-link, table.tbl tbody tr.voided .no-plain { color: var(--faint); text-decoration: line-through; }
table.tbl tbody tr.voided .name, table.tbl tbody tr.voided .inq-names { color: var(--muted); }

.pager {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-top: 1px solid var(--line-soft); background: #fff;
}
/* 询价页多了筛选条与分页条，表格滚动区相应减高，避免分页条被挤出视口 */
#inq-table { max-height: calc(100vh - 340px); }
.pager .spacer { flex: 1; }
.pg-row { display: flex; align-items: center; gap: 4px; }
.pg {
  min-width: 28px; height: 26px; padding: 0 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; font-size: 12px; color: var(--muted); font-family: var(--mono);
}
.pg:hover:not(:disabled) { border-color: #c3cedd; color: var(--text); }
.pg.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pg:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- V1.19：企业编号 / 平台控制台 / 供应商门户 ---------------- */
/* 登录页的企业卡片：先说清「你要进哪家公司」，再谈账号密码。
   有编号时是信息卡，没编号时是输入条，二者共用一套骨架，切换时版面不跳动。 */
.ent-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe;
}
.ent-card.input { background: #fff; border-style: dashed; }
.ent-main { flex: 1; min-width: 0; }
.ent-code { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.ent-name { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.ent-card input {
  width: 100%; border: 0; outline: none; background: none; font-size: 13.5px; font-weight: 600;
  color: var(--text); padding: 2px 0 0; font-family: var(--mono);
}
.ent-card input::placeholder { color: #b7c3d1; font-weight: 400; font-family: inherit; }
.ent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.ent-hint { font-size: 11.5px; color: var(--faint); margin: -8px 0 14px; line-height: 1.7; }
.login-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; font-size: 11.5px; color: var(--faint);
}
.login-foot a { color: var(--navy); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* 顶栏的「当前企业」：换公司要退出重登，但至少让人随时看得见自己在哪家 */
.tenant-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 280px;
  padding: 4px 10px; border-radius: 20px; background: #f2f6fb; border: 1px solid #dde7f2;
  font-size: 11.5px; color: #35506b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tenant-chip code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.tenant-chip .dot.amber { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); display: inline-block; }

/* 配额条：满格才报错太晚，用到 80% 就该被看见 */
.qbar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.qbar .track { flex: 1; height: 5px; background: var(--line-soft); border-radius: 3px; overflow: hidden; min-width: 60px; }
.qbar .track > i { display: block; height: 100%; background: var(--accent); }
.qbar .track > i.warn { background: var(--gold); }
.qbar .track > i.full { background: var(--red); }
.qbar b { font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 600; }

/* SaaS 控制台的租户卡：一行一家的信息量恰好，再多就得点进去 */
.tn-card { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: #fff; }
.tn-card + .tn-card { margin-top: 10px; }
.tn-card.susp { background: #fdfbfb; border-color: #f0dcd9; }
.tn-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tn-head h4 { margin: 0; font-size: 14px; font-weight: 620; }
.tn-head code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tn-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.tn-meta b { color: var(--text); font-weight: 600; }
