/* ===== 外贸公司 EPR 管理系统 · 后台样式 ===== */
:root {
  --c-primary: #1d4ed8;
  --c-primary-dark: #1e40af;
  --c-primary-light: #eff6ff;
  --c-side: #111c33;
  --c-side-hover: #1b2b4b;
  --c-side-active: #1d4ed8;
  --c-bg: #f4f6fa;
  --c-card: #ffffff;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text: #1e293b;
  --c-text-sub: #64748b;
  --c-text-mute: #94a3b8;
  --c-green: #15803d;
  --c-green-bg: #dcfce7;
  --c-red: #b91c1c;
  --c-red-bg: #fee2e2;
  --c-orange: #c2410c;
  --c-orange-bg: #ffedd5;
  --c-blue: #1d4ed8;
  --c-blue-bg: #dbeafe;
  --c-cyan: #0e7490;
  --c-cyan-bg: #cffafe;
  --c-gray: #475569;
  --c-gray-bg: #f1f5f9;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, .12);
  --side-w: 236px;
  --header-h: 54px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w); background: var(--c-side); color: #cbd5e1;
  position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 30;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.brand {
  min-height: 66px; max-height: 84px; display: flex; align-items: center; gap: 11px;
  padding: 8px 14px; border-bottom: 1px solid rgba(148,163,184,.15);
  position: sticky; top: 0; background: var(--c-side); z-index: 2;
}
.brand-logo {
  width: 26px; height: 26px; border-radius: 6px; flex: 0 0 26px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.brand-logo-img {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  background: rgba(255,255,255,.94); padding: 4px; box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.brand-copy { min-width: 0; }
.brand-text {
  font-size: 13.5px; font-weight: 700; color: #f1f5f9; line-height: 1.4;
  white-space: normal; word-break: keep-all; overflow-wrap: anywhere;
  letter-spacing: .2px;
}
.brand-br { display: block; font-size: 12px; font-weight: 600; color: #dbe7f7; }
.brand-sub { font-size: 10px; color: #8fa3bd; font-weight: 400; letter-spacing: .3px; line-height: 1.5; white-space: normal; }
.brand-sub b { color: #7fb1f5; font-weight: 700; letter-spacing: .5px; }
.brand-sub2 { display: block; color: #64748b; }

.nav { padding: 8px 0 24px; }
.nav-group { margin-bottom: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; color: #cbd5e1; font-size: 13px; cursor: pointer;
  border-left: 3px solid transparent; transition: background .13s, color .13s;
  user-select: none;
}
.nav-item:hover { background: var(--c-side-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(29,78,216,.22); color: #fff; border-left-color: #60a5fa; font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.nav-item .caret { margin-left: auto; width: 12px; height: 12px; opacity: .55; transition: transform .16s; }
.nav-group.open > .nav-item .caret { transform: rotate(90deg); }
.nav-sub { display: none; background: rgba(0,0,0,.22); }
.nav-group.open .nav-sub { display: block; }
.nav-sub a {
  display: block; padding: 7px 16px 7px 44px; font-size: 12.5px;
  color: #94a3b8; border-left: 3px solid transparent;
}
.nav-sub a:hover { color: #fff; background: var(--c-side-hover); text-decoration: none; }
.nav-sub a.active { color: #fff; background: rgba(29,78,216,.3); border-left-color: #60a5fa; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.breadcrumb { font-size: 13px; color: var(--c-text-sub); display: flex; align-items: center; gap: 6px; }
.breadcrumb b { color: var(--c-text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 4px 9px; border-radius: 20px; background: var(--c-red-bg); color: var(--c-red);
  font-weight: 600;
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; background: var(--c-primary-light);
  color: var(--c-primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.content { padding: 18px 20px 44px; flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 15px;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.card-title svg { width: 15px; height: 15px; stroke: var(--c-primary); fill: none; stroke-width: 2; }
.card-title small { font-weight: 400; color: var(--c-text-mute); font-size: 11.5px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 15px; flex-wrap: wrap; }
.page-title { font-size: 19px; font-weight: 700; margin: 0 0 3px; }
.page-desc { font-size: 12.5px; color: var(--c-text-sub); margin: 0; }
.page-head .card-actions { margin-left: auto; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6.5px 13px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-text);
  cursor: pointer; font-family: inherit; line-height: 1.35; transition: all .13s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #fca5a5; color: var(--c-red); }
.btn-danger:hover { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.btn-success { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.btn-success:hover { background: #166534; color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-xs { padding: 2.5px 7px; font-size: 11.5px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: #f8fafc; text-align: left; padding: 9px 12px; font-weight: 600;
  color: var(--c-text-sub); border-bottom: 1px solid var(--c-border);
  white-space: nowrap; font-size: 12.5px;
}
/* overflow-wrap: anywhere —— 超长不可断文本（超长品名 / 长编号 / 长 URL）
   会把表格撑到几千像素宽，整页出现横向滚动条；这里让单元格可断行兜底。 */
table.data td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; overflow-wrap: anywhere; }
table.data tbody tr:hover { background: #f8fafc; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.ctr, table.data th.ctr { text-align: center; }
table.data.compact th, table.data.compact td { padding: 6px 9px; font-size: 12.5px; }
.empty { padding: 40px 20px; text-align: center; color: var(--c-text-mute); font-size: 13px; }
.empty svg { width: 34px; height: 34px; stroke: #cbd5e1; fill: none; stroke-width: 1.5; margin-bottom: 8px; display: block; margin-inline: auto; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.tag-green { background: var(--c-green-bg); color: var(--c-green); }
.tag-red { background: var(--c-red-bg); color: var(--c-red); }
.tag-orange { background: var(--c-orange-bg); color: var(--c-orange); }
.tag-blue { background: var(--c-blue-bg); color: var(--c-blue); }
.tag-cyan { background: var(--c-cyan-bg); color: var(--c-cyan); }
.tag-gray { background: var(--c-gray-bg); color: var(--c-gray); }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; gap: 13px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--c-text-sub); font-weight: 500; }
.field > label .req { color: var(--c-red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--c-text-mute); }
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 6.5px 10px; border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  color: var(--c-text); background: #fff; transition: border-color .13s, box-shadow .13s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(29,78,216,.11);
}
textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
input[readonly], textarea[readonly] { background: #f8fafc; color: var(--c-text-sub); }
.form-actions {
  display: flex; gap: 9px; padding: 13px 16px; border-top: 1px solid var(--c-border);
  background: #fbfcfe; position: sticky; bottom: 0; z-index: 5;
}
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.checkbox input { width: auto; }

/* ---------------- 提示 ---------------- */
.alert {
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 13px; border: 1px solid transparent; line-height: 1.6;
}
.alert-info { background: var(--c-blue-bg); color: #1e3a8a; border-color: #bfdbfe; }
.alert-warn { background: var(--c-orange-bg); color: #7c2d12; border-color: #fed7aa; }
.alert-error { background: var(--c-red-bg); color: #7f1d1d; border-color: #fecaca; }
.alert-ok { background: var(--c-green-bg); color: #14532d; border-color: #bbf7d0; }
.alert b { font-weight: 700; }

/* ---------------- 统计卡 ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 13px; margin-bottom: 15px; }
.stat {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--c-text-sub); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.stat-value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-value.small { font-size: 16px; }
.stat-sub { font-size: 11.5px; color: var(--c-text-mute); margin-top: 3px; }
.stat.danger { border-left: 3px solid var(--c-red); }
.stat.warning { border-left: 3px solid #f97316; }
.stat.ok { border-left: 3px solid var(--c-green); }
.stat.info { border-left: 3px solid var(--c-primary); }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 16px; background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow);
}
.filter-bar .field { min-width: 132px; }
.filter-bar .field.wide { min-width: 200px; }
.filter-bar .spacer { flex: 1; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-top: 1px solid var(--c-border); flex-wrap: wrap; }
.pager .info { margin-right: auto; font-size: 12.5px; color: var(--c-text-sub); }
.pager a, .pager span.cur {
  min-width: 30px; text-align: center; padding: 4px 9px; border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--c-text); background: #fff;
}
.pager span.cur { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.pager a:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }

/* ---------------- Tab ---------------- */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--c-border); margin-bottom: 15px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 15px; font-size: 13px; color: var(--c-text-sub); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 500;
}
.tabs a:hover { color: var(--c-primary); text-decoration: none; }
.tabs a.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* ---------------- 时间轴 ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--c-border);
}
.tl-item { position: relative; padding-bottom: 17px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -22px; top: 3px; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--c-border-strong); z-index: 1;
}
.tl-dot.done { border-color: var(--c-green); background: var(--c-green); }
.tl-dot.active { border-color: var(--c-primary); background: #fff; box-shadow: 0 0 0 3px rgba(29,78,216,.16); }
.tl-dot.delayed { border-color: var(--c-red); background: var(--c-red); }
.tl-dot.reject { border-color: var(--c-red); background: #fff; }
.tl-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tl-meta { font-size: 11.5px; color: var(--c-text-mute); margin-top: 2px; }
.tl-body { font-size: 12.5px; color: var(--c-text-sub); margin-top: 4px; line-height: 1.6; }

/* ---------------- 详情描述 ---------------- */
.desc { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 11px 20px; }
.desc-item { display: flex; gap: 9px; font-size: 13px; min-width: 0; }
.desc-item > span:first-child { color: var(--c-text-sub); flex: 0 0 auto; min-width: 78px; }
.desc-item > span:last-child { font-weight: 500; word-break: break-all; flex: 1; min-width: 0; }

/* ---------------- 单证编辑器 ---------------- */
.doc-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
@media (max-width: 1300px) { .doc-editor { grid-template-columns: 1fr; } }
.editor-pane { max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 4px; }
.preview-pane { position: sticky; top: 68px; }
.preview-frame { background: #e7ebf2; padding: 14px; border-radius: var(--radius); }
.a4 {
  background: #fff; width: 100%; max-width: 794px; margin: 0 auto;
  padding: 24px 28px; box-shadow: var(--shadow-lg); border-radius: 2px;
  font-size: 10.5px; line-height: 1.5; color: #111; min-height: 600px;
}
/* ---- 单证配色（对齐公司实际对外单据的蓝色商务风） ---- */
.a4 { --doc-blue: #1f5fa9; --doc-label-bg: #dfeafb; --doc-border: #55606e; }
.a4 h1, .a4 h2 { display: none; }
.a4 .doc-head { text-align: center; margin-bottom: 10px; }
.a4 .doc-logo {
  display: block; width: 52px; height: 52px; object-fit: contain;
  margin: 0 auto 4px;
}
.a4 .doc-company {
  font-size: 17px; font-weight: 700; letter-spacing: 2px; line-height: 1.3;
  color: var(--doc-blue);
}
.a4 .doc-company-en {
  font-size: 11px; color: var(--doc-blue); letter-spacing: .4px; line-height: 1.35;
}
.a4 .doc-contact { font-size: 9px; color: #333; line-height: 1.5; margin-top: 2px; }
.a4 .doc-contact span { display: block; }
.a4 .doc-title-band {
  font-size: 17px; font-weight: 700; color: var(--doc-blue);
  margin: 9px 0 8px; letter-spacing: 1px;
}
.a4 .doc-title-sep { font-weight: 400; opacity: .55; padding: 0 2px; }
.a4 .doc-badge {
  font-size: 8.5px; font-weight: 500; vertical-align: 2px; padding: 1px 7px;
  border: 1px solid var(--doc-blue); color: var(--doc-blue); border-radius: 8px;
  letter-spacing: .5px; margin-left: 5px;
}
.a4 .doc-line {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--doc-border); font-size: 9.5px; text-align: left;
}
.a4 .doc-line-4 { grid-template-columns: repeat(4, 1fr); }
.a4 .doc-line-cell { display: grid; grid-template-columns: auto 1fr; border-right: 1px solid var(--doc-border); }
.a4 .doc-line-cell:last-child { border-right: none; }
.a4 .doc-line-k {
  padding: 4px 6px; background: var(--doc-label-bg); font-weight: 600;
  border-right: 1px solid var(--doc-border); white-space: nowrap; line-height: 1.25;
}
.a4 .doc-line-v { padding: 4px 6px; word-break: keep-all; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a4 table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.a4 table th, .a4 table td { border: 1px solid var(--doc-border); padding: 4px 6px; vertical-align: top; word-break: break-word; }
.a4 table th { background: var(--doc-label-bg); font-weight: 600; text-align: center; white-space: nowrap; color: #16324f; }
.a4 table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.a4 table td.ctr { text-align: center; }
.a4 table.items td:nth-child(2), .a4 table.items th:nth-child(2) { min-width: 130px; }
.a4 .kv { display: grid; grid-template-columns: 90px 1fr; border: 1px solid var(--doc-border); border-bottom: none; font-size: 9.5px; }
.a4 .kv:last-of-type { border-bottom: 1px solid var(--doc-border); }
.a4 .kv > div { padding: 3.5px 6px; border-right: 1px solid var(--doc-border); }
.a4 .kv > div:last-child { border-right: none; }
.a4 .kv > div:first-child { background: var(--doc-label-bg); font-weight: 500; }
.a4 .grid2 {
  display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--doc-border);
  border-bottom: none; margin-bottom: 8px;
}
.a4 .grid2 > div { padding: 4px 7px; border-right: 1px solid var(--doc-border); min-height: 34px; display: flex; gap: 8px; align-items: flex-start; }
.a4 .grid2 > div:last-child { border-right: none; }
.a4 .grid2 .lbl {
  font-size: 9px; color: #16324f; font-weight: 600; flex: 0 0 auto;
  background: var(--doc-label-bg); border: 1px solid var(--doc-border);
  padding: 2px 6px; margin-top: 1px; white-space: nowrap;
}
.a4 .grid2 .val { font-size: 10px; font-weight: 500; word-break: break-word; flex: 1; }
.a4 .section { margin: 8px 0; }
.a4 .section-title {
  font-size: 10px; font-weight: 700; padding: 3px 7px; background: var(--doc-label-bg);
  border: 1px solid var(--doc-border); border-bottom: none; letter-spacing: .5px; color: #16324f;
}
.a4 .notes { font-size: 9.5px; color: #222; line-height: 1.7; margin-top: 10px; }
.a4 .notes-title { font-weight: 700; color: var(--doc-blue); margin-bottom: 3px; }
.a4 .notes ol { margin: 0; padding-left: 16px; }
.a4 .amount-words { border: 1px solid var(--doc-border); padding: 5px 7px; font-size: 9.5px; margin-top: 6px; }
.a4 .sign-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 16px;
  border: 1px solid var(--doc-border); page-break-inside: avoid;
}
.a4 .sign-box { border-right: 1px solid var(--doc-border); padding: 6px 9px; font-size: 9.5px; min-height: 62px; }
.a4 .sign-box:last-child { border-right: none; }
.a4 .watermark {
  position: absolute; font-size: 60px; color: rgba(220,38,38,.13); font-weight: 800;
  transform: rotate(-22deg); pointer-events: none; left: 50%; top: 46%;
  transform-origin: center; white-space: nowrap; letter-spacing: 8px;
}
.a4-wrap { position: relative; }

/* ================================================================
   登录页（全屏分栏：左公司形象放大 / 右登录表单）
   ================================================================ */
.lg-body { margin: 0; background: #0b1526; }

.lg-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(400px, 520px);
}

/* ---------- 左侧：公司形象 ---------- */
.lg-brandpane {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 56px 30px;
  color: #e8eefb;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(56, 130, 246, .30), transparent 60%),
    radial-gradient(900px 500px at 105% 110%, rgba(14, 165, 233, .22), transparent 62%),
    linear-gradient(150deg, #0b1526 0%, #10203c 45%, #14315e 100%);
  overflow: hidden;
}
/* 细网格纹理 */
.lg-brandpane::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000 40%, transparent 82%);
  pointer-events: none;
}
.lg-brandpane-inner { position: relative; z-index: 1; max-width: 660px; }

.lg-logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.lg-logo {
  width: 66px; height: 66px; object-fit: contain; flex: 0 0 66px;
  background: rgba(255,255,255,.96); border-radius: 16px; padding: 7px;
  box-shadow: 0 10px 26px rgba(0,0,0,.32);
}
.lg-co-badge {
  font-size: 12px; letter-spacing: .08em; font-weight: 600;
  color: #bfdbfe; border: 1px solid rgba(147, 197, 253, .42);
  background: rgba(37, 99, 235, .18);
  padding: 6px 13px; border-radius: 999px; white-space: nowrap;
}

/* 公司名称：显著放大 */
.lg-co-name {
  margin: 0;
  font-size: clamp(34px, 3.5vw, 54px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.015em;
  color: #fff;
  text-shadow: 0 6px 30px rgba(37, 99, 235, .38);
}
.lg-co-sub { font-weight: 600; color: #a9c8f5; }
.lg-co-en {
  margin-top: 14px;
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: .015em;
  color: #8fb4e6; font-weight: 500;
}
.lg-co-desc {
  margin: 26px 0 0;
  font-size: 15px; color: #c7d9f2; letter-spacing: .02em;
}

.lg-feats { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 13px; }
.lg-feats li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14.5px; color: #d5e3f7; line-height: 1.55;
}
.lg-feats .dot {
  width: 7px; height: 7px; flex: 0 0 7px; margin-top: 8px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.lg-contact {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid rgba(148, 184, 230, .22);
  display: grid; gap: 10px;
}
.lg-contact-line { display: flex; gap: 14px; font-size: 13px; line-height: 1.6; }
.lg-contact-line .k {
  flex: 0 0 40px; color: #7ea6d8; letter-spacing: .16em; font-size: 12px;
}
.lg-contact-line .v { color: #dbe7f8; }

.lg-brandpane-foot {
  position: relative; z-index: 1;
  margin-top: 32px; font-size: 12px; color: #6f8fb8;
}

/* ---------- 右侧：登录表单 ---------- */
.lg-formpane {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 40px;
  background: #f5f8fd;
  border-left: 1px solid rgba(15, 23, 42, .06);
}
.lg-card {
  width: 100%; max-width: 390px;
  background: #fff; border-radius: 18px;
  padding: 38px 34px 30px;
  border: 1px solid #e6edf7;
  box-shadow: 0 18px 50px rgba(15, 40, 80, .10), 0 2px 8px rgba(15, 40, 80, .05);
}
.lg-card-head { margin-bottom: 26px; }
.lg-card-head h2 {
  margin: 0; font-size: 25px; font-weight: 800; color: #0f2340; letter-spacing: -.01em;
}
.lg-card-head p { margin: 7px 0 0; font-size: 13px; color: #7b8da6; }

.lg-field { margin-bottom: 18px; }
.lg-field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: #445b7a; margin-bottom: 7px; letter-spacing: .02em;
}
.lg-field input {
  width: 100%; height: 46px; padding: 0 14px;
  font-size: 14.5px; color: #10233f;
  background: #f8fbff;
  border: 1.5px solid #dbe6f4; border-radius: 10px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.lg-field input::placeholder { color: #a9b8cc; }
.lg-field input:focus {
  outline: none; background: #fff;
  border-color: #2f7cf6;
  box-shadow: 0 0 0 3.5px rgba(47, 124, 246, .14);
}

.lg-pwd { position: relative; }
.lg-pwd input { padding-right: 46px; }
.lg-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: #93a5bd; cursor: pointer; transition: color .16s, background .16s;
}
.lg-eye:hover { color: #2f7cf6; background: #eff5ff; }
.lg-eye.on { color: #2f7cf6; }

.lg-submit {
  width: 100%; height: 48px; margin-top: 6px;
  font-size: 15.5px; font-weight: 700; letter-spacing: .12em;
  color: #fff; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #2f7cf6 0%, #1c5fd0 100%);
  box-shadow: 0 10px 22px rgba(47, 124, 246, .30);
  transition: transform .12s, box-shadow .16s, filter .16s;
}
.lg-submit:hover { filter: brightness(1.05); box-shadow: 0 12px 26px rgba(47,124,246,.38); }
.lg-submit:active { transform: translateY(1px); box-shadow: 0 6px 14px rgba(47,124,246,.28); }

.lg-tips {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px dashed #e3ebf6;
  font-size: 11.5px; color: #90a1b8; line-height: 1.8;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.lg-sep { color: #c7d3e3; }

.lg-card .alert { margin-bottom: 16px; }
.lg-mobile-brand { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .lg-wrap { grid-template-columns: 1fr; }
  .lg-brandpane { display: none; }
  .lg-formpane {
    min-height: 100vh; padding: 32px 22px;
    background:
      radial-gradient(900px 500px at 50% -10%, rgba(47,124,246,.16), transparent 65%),
      #f5f8fd;
  }
  .lg-mobile-brand {
    display: grid; gap: 3px; text-align: center; margin-top: 26px;
  }
  .lg-mobile-brand strong { font-size: 15px; color: #21395c; font-weight: 700; }
  .lg-mobile-brand span { font-size: 11.5px; color: #8899b0; }
}
@media (max-width: 480px) {
  .lg-card { padding: 28px 22px 24px; border-radius: 14px; }
  .lg-card-head h2 { font-size: 22px; }
  .lg-field input { height: 44px; }
  .lg-submit { height: 46px; }
}


/* ---------------- 其他 ---------------- */
.muted { color: var(--c-text-mute); }
.sub { color: var(--c-text-sub); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.ctr { text-align: center; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mb8 { margin-bottom: 8px; }
.mb14 { margin-bottom: 14px; }
.flex { display: flex; gap: 9px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; }
.pill-info {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  background: var(--c-primary-light); color: var(--c-primary-dark);
  border-radius: 12px; font-size: 11.5px; font-weight: 500;
}
.danger-text { color: var(--c-red); font-weight: 600; }
.warn-text { color: var(--c-orange); font-weight: 600; }
.ok-text { color: var(--c-green); font-weight: 600; }
.divider { height: 1px; background: var(--c-border); margin: 13px 0; }
.help-text { font-size: 12px; color: var(--c-text-sub); line-height: 1.7; }
code.inline { background: #f1f5f9; padding: 1.5px 5px; border-radius: 3px; font-size: 12px; font-family: ui-monospace, monospace; }

.alert-list { display: flex; flex-direction: column; gap: 9px; }
.alert-row {
  display: flex; gap: 11px; padding: 11px 13px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); background: #fff; align-items: flex-start;
}
.alert-row.danger { border-left: 3px solid var(--c-red); background: #fffbfb; }
.alert-row.warning { border-left: 3px solid #f97316; background: #fffcf8; }
.alert-row.info { border-left: 3px solid var(--c-primary); }
.alert-icon { flex: 0 0 18px; margin-top: 1px; }
.alert-icon svg { width: 17px; height: 17px; fill: none; stroke-width: 2; }
.alert-row.danger .alert-icon svg { stroke: var(--c-red); }
.alert-row.warning .alert-icon svg { stroke: #f97316; }
.alert-row.info .alert-icon svg { stroke: var(--c-primary); }
.alert-main { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.alert-detail { font-size: 12px; color: var(--c-text-sub); white-space: pre-wrap; line-height: 1.6; }
.alert-side { margin-left: auto; text-align: right; flex: 0 0 auto; }

.cal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }
.cal-month { border: 1px solid var(--c-border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.cal-month-head { padding: 6px 10px; background: #f8fafc; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; }
.cal-month-body { padding: 7px 9px; min-height: 56px; display: flex; flex-direction: column; gap: 4px; }
.cal-item { font-size: 11.5px; line-height: 1.45; padding: 3px 6px; border-radius: 3px; background: var(--c-gray-bg); }
.cal-item.danger { background: var(--c-red-bg); color: var(--c-red); font-weight: 600; }
.cal-item.warning { background: var(--c-orange-bg); color: var(--c-orange); }
.cal-item.ok { background: var(--c-green-bg); color: var(--c-green); }

.badge-count {
  display: inline-block; min-width: 17px; padding: 0 5px; height: 17px; line-height: 17px;
  background: var(--c-red); color: #fff; border-radius: 9px; font-size: 10.5px;
  text-align: center; font-weight: 600; margin-left: auto;
}

.toast {
  position: fixed; top: 16px; right: 16px; z-index: 9999; padding: 11px 16px;
  border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-lg);
  background: #fff; border-left: 4px solid var(--c-primary); max-width: 380px;
}
.toast.ok { border-left-color: var(--c-green); }
.toast.err { border-left-color: var(--c-red); }


/* ---------------- 单证 A4 版式补充 ---------------- */
@media print { .a4 .doc-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .a4 .muted-hint { display: none; } }
.a4 .muted-hint { color: #98a2b3; font-size: 9px; font-style: italic; }
.a4 .kv-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 8px;
}
.a4 .kv-list.kv-list-1 { grid-template-columns: 1fr; }
.a4 .kv-row {
  display: flex; align-items: stretch; border: 1px solid var(--doc-border);
  font-size: 9.5px;
}
.a4 .kv-row:last-child { border-bottom: 1px solid var(--doc-border); }
.a4 .kv-row .k {
  padding: 3px 7px; background: var(--doc-label-bg); font-weight: 600;
  border-right: 1px solid var(--doc-border); color: #16324f; white-space: nowrap;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.25;
}
.a4 .kv-row .k .k-en { font-weight: 400; color: #5a6b80; font-size: 8px; display: block; }
/* 英文为主：标签英文在上，中文作灰色小字对照 */
.a4 .kv-row .k .k-cn { font-weight: 400; color: #7a8798; font-size: 8px; display: block; letter-spacing: 0; }
.a4 .section-title .st-cn { font-weight: 400; color: #7a8798; font-size: 9px; margin-left: 3px; }
.a4 .items thead th .th-cn { display: block; font-weight: 400; color: #7a8798; font-size: 7.5px; letter-spacing: 0; }
.a4 .totals .t-cn { font-style: normal; color: #8a94a3; font-size: 8px; margin-left: 2px; }
.a4 .amount-words .words-cn { font-size: 8.5px; color: #7a8798; margin-top: 2px; }
.doc-line-k .k-cn { font-weight: 400; color: #7a8798; font-size: 8px; display: block; letter-spacing: 0; }
.a4 .kv-row .v { padding: 3px 7px; word-break: break-word; flex: 1; display: flex; align-items: center; }
.a4 .totals {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end;
  border: 1px solid var(--doc-border); border-top: none; padding: 6px 9px; font-size: 9.5px;
}
.a4 .totals .grand { font-size: 12px; color: #c0392b; }
.a4 .totals .grand b { color: #c0392b; }
.a4 .sign-role { font-weight: 700; font-size: 10px; }
.a4 .sign-line { min-height: 30px; padding-top: 4px; }
.a4 .sealed { color: #b91c1c; border: 1px solid #b91c1c; padding: 0 4px; font-size: 8.5px;
  border-radius: 3px; transform: rotate(-3deg); display: inline-block; }
.a4 .sign-sub { font-size: 8.5px; color: #666; }

/* 单证编辑器：明细行内编辑表格 */
.item-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.item-table th {
  background: #f8fafc; padding: 6px 5px; font-size: 11.5px; font-weight: 600;
  color: var(--c-text-sub); border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.item-table td { padding: 3px 3px; border-bottom: 1px solid #f1f5f9; }
.item-table input, .item-table select { padding: 4px 5px !important; font-size: 12px !important; min-width: 46px; }
.item-table input[data-k="product_name_cn"], .item-table input[data-k="product_name_en"] { min-width: 110px; }
.item-table input[data-k="spec"], .item-table input[data-k="marks"] { min-width: 80px; }
.item-table .row-del { color: var(--c-red); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.field-list { display: flex; flex-direction: column; gap: 10px; }
.group-title {
  font-size: 12.5px; font-weight: 600; color: var(--c-primary-dark); margin: 14px 0 7px;
  padding-bottom: 5px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 6px;
}
.group-title:first-child { margin-top: 0; }
.inline-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.hint-inline { font-size: 11.5px; color: var(--c-text-mute); }

/* 审批时间线补充 */
.timeline .tl-title b { font-weight: 600; }
.tl-opinion {
  background: #f8fafc; border-left: 2px solid var(--c-border); padding: 5px 9px;
  margin-top: 5px; font-size: 12.5px; color: var(--c-text-sub); border-radius: 0 3px 3px 0;
  white-space: pre-wrap; word-break: break-word;
}
.node-card {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 11px 13px;
  background: #fff; margin-bottom: 9px;
}
.node-card.done { border-left: 3px solid var(--c-green); }
.node-card.cur { border-left: 3px solid var(--c-primary); background: #f8fbff; }
.node-card.reject { border-left: 3px solid var(--c-red); }
.node-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.node-seq {
  width: 20px; height: 20px; border-radius: 50%; background: var(--c-primary);
  color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex: 0 0 20px;
}
.node-pill { font-size: 11.5px; color: var(--c-text-sub); }

/* 首页/工作台补充 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 11px; }
.quick-card {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 13px;
  background: #fff; text-decoration: none; color: inherit; transition: .14s;
}
.quick-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow); text-decoration: none;
  transform: translateY(-1px); }
.quick-card .qc-icon { color: var(--c-primary); margin-bottom: 7px; }
.quick-card .qc-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.quick-card .qc-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.quick-card .qc-desc { font-size: 11.5px; color: var(--c-text-mute); }

/* 安全自查 */
.scan-item {
  display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); background: #fff; align-items: flex-start;
}
.scan-item.fail-danger { border-left: 3px solid var(--c-red); background: #fffbfb; }
.scan-item.fail-warning { border-left: 3px solid #f97316; background: #fffcf8; }
.scan-item.pass { border-left: 3px solid var(--c-green); }
.scan-item.info { border-left: 3px solid var(--c-primary); }
.scan-icon { flex: 0 0 17px; font-size: 14px; font-weight: 700; }
.scan-item.pass .scan-icon { color: var(--c-green); }
.scan-item.fail-danger .scan-icon { color: var(--c-red); }
.scan-item.fail-warning .scan-icon { color: #f97316; }
.scan-item.info .scan-icon { color: var(--c-primary); }

/* 表格里的小标签行 */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }


/* ---------------- 审批时间线补充（页面级） ---------------- */
.tl-main { min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tl-head b { font-weight: 600; }
.tl-dot-blue { border-color: var(--c-primary); background: var(--c-primary); }
.tl-dot-green { border-color: var(--c-green); background: var(--c-green); }
.tl-dot-red { border-color: var(--c-red); background: var(--c-red); }
.tl-dot-orange { border-color: #f97316; background: #fff; box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.tl-dot-gray { border-color: var(--c-border-strong); background: #fff; }

/* ---------------- 非 A4 页面的键值列表 ---------------- */
.kv-list { display: flex; flex-direction: column; }
.kv-list .kv-row {
  display: grid; grid-template-columns: 104px 1fr; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--c-border); font-size: 12.5px;
}
.kv-list .kv-row:last-child { border-bottom: none; }
.kv-list .kv-row .k { color: var(--c-text-sub); }
.kv-list .kv-row .v { color: var(--c-text); word-break: break-word; }

/* ---------------- 通用小节标题 ---------------- */
.group-title {
  font-size: 13px; font-weight: 600; color: var(--c-primary-dark);
  border-left: 3px solid var(--c-primary); padding-left: 8px; margin: 16px 0 10px;
}
.group-title:first-child { margin-top: 0; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.field-list { display: flex; flex-direction: column; gap: 9px; }

/* ---------------- 卡片内的小统计 ---------------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 118px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 11px 13px; background: #fff;
}
.stat-box .sb-label { font-size: 11.5px; color: var(--c-text-mute); margin-bottom: 4px; }
.stat-box .sb-value { font-size: 19px; font-weight: 700; line-height: 1.15; }
.stat-box.red .sb-value { color: var(--c-red); }
.stat-box.green .sb-value { color: var(--c-green); }
.stat-box.orange .sb-value { color: #ea580c; }
.stat-box.blue .sb-value { color: var(--c-primary); }
.stat-box.gray .sb-value { color: var(--c-text-sub); }

/* ---------------- 极简进度条 ---------------- */
.bar { height: 5px; border-radius: 3px; background: var(--c-border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c-primary); border-radius: 3px; }
.bar.warn > i { background: #f97316; }
.bar.danger > i { background: var(--c-red); }
.bar.ok > i { background: var(--c-green); }

/* 打印 */
@media print {
  .sidebar, .topbar, .card-actions, .filter-bar, .pager, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; }
  .preview-frame { background: #fff; padding: 0; }
  .a4 { box-shadow: none; max-width: none; padding: 0; }
  .doc-editor { grid-template-columns: 1fr; }
  .editor-pane { max-height: none; overflow: visible; }
  .preview-pane { position: static; }
  @page { size: A4; margin: 12mm; }
}

/* ================= 孚盟风格主题层（v1.1） ================= */
:root {
  --c-side: #0b1f3f;
  --c-side-hover: rgba(59, 141, 240, .16);
  --c-side-active: linear-gradient(90deg, #1a73e8, #3b8df0);
  --c-primary: #1a73e8;
}
body { background: linear-gradient(180deg, #f2f6fc, #f4f6fa 220px); }
.sidebar {
  background: linear-gradient(180deg, #0b1f3f 0%, #0d2547 55%, #0a1c38 100%);
  box-shadow: 2px 0 14px rgba(2, 8, 20, .35);
}
.sidebar .brand {
  background: linear-gradient(90deg, rgba(26,115,232,.25), rgba(26,115,232,.05));
  border-bottom: 1px solid rgba(59,141,240,.25);
}
.nav-item.active, .nav-sub a.active {
  background: linear-gradient(90deg, #1a73e8, #3b8df0) !important;
  color: #fff !important;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(26, 115, 232, .4);
}
.nav-sub a:hover { background: var(--c-side-hover); color: #9cc3f7; border-radius: 8px; }
.nav-group > .nav-item:hover { background: var(--c-side-hover); border-radius: 8px; }
.page-title { font-weight: 700; letter-spacing: .3px; }
.stat-row .stat, .card {
  border-radius: 12px;
  border: 1px solid #e8eef6;
}
.btn-primary, .btn.primary {
  background: linear-gradient(90deg, #1a73e8, #3b8df0);
  border: none;
  box-shadow: 0 3px 10px rgba(26, 115, 232, .3);
}
.btn-primary:hover, .btn.primary:hover { filter: brightness(1.06); }
table.data tbody tr:hover td { background: #f0f6ff; }

/* ================= 订单执行链路（四联单） ================= */
.exec-flow{display:flex;align-items:center;gap:0;margin:6px 0 4px}
.exec-node{text-align:center;flex:0 0 auto;min-width:74px}
.exec-dot{width:28px;height:28px;border-radius:50%;margin:0 auto 6px;background:#e2e8f0;color:#94a3b8;
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;transition:.2s}
.exec-node.done .exec-dot{background:linear-gradient(135deg,#1a73e8,#3b8df0);color:#fff;box-shadow:0 3px 10px rgba(26,115,232,.35)}
.exec-name{font-size:12.5px;font-weight:600;color:var(--c-text)}
.exec-count{font-size:11px;color:var(--c-text-mute)}
.exec-line{flex:1;height:2px;background:#e2e8f0;margin:0 6px 22px}
.exec-line.on{background:linear-gradient(90deg,#1a73e8,#3b8df0)}
.exec-tabs{display:flex;gap:4px;margin:18px 0 10px;border-bottom:1px solid var(--c-border);flex-wrap:wrap}
.exec-tab{background:none;border:none;border-bottom:2px solid transparent;padding:8px 14px;font-size:13px;
  color:var(--c-text-sub);cursor:pointer;font-family:inherit;margin-bottom:-1px}
.exec-tab b{font-weight:600;color:var(--c-text-mute);margin-left:3px}
.exec-tab.on{color:#1a73e8;border-bottom-color:#1a73e8;font-weight:600}
.exec-tab.on b{color:#1a73e8}
.exec-pane{display:none}
.exec-pane.on{display:block}
.exec-table{width:100%;border-collapse:collapse;font-size:12.5px}
.exec-table th{background:#f8fafc;text-align:left;padding:8px 10px;color:var(--c-text-sub);
  font-weight:600;font-size:12px;border-bottom:1px solid var(--c-border);white-space:nowrap}
.exec-table td{padding:9px 10px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.exec-table tr:last-child td{border-bottom:none}
.exec-table tr:hover td{background:#f6faff}
.exec-empty{padding:20px;text-align:center;color:var(--c-text-mute);font-size:12.5px;background:#fafbfc;border-radius:8px}
.exec-add{margin-top:12px;border:1px dashed var(--c-border-strong);border-radius:9px;padding:10px 14px;background:#fcfdff}
.exec-add summary{cursor:pointer;font-size:13px;color:#1a73e8;font-weight:600;list-style:none}
.exec-add summary::-webkit-details-marker{display:none}
.exec-add[open] summary{margin-bottom:12px}
.exec-form{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.exec-form label{display:block;font-size:11.5px;color:var(--c-text-sub);margin-bottom:3px}
.exec-form input,.exec-form select{width:100%;padding:7px 9px;border:1px solid var(--c-border-strong);
  border-radius:6px;font-size:12.5px;font-family:inherit;box-sizing:border-box}
@media(max-width:1000px){.exec-form{grid-template-columns:repeat(2,1fr)}}

/* ================= 移动端布局（侧栏抽屉） ================= */
.sb-mask{display:none}
@media (max-width: 900px) {
  .sidebar{
    transform: translateX(-100%); transition: transform .22s ease;
    width: 264px; box-shadow: 4px 0 24px rgba(2,8,20,.4);
  }
  body.sb-open .sidebar{ transform: translateX(0); }
  .main{ margin-left: 0; }
  .topbar{ padding: 0 12px; gap: 8px; overflow: hidden; }
  .menu-btn{
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 1px solid var(--c-border);
    border-radius: 8px; background: #fff; cursor: pointer; flex: 0 0 34px;
  }
  .menu-btn svg{ width: 18px; height: 18px; stroke: var(--c-text); fill: none; stroke-width: 2.2; }
  .sb-mask{
    display: block; position: fixed; top: 0; left: 0; bottom: 0;
    width: 100vw; max-width: 100%; background: rgba(2,8,20,.45);
    z-index: 25; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  /* 兜底：任何元素意外超宽时也不产生整页横向滚动 */
  html, body{ overflow-x: hidden; }
  body.sb-open .sb-mask{ opacity: 1; pointer-events: auto; }
  .user-chip{ display: none; }
  .breadcrumb span:first-child{ display: none; }
  .content{ padding: 14px 12px 40px; }
  .topbar-right .btn-sm{ padding: 5px 8px; font-size: 11.5px; }
  .filter-bar{ flex-wrap: wrap; }
  /* 统计卡片：手机端强制 2 列网格，避免 flex 最小宽度撑出横向滚动 */
  .stat-row{ display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .stat-row > *{ min-width: 0 !important; }
  /* 手机端弹窗：限制高度并可滚动，保证底部按钮始终可点 */
  dialog{ width: 96vw !important; max-width: 96vw !important;
          max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  dialog > form > .form-actions,
  dialog > .form-actions{ position: sticky; bottom: 0; background: #fff;
                          box-shadow: 0 -6px 14px rgba(2,8,20,.06); }
  .form-grid.grid-3, .form-grid.grid-2{ grid-template-columns: 1fr !important; }
  .form-grid > .field[style*="span 2"]{ grid-column: span 1 !important; }
}
@media (min-width: 901px) { .menu-btn{ display: none; } }

/* ================= 主题打磨层 v1.2 ================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d4e4; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b9d0; border: 2px solid transparent; background-clip: content-box; }

.card {
  box-shadow: 0 1px 3px rgba(15, 35, 70, .05), 0 4px 14px rgba(15, 35, 70, .04);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: 0 2px 6px rgba(15, 35, 70, .07), 0 8px 22px rgba(15, 35, 70, .07); }

.stat {
  transition: transform .16s ease, box-shadow .16s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(26,115,232,.12); }

table.data th {
  background: linear-gradient(180deg, #f8fafd, #f3f6fb);
  font-weight: 600; letter-spacing: .2px;
  border-bottom: 2px solid #e4ecf6;
}
table.data td { transition: background .12s; }

.btn, .btn-sm { transition: all .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.tag { font-weight: 600; letter-spacing: .2px; }

.alert { border-radius: 10px; box-shadow: 0 2px 10px rgba(15,35,70,.05); }

.topbar { backdrop-filter: blur(6px); background: rgba(255,255,255,.92); }

.page-title { font-size: 19px; }

.nav-item { border-radius: 8px; margin: 1px 8px 1px 8px; padding-left: 13px; }
.nav-sub a { border-radius: 8px; margin: 0 8px; padding-left: 36px; }
.nav-sub { background: rgba(0,0,0,.14); border-radius: 0 0 10px 10px; margin: 0 8px 2px; }

/* 条款：英文为主、中文对照小字 */
.notes li { margin-bottom: 3px; }
.notes .note-en { color: var(--c-text, #222); }
.notes .note-cn { font-size: 10.5px; color: #667; margin-top: 1px; }

/* ===== 财务 / 订单统一展示规范 ===== */
/* 金额单元格：右对齐 + 等宽数字，保证同列小数点严格对齐；覆盖模板里的内联右对齐 */
table td.num, table th.num,
td[style*="text-align:right"], th[style*="text-align:right"],
td[style*="text-align: right"], th[style*="text-align: right"] {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* 概览数值（KPI / 统计条）同样使用等宽数字，避免跳动 */
.sb-value, .stat-value, .kpi-val, .wb-kpi-val, .wb-bar-val, .wb-order-amt {
  font-variant-numeric: tabular-nums;
}
/* 编号 / 单号：等宽字体 + 等宽数字 */
.mono, .order-no, .doc-no { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
/* 状态标签：统一圆角、行高与字重，避免不同模块观感不一致 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
/* 数字为空统一占位，避免 0 与空值混淆 */
.muted-hint { color: #98a2b3; }

/* Alpine x-cloak：Alpine 初始化前隐藏受控元素，避免编辑行闪现 */
[x-cloak] { display: none !important; }
