/* ============================================================
 * MX Cargo Console - 样式表
 * ========================================================== */
:root {
  --brand:        #0d6e5f;
  --brand-600:    #0a594d;
  --brand-050:    #e8f5f1;
  --accent:       #c8102e;
  --accent-050:   #fdecef;

  --nav:          #0b1727;
  --nav-2:        #12233a;
  --nav-text:     #93a7c0;
  --nav-active:   #ffffff;

  --bg:           #f4f6f9;
  --surface:      #ffffff;
  --line:         #e3e8ef;
  --line-2:       #eef1f5;

  --ink:          #111c2e;
  --ink-2:        #46536a;
  --ink-3:        #7b879cc9;
  --muted:        #8794a8;

  --blue:   #1d63d2; --blue-bg:   #e8f0fd;
  --cyan:   #0d7f95; --cyan-bg:   #e2f5f9;
  --indigo: #4338ca; --indigo-bg: #ebebfd;
  --violet: #6d28d9; --violet-bg: #f1e9fe;
  --purple: #7c3aed; --purple-bg: #f3ebfe;
  --amber:  #b45309; --amber-bg:  #fdf3e3;
  --orange: #c2410c; --orange-bg: #fdeee4;
  --teal:   #0f766e; --teal-bg:   #e4f4f2;
  --green:  #157347; --green-bg:  #e6f4ec;
  --red:    #b91c1c; --red-bg:    #fdeaea;
  --slate:  #475569; --slate-bg:  #eef1f5;
  --gray:   #6b7280; --gray-bg:   #f2f3f5;

  --r:   10px;
  --r-lg: 14px;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12), 0 2px 8px rgba(16,24,40,.06);
  --shadow-nav: 2px 0 16px rgba(11,23,39,.10);
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 图标默认尺寸 ---------------- */
.ic { width: 16px; height: 16px; flex: none; vertical-align: -2px; }
.stat-row .lbl svg { width: 15px; height: 15px; }
.chip svg { width: 13px; height: 13px; }
.kpi-top svg { width: 13px; height: 13px; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--nav); color: var(--nav-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  box-shadow: var(--shadow-nav); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 17px 16px 15px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  object-fit: cover; display: block; background: #0b1727;
  background: linear-gradient(135deg, var(--brand) 0%, #14a37f 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(13,110,95,.45);
}
.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: -.2px; }
.brand-text span { display: block; font-size: 10px; color: #64748b; letter-spacing: .4px; text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group > h4 {
  margin: 0 0 5px; padding: 0 8px; font-size: 10px; font-weight: 700;
  letter-spacing: .9px; text-transform: uppercase; color: #4a5b73;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 1px;
  border-radius: 8px; cursor: pointer; color: var(--nav-text); font-size: 13px;
  border: none; background: none; width: 100%; text-align: left; transition: background .13s, color .13s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #dbe4f0; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(13,110,95,.4); }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .95; }
.nav-item .badge {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 10px;
  padding: 1px 6px; border-radius: 20px; font-weight: 700; min-width: 18px; text-align: center;
}
.nav-item.active .badge { background: rgba(255,255,255,.28); }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #48586e; }

.main { display: flex; flex-direction: column; min-width: 0; }

/* ---------------- 客户端 / 管理端 切换 ---------------- */
.mode-switch { display: flex; margin: 2px 12px 12px; padding: 3px; gap: 3px; border-radius: 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); cursor: pointer; }
.mode-switch span { flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; font-size: 11.5px;
  font-weight: 600; color: var(--nav-text); transition: all .15s; }
.mode-switch span.on { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(13,110,95,.4); }

/* ---------------- Topbar ---------------- */
.topbar {
  height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.page-title small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.topbar-search { position: relative; margin-left: auto; width: 300px; }
.topbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.topbar-search input {
  width: 100%; padding: 7px 10px 7px 32px; border: 1px solid var(--line);
  border-radius: 8px; background: #f8fafc; outline: none;
}
.topbar-search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-050); }

