/* ===== 舞钢钢板发货系统 · 视觉基础 ===== */
:root {
  --brand: #3b75bc;
  --brand-dark: #2c5a94;
  --brand-deep: #1d3f68;
  --ink: #17222f;
  --ink-2: #46566a;
  --ink-3: #7b8b9d;
  --line: #dfe6ef;
  --line-2: #edf1f6;
  --bg: #f3f6fa;
  --card: #ffffff;
  --ok: #1f8a5b;
  --ok-bg: #e6f5ee;
  --warn: #b9770f;
  --warn-bg: #fdf3e2;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --info: #2f6fb0;
  --info-bg: #eaf2fb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(23, 34, 47, .05), 0 8px 24px -14px rgba(23, 34, 47, .25);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .01em; }

/* ===== 壳层 ===== */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 232px; flex: 0 0 232px;
  background: linear-gradient(180deg, #16283c 0%, #132233 60%, #101d2c 100%);
  color: #c9d6e4;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.side::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 180px;
  background: radial-gradient(120% 80% at 20% 100%, rgba(59, 117, 188, .28), transparent 70%);
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: relative; z-index: 1;
}
.brand svg { width: 34px; height: 34px; flex: 0 0 34px; }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .04em; }
.brand span { display: block; font-size: 10px; color: #7f95ad; letter-spacing: .18em; margin-top: 2px; }

.nav { padding: 12px 10px 24px; position: relative; z-index: 1; flex: 1; overflow-y: auto; }
.nav-group { margin: 18px 0 8px; padding: 0 10px; font-size: 16px; font-weight: 700; color: #b1c6da; letter-spacing: .08em; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; margin: 2px 0;
  border-radius: 7px; color: #c2d0de; font-size: 13.5px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a svg { width: 18px; height: 18px; opacity: .75; transition: opacity .18s ease, transform .18s ease; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.nav a:hover svg { opacity: 1; transform: scale(1.06); }
.nav a.active {
  background: linear-gradient(90deg, rgba(59, 117, 188, .34), rgba(59, 117, 188, .12));
  color: #fff; box-shadow: inset 2px 0 0 #6ea6e6;
}
.nav a.active svg { opacity: 1; }
.nav a .dot { margin-left: auto; background: #d98324; color: #fff; font-size: 10px; border-radius: 8px; padding: 0 6px; line-height: 16px; }

.side-foot {
  padding: 12px 16px 16px; font-size: 11px; color: #6f879f;
  border-top: 1px solid rgba(255, 255, 255, .07); position: relative; z-index: 1;
}

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

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; height: 60px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; letter-spacing: .02em; }
.topbar .crumb { color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }

.usermenu { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 22px; transition: background .18s; }
.usermenu:hover { background: var(--line-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, #3b75bc, #22456f);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.usermenu .who b { display: block; font-size: 13px; line-height: 1.2; }
.usermenu .who span { display: block; font-size: 11px; color: var(--ink-3); line-height: 1.4; }

.content { padding: 22px; max-width: 1500px; width: 100%; }

/* ===== 通用块 ===== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h2 { font-size: 15px; }
.card-head .sub { color: var(--ink-3); font-size: 12px; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.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-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59, 117, 188, .10), transparent 70%);
}
.kpi .label { color: var(--ink-3); font-size: 12px; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.kpi .ico { position: absolute; right: 16px; bottom: 14px; opacity: .08; }
.kpi .ico svg { width: 46px; height: 46px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px;
  background: #f7f9fc; border-bottom: 1px solid var(--line);
  padding: 10px 12px; white-space: nowrap; letter-spacing: .02em;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr { transition: background .15s; }
table.tbl tbody tr:hover { background: #f8fbff; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .muted { color: var(--ink-3); }
table.tbl .strong { font-weight: 600; }
table.tbl .no { font-family: var(--mono); font-size: 13.5px; font-weight: 600; letter-spacing: .02em; }
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; opacity: .35; margin-bottom: 8px; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.st-wait { background: var(--warn-bg); color: var(--warn); }
.st-ok { background: var(--info-bg); color: var(--info); }
.st-bad { background: var(--bad-bg); color: var(--bad); }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-gray { background: #eff2f6; color: var(--ink-3); }
.tag { background: #f0f4f9; color: var(--ink-2); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  cursor: pointer; font-size: 13px; white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s;
}
.btn:hover { background: #f6f9fc; border-color: #c8d5e4; color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -6px rgba(59, 117, 188, .8); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn-danger { background: #fff; border-color: #e8c4bf; color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: #dda9a2; color: var(--bad); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #187149; color: #fff; border-color: #187149; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-logout {
  height: 40px; padding: 0 18px; font-size: 14px; font-weight: 600; letter-spacing: .04em;
  gap: 7px; border: 1.5px solid var(--brand); color: var(--brand-dark);
  background: #fff; border-radius: 9px;
  box-shadow: 0 4px 12px -8px rgba(59, 117, 188, .8);
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover {
  background: var(--brand); border-color: var(--brand); color: #fff;
  transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(59, 117, 188, 1);
}
@media (max-width: 640px) { .btn-logout { height: 36px; padding: 0 12px; font-size: 13px; } .btn-logout svg { width: 16px; height: 16px; } }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field label .req { color: var(--bad); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 6px 11px;
  border: 1px solid #d5dfea; border-radius: var(--radius-sm); background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 117, 188, .14);
}
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.err { font-size: 12px; color: var(--bad); margin-top: 5px; }
.row { display: flex; gap: 12px; }
.row > * { min-width: 0; }
.flex1 { flex: 1; }

/* 提示条 */
.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { display: flex; gap: 8px; align-items: flex-start; padding: 10px 13px; border-radius: 8px; font-size: 13px; border: 1px solid; }
.flash svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.flash.ok { background: var(--ok-bg); border-color: #c3e3d3; color: #176b47; }
.flash.err { background: var(--bad-bg); border-color: #f2c9c4; color: #a3352a; }
.flash.warn { background: var(--warn-bg); border-color: #efdcb9; color: #8c5c0c; }
.flash.info { background: var(--info-bg); border-color: #c9ddf4; color: #245a91; }

/* 分段筛选 */
.seg { display: inline-flex; background: #eef2f7; padding: 3px; border-radius: 8px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2); transition: background .16s, color .16s; }
.seg a.on { background: #fff; color: var(--brand-deep); box-shadow: 0 1px 3px rgba(23, 34, 47, .12); font-weight: 600; }
.seg a:hover { color: var(--brand); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.toolbar .spacer { flex: 1; }

/* 页脚 */
.foot { padding: 18px 22px 26px; color: var(--ink-3); font-size: 11.5px; display: flex; gap: 10px; align-items: center; }
.foot .spacer { flex: 1; }

.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 18px; }
.pager a, .pager span { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; color: var(--ink-2); background: #fff; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager span.cur { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 图片/签名 */
.sign-pad { border: 1px dashed #c3d2e3; border-radius: 8px; background: #fff; touch-action: none; width: 100%; }

/* 打印（HTML 预览） */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .24s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side.open { transform: none; }
  .side-mask { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .24s; }
  .side-mask.on { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
  .topbar { padding: 0 14px; height: 56px; }
  .topbar h1 { font-size: 15px; }
  .content { padding: 14px; }
  .usermenu .who { display: none; }
}

/* 顶栏「更改公司基本资料」提示：指向账号页 */
.top-hint {
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: 10px; padding: 5px 10px; border-radius: 6px;
  color: var(--ink-3); font-size: 12px; white-space: nowrap;
  transition: color .18s, background .18s;
}
.top-hint .ar { font-size: 13px; transition: transform .18s; }
.top-hint:hover { color: var(--brand); background: rgba(59,117,188,.08); }
.top-hint:hover .ar { transform: translateX(3px); }
@media (max-width: 720px) { .top-hint { display: none; } }
