/* ============================================================
   通信器材仓库管理系统 · 全局样式
   ============================================================ */
:root {
  --bg: #f3f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #102331;
  --ink-soft: #334b5c;
  --muted: #6b8090;
  --line: #e1eaf0;
  --line-strong: #cbd9e3;
  --brand: #0f766e;
  --brand-dark: #0b5d57;
  --brand-light: #d9f4ef;
  --brand-wash: #eefaf7;
  --accent: #f59e0b;
  --accent-wash: #fff7e6;
  --navy: #0b1b2b;
  --navy-soft: #13293d;
  --danger: #d92d20;
  --danger-wash: #fff0ef;
  --ok: #07875f;
  --ok-wash: #e8f8f2;
  --info: #2563eb;
  --info-wash: #eef4ff;
  --purple: #7c3aed;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 35, 49, .04), 0 8px 24px rgba(16, 35, 49, .045);
  --shadow-lg: 0 18px 50px rgba(9, 30, 45, .16);
  --sidebar-w: 238px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { vertical-align: middle; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #b9ece2; color: #083c38; }

/* ---------- 布局 ---------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background:
    radial-gradient(800px 300px at 0% -10%, rgba(20, 184, 166, .17), transparent 60%),
    radial-gradient(500px 260px at 110% 105%, rgba(245, 158, 11, .10), transparent 55%),
    var(--navy);
  color: #d6e2eb;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 2px 10px 22px;
  color: #fff;
}
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #14b8a6, #0d9488 55%, #0f766e);
  box-shadow: 0 8px 22px rgba(13, 148, 136, .34), inset 0 1px 0 rgba(255,255,255,.28);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid rgba(255,255,255,.18);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text strong { display: block; font-size: 16px; letter-spacing: .4px; font-weight: 700; }
.brand-text span { display: block; font-size: 10.5px; color: #8fa9bb; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 1px; }
.nav-label {
  color: #6f8ba0; font-size: 10.5px; letter-spacing: 1.5px;
  padding: 15px 14px 7px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; padding: 9px 12px;
  border-radius: 10px; color: #a9bfce; font-size: 13.5px;
  margin-bottom: 2px; position: relative;
  transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(255,255,255,.065); color: #eef6fa; }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(20, 184, 166, .24), rgba(20, 184, 166, .07));
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .17);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 4px 4px 0; background: #2dd4bf;
}
.nav-item .icon { width: 18px; height: 18px; opacity: .92; }
.nav-item .nav-badge {
  margin-left: auto; background: rgba(245, 158, 11, .18); color: #fbbf24;
  font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 600;
}
.sidebar-footer { margin-top: auto; padding-top: 14px; }
.lan-status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; background: rgba(255,255,255,.035);
  font-size: 11.5px; color: #93adbd;
}
.lan-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.13); flex: 0 0 7px; }
.lan-status strong { display: block; color: #cfe0ea; font-size: 11.5px; font-weight: 500; }
.lan-status span { display: block; color: #7693a6; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-version { padding: 10px 12px 0; color: #587386; font-size: 10px; display: flex; justify-content: space-between; }

.main-area {
  width: calc(100% - var(--sidebar-w));
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  height: 70px; flex: 0 0 70px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.page-heading h1 { font-size: 18px; line-height: 1.2; letter-spacing: -.2px; font-weight: 700; }
.page-heading p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.global-search {
  position: relative; width: 238px;
}
.global-search input {
  width: 100%; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: #f7fafb;
  padding: 0 12px 0 35px; font-size: 12.5px; outline: none;
  transition: border .18s, background .18s, box-shadow .18s;
}
.global-search input:focus { border-color: #80cbc4; background: #fff; box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.global-search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: #8ca0af; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; color: var(--ink-soft);
  transition: .18s; position: relative;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--brand); }
.icon-btn .icon { width: 18px; height: 18px; }
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid transparent; background: transparent;
  border-radius: 10px; padding: 4px 6px 4px 4px; transition: .18s;
}
.user-trigger:hover { background: var(--surface-soft); border-color: var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: linear-gradient(145deg, #d9f4ef, #b5e8df);
  color: #0b5d57; border: 1px solid #a9e0d7;
}
.user-trigger .u-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: left; }
.user-trigger .u-role { font-size: 10.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 50;
  width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: .16s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a, .dropdown button {
  display: flex; width: 100%; align-items: center; gap: 9px;
  padding: 9px 10px; border: 0; background: none; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-soft); text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-soft); color: var(--ink); }
.dropdown .danger { color: var(--danger); }
.dropdown .icon { width: 16px; height: 16px; }
.dropdown-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-toggle { display: none; }

.content { padding: 24px 28px 40px; width: 100%; max-width: 1680px; margin: 0 auto; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.dashboard-grid > *, .report-grid > *, .order-layout > *, .settings-layout > *, .kpi-grid > *, .report-kpis > * { min-width: 0; }
.card-head {
  padding: 17px 20px 13px; display: flex; align-items: center; gap: 12px;
}
.card-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head .head-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 0 20px 20px; }
.card-body.flush { padding: 0; }
.card-link { color: var(--brand); font-size: 12px; display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.card-link:hover { color: var(--brand-dark); }
.icon { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: .18s; text-decoration: none;
}
.btn:hover { border-color: var(--line-strong); background: #f8fafb; color: var(--ink); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #0f8a80, #0f766e);
  box-shadow: 0 4px 12px rgba(15,118,110,.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #0d9488, #0b5d57); color: #fff; border-color: transparent; }
.btn-accent { background: linear-gradient(135deg, #f59e0b, #ea8a06); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(245,158,11,.18); }
.btn-accent:hover { background: #e88906; color: #fff; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b42318; border-color: #b42318; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before {
  content: ""; width: 13px; height: 13px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 22px; padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge-green { background: var(--ok-wash); color: #067a55; }
.badge-teal { background: var(--brand-wash); color: var(--brand); }
.badge-amber { background: var(--accent-wash); color: #b45309; }
.badge-red { background: var(--danger-wash); color: #b42318; }
.badge-blue { background: var(--info-wash); color: #1d4ed8; }
.badge-gray { background: #f1f5f8; color: #5d7282; }
.badge-purple { background: #f3efff; color: #6d28d9; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 40px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: #fff; padding: 0 11px; outline: none;
  font-size: 13px; transition: .18s; color: var(--ink);
}
.input::placeholder, .textarea::placeholder { color: #a3b3bf; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #56b4ab; box-shadow: 0 0 0 3px rgba(15,118,110,.09);
}
.input:disabled, .select:disabled { background: #f4f7f9; color: #728898; cursor: not-allowed; }
.textarea { height: auto; min-height: 82px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2374899a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
.input-group { position: relative; }
.input-group .input { padding-left: 34px; }
.input-group .icon { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; color: #8297a6; }
.input-suffix { position: absolute; right: 10px; top: 10px; color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 20px; background: #cbd8e2; transition: .18s; flex: 0 0 36px; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
input:checked + .switch { background: var(--brand); }
input:checked + .switch::after { left: 18px; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }

.filter-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
}
.filter-bar .search-box { position: relative; flex: 1 1 260px; max-width: 360px; }
.filter-bar .search-box input { height: 38px; padding-left: 34px; }
.filter-bar .search-box svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: #8195a4; }
.filter-bar .select { width: auto; min-width: 128px; height: 38px; }
.filter-bar .spacer { flex: 1; }
.filter-bar .date-range { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.filter-bar .date-range .input { width: 138px; height: 38px; }

.table-wrap { overflow-x: auto; max-width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: #7890a0; background: #f8fbfc;
  border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #edf2f5; vertical-align: middle; }
.table tbody tr:hover { background: #f9fcfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table .muted { color: var(--muted); font-size: 11.5px; }
.table tbody tr.row-inactive { opacity: .56; background: #fbfcfd; }
.table tbody tr.row-inactive:hover { opacity: .8; }
.table .actions { text-align: right; white-space: nowrap; }
.table .row-actions { display: inline-flex; gap: 3px; justify-content: flex-end; }
.table-card .card-head { border-bottom: 1px solid transparent; }
.table-card .table-wrap { border-top: 1px solid var(--line); }
.table th .check, .table td .check { gap: 0; }
.table .product-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.product-thumb {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 34px;
  background: linear-gradient(145deg, #edf9f7, #dff3ef); color: var(--brand);
  display: grid; place-items: center; border: 1px solid #d3ebe6;
}
.product-thumb .icon { width: 18px; height: 18px; }
.product-cell strong { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink); }
.product-cell span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.stock-cell { min-width: 92px; }
.stock-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-num.low { color: var(--danger); }
.stock-bar { width: 72px; height: 4px; background: #edf1f4; border-radius: 4px; margin-top: 5px; overflow: hidden; }
.stock-bar span { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.stock-bar span.low { background: var(--danger); }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 11.5px; letter-spacing: -.1px; white-space: nowrap; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pagination { display: flex; align-items: center; gap: 5px; padding: 13px 16px; border-top: 1px solid var(--line); }
.pagination .info { margin-right: auto; color: var(--muted); font-size: 11.5px; }
.page-btn {
  min-width: 31px; height: 31px; padding: 0 8px; border: 1px solid var(--line);
  background: #fff; border-radius: 7px; display: inline-grid; place-items: center;
  font-size: 12px; color: var(--ink-soft);
}
.page-btn:hover { border-color: #9bcfc7; color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty-state { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty-illustration {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 18px;
  background: var(--brand-wash); color: var(--brand); display: grid; place-items: center;
}
.empty-illustration .icon { width: 31px; height: 31px; }
.empty-state h4 { font-size: 14px; color: var(--ink-soft); margin-bottom: 4px; }
.empty-state p { font-size: 12px; max-width: 340px; margin: 0 auto 15px; line-height: 1.7; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 10px; padding: 11px 14px; font-size: 12.5px;
  border: 1px solid transparent; line-height: 1.6;
}
.alert .icon { width: 17px; height: 17px; margin-top: 1px; }
.alert-warn { background: #fffaeb; border-color: #fde9b0; color: #8a5a08; }
.alert-danger { background: var(--danger-wash); border-color: #ffd4d0; color: #9c1c13; }
.alert-info { background: var(--info-wash); border-color: #d5e3ff; color: #1e4fae; }
.alert-success { background: var(--ok-wash); border-color: #c4eddf; color: #066b4b; }
.content > .alert { margin-bottom: 16px; }

/* ---------- 看板 ---------- */
.welcome-strip {
  display: flex; align-items: center; gap: 18px; margin-bottom: 18px;
  padding: 2px 2px 0;
}
.welcome-strip h2 { font-size: 21px; letter-spacing: -.4px; }
.welcome-strip p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.welcome-strip .page-actions { margin-left: auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 17px 18px; position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(16,35,49,.07); }
.kpi::after {
  content: ""; position: absolute; width: 86px; height: 86px; border-radius: 50%;
  right: -38px; top: -42px; background: var(--brand-wash); opacity: .8;
}
.kpi-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-wash); color: var(--brand); margin-right: 1px;
}
.kpi-icon .icon { width: 16px; height: 16px; }
.kpi.amber .kpi-icon { background: var(--accent-wash); color: #c67805; }
.kpi.blue .kpi-icon { background: var(--info-wash); color: var(--info); }
.kpi.purple .kpi-icon { background: #f4efff; color: var(--purple); }
.kpi-value {
  font-size: 27px; font-weight: 700; letter-spacing: -1px;
  margin-top: 13px; line-height: 1.1; font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-foot { margin-top: 9px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; position: relative; z-index: 1; }
.kpi-foot strong { color: var(--ink-soft); font-weight: 600; }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-box { padding: 4px 20px 18px; }
.chart-legend { display: flex; gap: 15px; align-items: center; font-size: 11px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.chart {
  height: 190px; display: flex; align-items: flex-end; gap: 12px;
  padding-top: 18px; border-bottom: 1px solid var(--line); position: relative;
}
.chart::before, .chart::after {
  content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed #eef3f6; pointer-events: none;
}
.chart::before { top: 33%; }
.chart::after { top: 66%; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; z-index: 1; gap: 0; }
.chart-bars { width: 100%; height: 155px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart-bar { width: 13px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.chart-bar.in { background: #5eead4; }
.chart-bar.out { background: #0f766e; }
.chart-label { font-size: 9.5px; color: var(--muted); margin-top: 8px; white-space: nowrap; }
.chart-label b { display: block; font-size: 8.5px; font-weight: 400; color: #a0b0bc; }

.low-list { display: flex; flex-direction: column; }
.low-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef3f6; }
.low-item:last-child { border-bottom: 0; }
.low-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--danger-wash); color: var(--danger); display: grid; place-items: center; flex: 0 0 30px; }
.low-icon .icon { width: 15px; height: 15px; }
.low-main { min-width: 0; flex: 1; }
.low-main strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.low-main span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.low-num { text-align: right; font-size: 12px; font-weight: 700; color: var(--danger); white-space: nowrap; }
.low-num span { display: block; font-size: 9.5px; color: var(--muted); font-weight: 400; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-action {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd;
  font-size: 12px; color: var(--ink-soft); transition: .18s;
}
.quick-action:hover { border-color: #abd8d1; background: var(--brand-wash); color: var(--brand-dark); }
.quick-action .qa-icon { width: 28px; height: 28px; border-radius: 7px; background: #fff; display: grid; place-items: center; color: var(--brand); border: 1px solid var(--line); }
.quick-action .icon { width: 15px; height: 15px; }
.quick-action strong { display: block; font-size: 11.5px; font-weight: 600; }
.quick-action small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }

/* ---------- 商品页 ---------- */
.page-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.page-toolbar .page-actions { margin-left: auto; }
.mini-stats { display: flex; gap: 18px; align-items: center; margin-left: 4px; }
.mini-stat { font-size: 11px; color: var(--muted); }
.mini-stat strong { display: block; font-size: 15px; color: var(--ink); font-weight: 700; letter-spacing: -.3px; }
.table-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ---------- 开单 ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 16px; align-items: start; }
.order-main { display: flex; flex-direction: column; gap: 14px; }
.order-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.scan-box {
  background: linear-gradient(135deg, #0b2f36, #0f4f4b);
  border-radius: var(--radius); padding: 18px 20px; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 28px rgba(9, 70, 65, .17);
}
.scan-box::after {
  content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%;
  right: -90px; top: -130px; border: 45px solid rgba(94, 234, 212, .08);
}
.scan-box h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.scan-box p { color: #9fc4c3; font-size: 11.5px; margin-top: 3px; }
.scan-input-wrap { display: flex; gap: 8px; margin-top: 13px; position: relative; z-index: 1; }
.scan-input-wrap .input {
  height: 43px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.11); color: #fff; border-radius: 9px;
}
.scan-input-wrap .input::placeholder { color: #8db6b4; }
.scan-input-wrap .input:focus { background: rgba(255,255,255,.16); border-color: #5eead4; box-shadow: 0 0 0 3px rgba(94,234,212,.12); }
.scan-input-wrap .btn { background: #fff; color: #0b5d57; border: 0; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 7px); z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow-lg); max-height: 360px; overflow: auto; padding: 5px;
  color: var(--ink);
}
.search-result {
  width: 100%; border: 0; background: none; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 7px;
}
.search-result:hover { background: var(--brand-wash); }
.search-result .sr-main { flex: 1; min-width: 0; }
.search-result strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.search-result .sr-price { font-size: 12px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.search-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.items-table th { text-align: left; font-size: 10px; color: var(--muted); font-weight: 600; padding: 9px 10px; background: #f8fbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.items-table td { padding: 8px 10px; border-bottom: 1px solid #edf2f5; vertical-align: middle; }
.items-table tbody tr:last-child td { border-bottom: 0; }
.items-table .item-name { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.items-table .item-name strong { display: block; font-size: 12px; font-weight: 600; }
.items-table .item-name span { display: block; font-size: 10px; color: var(--muted); }
.items-table .input { height: 32px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.items-table .qty-input { width: 76px; text-align: right; }
.items-table .price-input { width: 96px; text-align: right; }
.items-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.remove-line { width: 27px; height: 27px; border: 0; border-radius: 6px; background: transparent; color: #9caeba; display: inline-grid; place-items: center; }
.remove-line:hover { background: var(--danger-wash); color: var(--danger); }
.remove-line .icon { width: 15px; height: 15px; }
.line-warn { color: var(--danger); font-size: 9.5px; display: block; margin-top: 2px; }
.line-ok { color: var(--ok); font-size: 9.5px; display: block; margin-top: 2px; }
.order-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.order-summary-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.order-summary-head h3 { font-size: 14px; }
.order-summary-body { padding: 15px 18px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); padding: 5px 0; }
.summary-line strong { color: var(--ink-soft); font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px dashed var(--line); margin-top: 9px; padding-top: 12px; }
.summary-total span { font-size: 12px; color: var(--muted); }
.summary-total strong { font-size: 25px; letter-spacing: -.7px; color: var(--brand-dark); line-height: 1; }
.summary-total strong small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.order-form-fields { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.order-side .card-body { padding: 15px 18px 18px; }
.order-side .card-head { padding: 15px 18px 0; }
.order-side .btn-lg { width: 100%; margin-top: 14px; }
.info-note { background: #f8fafb; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ---------- 单据详情 / 打印 ---------- */
.detail-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.detail-toolbar .page-actions { margin-left: auto; }
.paper {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 38px; max-width: 980px; margin: 0 auto;
  position: relative;
}
.paper-head { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid #173248; }
.paper-brand { display: flex; align-items: center; gap: 12px; }
.paper-brand .brand-mark { width: 47px; height: 47px; flex-basis: 47px; }
.paper-title { margin-left: auto; text-align: right; }
.paper-title h2 { font-size: 25px; letter-spacing: 5px; color: #173248; }
.paper-title span { display: block; margin-top: 5px; font-size: 10.5px; letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; }
.paper-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 34px; padding: 17px 0; font-size: 12px; }
.paper-meta div { display: flex; gap: 9px; padding: 3px 0; }
.paper-meta dt { color: var(--muted); min-width: 64px; }
.paper-meta dd { margin: 0; color: var(--ink); font-weight: 500; }
.paper .table { font-size: 12px; }
.paper .table th { background: #f4f7f9; color: #536b7c; }
.paper .table td { padding: 10px 12px; }
.paper-total { display: flex; justify-content: flex-end; padding-top: 16px; }
.paper-total-box { width: 290px; }
.paper-total-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; color: var(--muted); }
.paper-total-line.grand { border-top: 2px solid #173248; margin-top: 7px; padding-top: 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.paper-total-line.grand strong { font-size: 21px; color: #173248; letter-spacing: -.5px; }
.paper-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 26px; align-items: flex-end; }
.paper-footer .note { flex: 1; font-size: 10.5px; color: var(--muted); line-height: 1.7; }
.signature { display: flex; gap: 26px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.signature span { display: inline-block; min-width: 104px; border-bottom: 1px solid var(--line-strong); padding-bottom: 3px; }
.void-banner {
  margin: 0 0 20px; border: 1px solid #f3b7b2; background: var(--danger-wash); color: #a01b13;
  border-radius: 9px; padding: 11px 15px; display: flex; gap: 9px; align-items: center; font-size: 12.5px;
}
.void-banner strong { letter-spacing: 2px; }
.timeline { padding: 4px 0; }
.timeline-item { position: relative; padding: 0 0 16px 20px; border-left: 1px solid var(--line); margin-left: 4px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid #8fb8b2; left: -5px; top: 3px; }
.timeline-item strong { display: block; font-size: 11.5px; }
.timeline-item span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }

/* ---------- 往来单位 ---------- */
.partner-tabs { display: flex; gap: 4px; padding: 4px; background: #edf3f6; border-radius: 9px; }
.partner-tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.partner-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(16,35,49,.08); font-weight: 600; }

/* ---------- 报表 ---------- */
.report-header {
  background: linear-gradient(135deg, #0b2e38, #114c4c);
  border-radius: var(--radius); color: #fff; padding: 21px 24px;
  display: flex; align-items: center; gap: 20px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.report-header::after { content: ""; position: absolute; width: 300px; height: 300px; right: -120px; top: -190px; border: 55px solid rgba(94,234,212,.08); border-radius: 50%; }
.report-header h2 { font-size: 19px; letter-spacing: -.2px; }
.report-header p { color: #a4c4c2; font-size: 11.5px; margin-top: 3px; }
.report-header .page-actions { margin-left: auto; position: relative; z-index: 1; }
.report-header .input, .report-header .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.report-header .input::placeholder { color: #a4c4c2; }
.report-header .btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.report-header .btn-primary { background: #fff; color: #0b5d57; border: 0; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.report-kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; }
.report-kpi span { font-size: 11px; color: var(--muted); }
.report-kpi strong { display: block; font-size: 23px; letter-spacing: -.6px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.report-kpi small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.chart-tall { height: 230px; }
.chart-tall .chart-bars { height: 190px; }
.chart-tall .chart-bar { width: 9px; }
.report-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; margin-bottom: 16px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef3f6; }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: #f1f5f8; color: #748899; }
.rank-item:nth-child(1) .rank-no { background: #fff4d6; color: #b77900; }
.rank-item:nth-child(2) .rank-no { background: #eef1f4; color: #5d6e7a; }
.rank-item:nth-child(3) .rank-no { background: #f9eee4; color: #a9612a; }
.rank-main { flex: 1; min-width: 0; }
.rank-main strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-main span { font-size: 10px; color: var(--muted); }
.rank-value { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 设置页 ---------- */
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; position: sticky; top: 88px; }
.settings-nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none;
  text-align: left; padding: 10px 11px; border-radius: 8px; color: var(--ink-soft);
  font-size: 12.5px; margin-bottom: 2px;
}
.settings-nav button .icon { width: 16px; height: 16px; color: #8297a6; }
.settings-nav button:hover { background: var(--surface-soft); }
.settings-nav button.active { background: var(--brand-wash); color: var(--brand-dark); font-weight: 600; }
.settings-nav button.active .icon { color: var(--brand); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-section { padding: 20px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-section h3 { font-size: 13px; margin-bottom: 3px; }
.settings-section > p { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.info-item { background: #f8fafb; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; }
.info-item span { display: block; font-size: 10.5px; color: var(--muted); }
.info-item strong { display: block; font-size: 12.5px; margin-top: 3px; word-break: break-all; }
.info-item .mono { font-size: 11px; }
.lan-url-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lan-url {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px dashed #c7ded9; background: var(--brand-wash); border-radius: 7px;
  color: var(--brand-dark); font-size: 12px;
}
.lan-url code { flex: 1; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }
.backup-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.backup-list { display: flex; flex-direction: column; margin-top: 10px; }
.backup-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef3f6; font-size: 11.5px; }
.backup-item:last-child { border-bottom: 0; }
.backup-item .icon { color: var(--muted); width: 15px; height: 15px; }
.backup-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-item em { font-style: normal; color: var(--muted); font-size: 10.5px; }

/* ---------- 弹窗 / 提示 ---------- */
dialog.modal {
  border: 0; border-radius: 16px; padding: 0; width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 50px); box-shadow: var(--shadow-lg); background: #fff;
  color: var(--ink);
}
dialog.modal.modal-sm { width: min(460px, calc(100vw - 28px)); }
dialog.modal.modal-lg { width: min(940px, calc(100vw - 28px)); }
dialog.modal::backdrop { background: rgba(7, 24, 36, .46); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-close { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f4f7f9; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: #eaf0f4; color: var(--ink); }
.modal-body { padding: 19px 22px; overflow-y: auto; max-height: calc(100vh - 210px); }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 13px 22px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }
.modal-section-title { font-size: 11px; font-weight: 700; letter-spacing: .8px; color: #8297a6; text-transform: uppercase; margin: 18px 0 11px; display: flex; align-items: center; gap: 8px; }
.modal-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.modal-section-title:first-child { margin-top: 0; }
dialog.confirm-dialog { width: min(400px, calc(100vw - 30px)); }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-wash); color: #c17a05; display: grid; place-items: center; margin-bottom: 12px; }
.confirm-icon.danger { background: var(--danger-wash); color: var(--danger); }
.confirm-icon .icon { width: 22px; height: 22px; }
.confirm-dialog h3 { font-size: 15px; margin-bottom: 5px; }
.confirm-dialog p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.confirm-dialog .modal-body { padding: 22px 22px 8px; }
.confirm-dialog .modal-foot { border-top: 0; background: transparent; padding-top: 6px; }

.toast-container { position: fixed; top: 18px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 250px; max-width: 380px; background: #0f2433; color: #fff;
  border-radius: 10px; padding: 11px 14px; box-shadow: 0 12px 34px rgba(7,24,36,.26);
  display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.5;
  pointer-events: auto; animation: toastIn .2s ease;
}
.toast .icon { width: 17px; height: 17px; margin-top: 1px; flex: 0 0 17px; }
.toast.success .icon { color: #6ee7b7; }
.toast.error .icon { color: #fda4af; }
.toast.warn .icon { color: #fcd34d; }
.toast.info .icon { color: #93c5fd; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.55); z-index: 90; display: none; place-items: center; backdrop-filter: blur(1px); }
.loading-overlay.show { display: grid; }
.loader { width: 34px; height: 34px; border: 3px solid #cfe7e3; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- 登录 ---------- */
body.login-page {
  min-height: 100vh; background: #eaf2f4;
  background-image: radial-gradient(900px 500px at 0% 0%, #d4eee9, transparent 60%), radial-gradient(700px 500px at 100% 100%, #e8f0f8, transparent 60%);
  display: grid; place-items: center; padding: 24px;
}
.login-shell {
  width: min(1030px, 100%); min-height: 640px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(12, 43, 58, .17), 0 0 0 1px rgba(15,118,110,.06);
}
.login-visual {
  background:
    radial-gradient(650px 450px at 15% 8%, rgba(20,184,166,.22), transparent 55%),
    radial-gradient(420px 350px at 100% 100%, rgba(245,158,11,.12), transparent 55%),
    linear-gradient(155deg, #08232e, #0b3b40 55%, #0b2b33);
  color: #fff; padding: 38px 42px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login-visual::after {
  content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  border: 100px solid rgba(94,234,212,.055); right: -320px; bottom: -300px;
}
.login-visual .brand { padding: 0 0 42px; }
.login-visual h1 { font-size: 31px; line-height: 1.35; letter-spacing: -.6px; font-weight: 700; }
.login-visual h1 em { font-style: normal; color: #5eead4; }
.login-visual > p { color: #9ebbbd; font-size: 13px; line-height: 1.8; margin-top: 13px; max-width: 350px; }
.login-features { margin-top: 36px; display: flex; flex-direction: column; gap: 17px; position: relative; z-index: 1; }
.login-feature { display: flex; gap: 12px; align-items: flex-start; }
.login-feature .lf-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); display: grid; place-items: center; color: #5eead4; }
.login-feature .lf-icon .icon { width: 17px; height: 17px; }
.login-feature strong { display: block; font-size: 13px; font-weight: 600; }
.login-feature span { display: block; font-size: 11px; color: #8faeb2; margin-top: 2px; line-height: 1.6; }
.login-visual .login-foot { margin-top: auto; display: flex; align-items: center; gap: 7px; color: #78999d; font-size: 10.5px; padding-top: 30px; position: relative; z-index: 1; }
.login-visual .login-foot .lan-dot { background: #5eead4; box-shadow: 0 0 0 3px rgba(94,234,212,.12); }
.login-form-panel { padding: 54px 52px 42px; display: flex; flex-direction: column; justify-content: center; }
.login-form-panel h2 { font-size: 24px; letter-spacing: -.5px; }
.login-form-panel .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.login-form { margin-top: 28px; display: flex; flex-direction: column; gap: 15px; }
.login-form .input { height: 45px; background: #f8fafb; }
.login-form .input:focus { background: #fff; }
.login-form .form-label { font-size: 12px; }
.login-form .btn { height: 45px; margin-top: 4px; font-size: 14px; }
.password-field { position: relative; }
.password-field .input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 7px; top: 7px; width: 30px; height: 30px; border: 0; background: none; color: #8da1af; display: grid; place-items: center; border-radius: 6px; }
.pw-toggle:hover { background: #eef3f5; color: var(--ink-soft); }
.login-hint { margin-top: 18px; background: #f8fafb; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 10px 12px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.login-hint code { background: #eaf3f1; color: var(--brand-dark); border-radius: 4px; padding: 1px 5px; font-family: Consolas, monospace; }
.login-copy { margin-top: auto; padding-top: 26px; text-align: center; color: #9aacb8; font-size: 10.5px; }
.login-error { margin-top: 16px; }
.login-success { margin-top: 16px; }

/* ---------- 标签打印 ---------- */
.labels-page { background: #eef3f5; min-height: 100vh; padding: 22px; }
.labels-toolbar { max-width: 1000px; margin: 0 auto 18px; display: flex; align-items: center; gap: 10px; }
.labels-toolbar .page-actions { margin-left: auto; }
.labels-grid {
  max-width: 1000px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.label-card {
  background: #fff; border: 1px dashed #c7d5df; border-radius: 5px;
  padding: 9px 10px 7px; min-height: 118px; display: flex; flex-direction: column;
  break-inside: avoid; page-break-inside: avoid;
}
.label-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.label-company { font-size: 8px; color: #74899a; letter-spacing: .3px; max-width: 46%; line-height: 1.4; }
.label-price { font-size: 12px; font-weight: 700; color: #102331; white-space: nowrap; }
.label-name { font-size: 10px; font-weight: 700; line-height: 1.35; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.label-model { font-size: 8px; color: #637888; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-barcode { margin-top: auto; text-align: center; }
.label-barcode .barcode-svg { width: 100%; height: 34px; display: block; }
.label-code { font-family: Consolas, monospace; font-size: 9px; letter-spacing: 1px; color: #263b4a; margin-top: 1px; }
.label-bad { font-size: 8px; color: var(--danger); padding: 10px 0; }
.labels-empty { text-align: center; padding: 80px 20px; color: var(--muted); }

/* ---------- 错误页 ---------- */
.error-page { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.error-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 46px 54px; max-width: 440px; }
.error-code { font-size: 68px; font-weight: 800; letter-spacing: -3px; color: var(--brand); line-height: 1; opacity: .22; }
.error-card h2 { font-size: 19px; margin: 10px 0 6px; }
.error-card p { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.error-card .btn { margin-top: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .kpi-grid, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid.equal { grid-template-columns: minmax(0, 1fr); }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 210px; }
  .content { padding: 20px 20px 34px; }
  .topbar { padding: 0 20px; }
  .global-search { width: 190px; }
  .order-layout { grid-template-columns: 1fr; }
  .order-side { position: static; }
  .settings-layout { grid-template-columns: 160px minmax(0, 1fr); }
  .login-shell { grid-template-columns: 1fr; max-width: 500px; min-height: auto; }
  .login-visual { display: none; }
  .login-form-panel { padding: 42px 40px 34px; }
}
@media (max-width: 820px) {
  .hide-sm { display: none !important; }
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px rgba(7,24,36,.25); }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { height: 62px; flex-basis: 62px; gap: 11px; }
  .page-heading p { display: none; }
  .global-search { display: none; }
  .page-heading h1 { font-size: 16px; }
  .user-trigger .u-name, .user-trigger .u-role { display: none; }
  .content { padding: 16px 14px 30px; overflow-x: hidden; }
  .table { min-width: 640px; }
  .welcome-strip { align-items: flex-start; flex-direction: column; gap: 8px; }
  .welcome-strip .page-actions { margin-left: 0; }
  .kpi-grid, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; margin-bottom: 0; }
  .report-header { flex-direction: column; align-items: stretch; gap: 13px; }
  .report-header .page-actions { margin-left: 0; flex-wrap: wrap; }
  .filter-bar { padding: 11px; }
  .filter-bar .search-box { max-width: none; flex-basis: 100%; }
  .filter-bar .date-range { flex: 1; }
  .filter-bar .date-range .input { width: 100%; min-width: 0; }
  .paper { padding: 22px 18px; }
  .paper-head { flex-direction: column; }
  .paper-title { margin-left: 0; text-align: left; }
  .paper-title h2 { font-size: 21px; }
  .paper-meta { grid-template-columns: 1fr; gap: 2px; }
  .paper-footer { flex-direction: column; align-items: flex-start; }
  .signature { flex-wrap: wrap; gap: 18px; }
  .labels-grid { grid-template-columns: repeat(2, 1fr); }
  .login-form-panel { padding: 34px 24px 26px; }
  .login-shell { border-radius: 16px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-foot { padding: 12px 16px; }
  .table .product-cell { min-width: 150px; }
}
@media (max-width: 520px) {
  .kpi-grid, .report-kpis { grid-template-columns: 1fr; }
  .page-toolbar { align-items: flex-start; }
  .page-toolbar .page-actions { margin-left: 0; }
  .labels-grid { grid-template-columns: 1fr; }
  .labels-toolbar { flex-wrap: wrap; }
  .labels-toolbar .page-actions { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .mini-stats { display: none; }
}

/* ---------- 打印 ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .detail-toolbar, .labels-toolbar, .toast-container, .no-print, .content > .alert { display: none !important; }
  .main-area { width: 100% !important; margin: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .paper { box-shadow: none; border: 0; padding: 0; max-width: none; border-radius: 0; }
  .paper-head { border-bottom-color: #000; }
  .paper .table th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #999; }
  .labels-page { padding: 0; background: #fff; }
  .labels-grid { max-width: none; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label-card { border: 1px dashed #aaa; min-height: 28mm; }
  a { text-decoration: none; }
}