.content { padding: 20px; flex: 1; min-width: 0; }
.content-inner { max-width: 1500px; margin: 0 auto; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: all .13s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(13,110,95,.35); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger:hover { background: #a30d24; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- Cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
/* KPI 行：始终单行，永不换行 */
.g-4, .g-3 { display: flex; flex-wrap: nowrap; gap: 12px; }
.g-4 > *, .g-3 > * { flex: 1 1 0; min-width: 0; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
/* KPI 行永不换行：窄屏只缩间距，不塌列 */
@media (max-width: 1180px) { .g-2-1,.g-1-2 { grid-template-columns: 1fr; }
  .g-4, .g-3 { gap: 9px; } }
@media (max-width: 720px)  { .g-2 { grid-template-columns: 1fr; } .app { grid-template-columns: 64px 1fr; } .brand-text, .nav-group > h4, .nav-item span.label, .sidebar-foot { display: none; } .nav-item { justify-content: center; }
  .g-4, .g-3 { gap: 7px; } .kpi { padding: 9px 10px; } .kpi-val { font-size: 17px; } .kpi-top { font-size: 9.5px; } .kpi-sub { display: none; } }

/* ---------------- KPI ---------------- */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 13px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.kpi::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand); }
.kpi.k-red::after   { background: var(--accent); }
.kpi.k-amber::after { background: #d97706; }
.kpi.k-blue::after  { background: var(--blue); }
.kpi-top { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-top svg { width: 13px; height: 13px; flex: none; opacity: .85; }
.kpi-val { font-size: 21px; font-weight: 750; letter-spacing: -.6px; margin: 5px 0 1px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-val small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.kpi-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { color: var(--green); } .kpi-sub b.down { color: var(--accent); }

/* ---------------- Badges / pills ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-blue{color:var(--blue);background:var(--blue-bg)} .t-cyan{color:var(--cyan);background:var(--cyan-bg)}
.t-indigo{color:var(--indigo);background:var(--indigo-bg)} .t-violet{color:var(--violet);background:var(--violet-bg)}
.t-purple{color:var(--purple);background:var(--purple-bg)} .t-amber{color:var(--amber);background:var(--amber-bg)}
.t-orange{color:var(--orange);background:var(--orange-bg)} .t-teal{color:var(--teal);background:var(--teal-bg)}
.t-green{color:var(--green);background:var(--green-bg)} .t-red{color:var(--red);background:var(--red-bg)}
.t-slate{color:var(--slate);background:var(--slate-bg)} .t-gray{color:var(--gray);background:var(--gray-bg)}
.t-brand{color:var(--brand);background:var(--brand-050)}
.t-accent{color:var(--accent);background:var(--accent-050)}

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.2px; }
.dim { color: var(--muted); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------------- Table ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 9px 12px; background: #fafbfc; border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr { cursor: pointer; transition: background .1s; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tbody tr.no-hover { cursor: default; }
table.tbl tbody tr.no-hover:hover { background: transparent; }
table.tbl tr.row-alert { background: #fffafa; }
table.tbl tr.row-alert:hover { background: #fdeaea; }
table.tbl .cell-main { font-weight: 600; color: var(--ink); }
table.tbl .cell-sub { font-size: 11.5px; color: var(--muted); }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field > label .req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; transition: border .13s, box-shadow .13s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.textarea { min-height: 70px; resize: vertical; }
.input[readonly] { background: #f8fafc; color: var(--ink-2); }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(2, 1fr); }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .span2 { grid-column: span 2; }
.form-grid.c3 .span3 { grid-column: span 3; }
@media (max-width: 860px) { .form-grid, .form-grid.c3 { grid-template-columns: 1fr; } .form-grid .span2, .form-grid.c3 .span3 { grid-column: span 1; } }
.form-section { margin-bottom: 18px; }
.form-section > h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 19px; background: #cbd5e1; border-radius: 20px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(15px); }

/* ---------------- Toolbar / filters ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); background: #fcfdfe; }
.toolbar .input, .toolbar .select { width: auto; min-width: 118px; padding: 6px 9px; font-size: 12.5px; }
.toolbar .grow { flex: 1; min-width: 190px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 4px 11px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  font-size: 12px; cursor: pointer; color: var(--ink-2); transition: all .12s; font-weight: 500;
}
.chip:hover { border-color: #cbd5e1; background: #f8fafc; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip .cnt { opacity: .7; margin-left: 4px; font-size: 11px; }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -28px; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); display: grid; place-items: center; z-index: 1;
}
.tl-dot svg { width: 11px; height: 11px; color: var(--muted); }
.tl-item.done .tl-dot { border-color: var(--brand); background: var(--brand); }
.tl-item.done .tl-dot svg { color: #fff; }
.tl-item.current .tl-dot { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-050); }
.tl-item.current .tl-dot svg { color: var(--brand); }
.tl-item.current .tl-title { color: var(--brand); font-weight: 700; }
.tl-title { font-size: 13px; font-weight: 600; }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-detail { font-size: 12px; color: var(--ink-2); margin-top: 4px; background: #f8fafc; border-left: 2px solid var(--line); padding: 5px 9px; border-radius: 0 6px 6px 0; }

/* ---------------- Progress ---------------- */
.bar { height: 6px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .3s; }
.bar.thin { height: 4px; }
.bar > i.warn { background: #d97706; } .bar > i.bad { background: var(--accent); }

.progress-track { display: flex; align-items: center; gap: 0; margin: 6px 0 2px; }
.pt-step { flex: 1; text-align: center; position: relative; font-size: 10.5px; color: var(--muted); }
.pt-step::before { content: ''; display: block; height: 3px; background: var(--line); margin-bottom: 5px; }
.pt-step:first-child::before { border-radius: 3px 0 0 3px; }
.pt-step:last-child::before { border-radius: 0 3px 3px 0; }
.pt-step.done::before { background: var(--brand); }
.pt-step.done { color: var(--brand); font-weight: 600; }
.pt-step.current::before { background: var(--brand); }

/* ---------------- Split list / detail ---------------- */
.detail-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.detail-head .dh-main { flex: 1; min-width: 240px; }
.detail-head h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.4px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.detail-head .dh-meta { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.detail-head .dh-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; background: #fcfdfe; overflow-x: auto; }
.tab {
  padding: 10px 14px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; transition: all .13s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tab .cnt { font-size: 11px; opacity: .7; margin-left: 4px; }

/* ---------------- Definition lists ---------------- */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 12.5px; }
.dl dt { color: var(--muted); white-space: nowrap; }
.dl dd { margin: 0; font-weight: 550; word-break: break-word; }
.stat-list { display: flex; flex-direction: column; gap: 0; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stat-row:last-child { border-bottom: none; }
.stat-row .lbl { color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.stat-row .val { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------- Doc matrix ---------------- */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: none; }
.doc-row .doc-name { flex: 1; font-size: 12.5px; }
.doc-row .doc-name small { display: block; color: var(--muted); font-size: 10.5px; }
.dot-grid { display: inline-flex; gap: 3px; }
.dot-sq { width: 11px; height: 11px; border-radius: 3px; background: var(--line); }
.dot-sq.ok { background: var(--green); } .dot-sq.part { background: #d97706; } .dot-sq.bad { background: var(--accent); }

/* ---------------- Modal ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .14s ease; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; animation: pop .16s ease; }
.modal.wide { max-width: 1040px; }
.modal.narrow { max-width: 460px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); background: #fcfdfe; border-radius: 0 0 14px 14px; position: sticky; bottom: 0; }
.modal-foot .left { margin-right: auto; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }

/* ---------------- Toast ---------------- */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; animation: slide .2s ease; max-width: 340px;
}
.toast.ok  { background: #0f5132; } .toast.err { background: #7f1d1d; } .toast.warn { background: #78350f; }
.toast svg { width: 16px; height: 16px; flex: none; }
@keyframes slide { from { opacity: 0; transform: translateX(20px) } to { opacity: 1; transform: none } }

/* ---------------- Empty / misc ---------------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; }
.empty h4 { margin: 0 0 4px; font-size: 14px; color: var(--ink-2); }
.empty p { margin: 0; font-size: 12.5px; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .split-2 { grid-template-columns: 1fr; } }

.alert-box { display: flex; gap: 10px; padding: 11px 13px; border-radius: 9px; font-size: 12.5px; line-height: 1.55; }
.alert-box svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-box.warn { background: var(--amber-bg); color: #78350f; border: 1px solid #fbd89b; }
.alert-box.bad  { background: var(--red-bg); color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-box.info { background: var(--blue-bg); color: #1e3a8a; border: 1px solid #bfdbfe; }
.alert-box.ok   { background: var(--green-bg); color: #14532d; border: 1px solid #86efac; }

.kv-inline { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 12.5px; }
.kv-inline > span { color: var(--ink-2); }
.kv-inline b { color: var(--ink); font-weight: 650; }

.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 9px; }
.hr { height: 1px; background: var(--line-2); margin: 14px 0; border: 0; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 128px; height: 128px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center b { font-size: 21px; font-weight: 750; display: block; line-height: 1.1; }
.donut .center span { font-size: 10.5px; color: var(--muted); }

.hbar-list { display: flex; flex-direction: column; gap: 9px; }
.hbar-item { display: grid; grid-template-columns: 108px 1fr 52px; align-items: center; gap: 10px; font-size: 12px; }
.hbar-item .nm { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-item .vv { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

@media print {
  .sidebar, .topbar, .toolbar, .dh-actions, .tabs, .modal-foot { display: none !important; }
  .app { grid-template-columns: 1fr; } .content { padding: 0; } .card { box-shadow: none; border: none; }
}

/* ---------------- 竖柱图（报表中心） ---------------- */
.vchart { display: flex; align-items: flex-end; gap: 10px; padding-top: 4px; }
.vcol { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.vcap { font-size: 10.5px; color: var(--muted); margin-bottom: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vstack { height: 152px; width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse;
          border-radius: 5px 5px 0 0; overflow: hidden; background: #f4f6f9; }
.vstack i { display: block; width: 100%; transition: height .3s; }
.vlab { font-size: 11px; color: var(--muted); margin-top: 7px; white-space: nowrap; }
@media (max-width: 720px) { .vstack { height: 110px; } .vcap { display: none; } }

/* ---------------- 步骤流程（在线下单） ---------------- */
.step-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.step-no { width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--muted);
           display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step-head.active .step-no { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-050); }
.step-head.done .step-no   { background: var(--green); color: #fff; }
.step-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.step-head .st { margin-left: auto; font-size: 11.5px; font-weight: 600; }
.step-head.active .st { color: var(--brand); }
.step-head.done .st   { color: var(--green); }
.step-head.wait .st   { color: var(--muted); }
.step-body { padding: 16px; }

/* ---------------- 登录页 ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background: #eef1f5 linear-gradient(140deg, #eef1f5 0%, #e3ebf2 55%, #dfe9e5 100%); }
.login-box { width: 100%; max-width: 392px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 26px 26px 22px; box-shadow: 0 18px 48px rgba(16,24,40,.13); }
.acct { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; cursor: pointer;
  font-size: 12.5px; transition: all .13s; }
.acct:hover { background: var(--brand-050); border-color: #b7ddd4; }
.acct b { font-family: var(--mono); font-size: 12px; color: var(--ink); min-width: 74px; }
.acct span { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--brand); font-weight: 600; }

/* ---------------- 同步状态标识 ---------------- */
.sync-badge {
  display: block; padding: 7px 12px 0; font-size: 10.5px; font-weight: 600; letter-spacing: .2px; cursor: help;
}
.sync-badge.online { color: #4ade80; }
.sync-badge.local  { color: #fbbf24; }
.login-wrap .sync-badge { display: none; }

/* ---------------- 分段控件（打印中心 / 扫码作业） ---------------- */
.seg { display:inline-flex; align-items:center; gap:6px; padding:7px 13px; border:1px solid var(--line); background:var(--surface); border-radius:9px; cursor:pointer; color:var(--ink-2); font-weight:600; font-size:12.5px; }
.seg svg { width:15px; height:15px; }
.seg:hover { background:var(--line-2); }
.seg.active { background:var(--brand); border-color:var(--brand); color:#fff; }
.seg.active svg { color:#fff; }
.seg-wrap { display:flex; flex-wrap:wrap; gap:6px; }

/* ---------------- 扫码作业 ---------------- */
.pda-scan { display:flex; align-items:center; gap:10px; padding:12px 14px; background:var(--brand-050); border:1px dashed var(--brand); border-radius:var(--r); margin-bottom:16px; }
.pda-scan-label { display:flex; align-items:center; gap:6px; font-weight:700; color:var(--brand); white-space:nowrap; }
.pda-scan-label svg { width:18px; height:18px; }
.pda-scan .input { flex:1; font-size:16px; padding:11px 12px; font-family:var(--mono); }
.sku-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); margin-bottom:10px; }
.sku-name { font-size:15px; font-weight:700; }
.chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }


/* ---------------- 登录页（分屏：左品牌 / 右表单） ---------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-brand { background: radial-gradient(1200px 600px at 18% -8%, #175e67 0%, #0b1727 46%, #081c18 100%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; position: relative; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; right: -160px; bottom: -160px; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(circle, rgba(20,163,127,.20), transparent 65%); }
.login-brand-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,.18); padding-bottom: 20px; position: relative; z-index: 2; }
.login-brand-logo { display: flex; align-items: center; gap: 15px; }
.login-brand-logo b { font-size: 19px; font-weight: 600; letter-spacing: .02em; }
.login-brand-logo img { width: 62px; height: 62px; border-radius: 12px; flex: none; }
.login-brand-name b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.login-brand-name small { display: block; font-size: 9.5px; letter-spacing: .26em; color: rgba(255,255,255,.62); margin-top: 4px; }
.login-brand-idx { font-size: 10px; letter-spacing: .24em; color: rgba(255,255,255,.55); }
.login-brand-mid { margin: auto 0; padding: 48px 0; position: relative; z-index: 2; }
.login-brand-tag { font-size: 11px; letter-spacing: .3em; color: rgba(255,255,255,.68); }
.login-brand-mid h1 { font-size: clamp(1.7rem, 3vw, 2.7rem); font-weight: 300; letter-spacing: -.02em; margin-top: 22px; }
.login-brand-line { width: 96px; height: 1px; background: rgba(255,255,255,.5); margin: 30px 0; }
.login-brand-mid p { white-space: nowrap; font-size: 13.5px; color: rgba(255,255,255,.8); }
.login-brand-foot { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.18); padding-top: 20px; font-size: 10px; letter-spacing: .2em; color: rgba(255,255,255,.55); position: relative; z-index: 2; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.login-card { width: 100%; max-width: 400px; }
.login-form-tag { display: flex; align-items: center; gap: 8px; color: var(--brand); font-size: 10px; letter-spacing: .28em; font-weight: 600; }
.login-form-tag .ic { width: 15px; height: 15px; }
.login-card h2 { font-size: 24px; font-weight: 300; letter-spacing: -.02em; color: var(--ink); margin: 22px 0 0; }
.login-sub { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.login-error { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; padding: 10px 12px; border-radius: 9px; background: var(--red-bg); color: var(--red); font-size: 12.5px; }
.login-fields { margin-top: 28px; display: grid; gap: 18px; }
.login-fields label > span { display: block; font-size: 10.5px; letter-spacing: .16em; color: var(--brand); margin-bottom: 8px; font-weight: 600; }
.login-field { height: 46px; font-size: 14px; }
.login-remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.login-remember input { accent-color: var(--brand); }
.login-submit { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 2px; }
.login-demo { margin-top: 26px; border-top: 1px solid var(--line-2); padding-top: 18px; }
.login-demo-title { font-size: 11px; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.login-demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.login-note { margin-top: 16px; font-size: 10.5px; color: var(--muted); }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-brand { display: none; } }
