/* 鹤岗发货工作台 - 浅色专业主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #eff6ff;
  --bg: #f4f6fa; --card: #ffffff; --border: #e6e9f0; --border-light: #f1f4f9;
  --text: #1e293b; --muted: #64748b; --muted2: #94a3b8;
  --red: #dc2626; --red-bg: #fef2f2; --red-border: #fecaca;
  --green: #16a34a; --green-bg: #f0fdf4; --green-border: #bbf7d0;
  --orange: #ea580c; --orange-bg: #fff7ed; --orange-border: #fed7aa;
  --blue: #2563eb; --blue-bg: #eff6ff; --blue-border: #bfdbfe;
  --purple: #7c3aed; --purple-bg: #f5f3ff; --purple-border: #ddd6fe;
  --cyan: #0891b2; --cyan-bg: #ecfeff; --cyan-border: #a5f3fc;
  --gray: #64748b; --gray-bg: #f8fafc; --gray-border: #e2e8f0;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2f9 0%, #f4f6fa 55%, #eaf1fb 100%); }
.login-card { width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 38px 36px; box-shadow: 0 12px 40px rgba(30, 41, 59, .08); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 26px; }
.login-card .field label { font-size: 13px; margin-bottom: 7px; }
.login-card .field input { height: 42px; padding: 0 13px; font-size: 14px; border-radius: 8px; }
.login-card .btn { width: 100%; height: 42px; padding: 0; font-size: 14.5px; margin-top: 18px;
  justify-content: center; border-radius: 8px; font-weight: 500; letter-spacing: .5px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--muted2); text-align: center; line-height: 1.7; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 212px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 15px 16px; border-bottom: 1px solid var(--border-light); }
.sidebar .brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar .brand .t { font-size: 14px; font-weight: 600; line-height: 1.25; }
.sidebar .brand .t small { display: block; font-size: 10.5px; color: var(--muted2); font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.nav-group { font-size: 11px; color: var(--muted2); padding: 14px 8px 5px; letter-spacing: .5px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px;
  color: var(--text); font-size: 13.5px; cursor: pointer; user-select: none; margin-bottom: 1px; }
.nav-item svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.nav-item.active svg { color: var(--primary); }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px;
  border-radius: 99px; padding: 0 6px; line-height: 16px; font-weight: 500; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-size: 15px; font-weight: 600; }
.topbar .page-sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .date-now { font-size: 12.5px; color: var(--muted); }
.content { padding: 20px 22px 40px; max-width: 1460px; width: 100%; }

/* ---------- 卡片与统计 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .t { font-size: 14.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 13px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; position: relative; }
.stat .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 21px; font-weight: 650; margin-top: 7px; font-variant-numeric: tabular-nums; }
.stat .value.red { color: var(--red); } .stat .value.green { color: var(--green); }
.stat .value.orange { color: var(--orange); } .stat .value.blue { color: var(--blue); }
.stat .foot { font-size: 11.5px; color: var(--muted2); margin-top: 5px; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 1080px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 9px 11px;
  border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap; font-size: 12.5px; }
table.tbl td { padding: 9px 11px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.strong { font-weight: 600; }
.red-text { color: var(--red); } .green-text { color: var(--green); } .orange-text { color: var(--orange); }
.empty { text-align: center; color: var(--muted2); padding: 34px 0; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
  transition: all .12s; white-space: nowrap; font-family: inherit; }
.btn:hover { border-color: #c7d2e8; background: #f8fafc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--red); border-color: var(--red-border); background: #fff; }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn-link { border: none; background: none; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 2px 5px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 99px; font-size: 11.5px;
  border: 1px solid; line-height: 18px; white-space: nowrap; }
.tag-gray { color: var(--gray); background: var(--gray-bg); border-color: var(--gray-border); }
.tag-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-border); }
.tag-green { color: var(--green); background: var(--green-bg); border-color: var(--green-border); }
.tag-orange { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-border); }
.tag-red { color: var(--red); background: var(--red-bg); border-color: var(--red-border); }
.tag-purple { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-border); }
.tag-cyan { color: var(--cyan); background: var(--cyan-bg); border-color: var(--cyan-border); }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; margin-bottom: 13px; align-items: flex-start; }
.field { flex: 1; min-width: 0; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px;
  line-height: 18px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field label .req { color: var(--red); margin-left: 2px; }
/* 注意：必须覆盖“没写 type 属性”的 input（v-model 默认 text），否则会退回浏览器默认双边框样式 */
input, select, textarea {
  display: block; width: 100%; height: 34px; padding: 0 10px; border: 1px solid #dfe4ee; border-radius: 7px;
  font-size: 13.5px; background: #fff; color: var(--text); font-family: inherit; line-height: 32px;
  -webkit-appearance: none; appearance: none; transition: border-color .12s, box-shadow .12s, background .12s; }
input[type=checkbox], input[type=radio] {
  display: inline-block; width: 14px; height: 14px; padding: 0; border: none; background: none;
  accent-color: var(--primary); cursor: pointer; vertical-align: -2px; }
input[type=file] { height: auto; padding: 5px 8px; line-height: normal; }
input:hover, select:hover, textarea:hover { border-color: #cbd4e4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
input:disabled, select:disabled, textarea:disabled { background: #f6f8fb; color: var(--muted2); cursor: not-allowed; }
input[type=checkbox]:focus, input[type=radio]:focus { box-shadow: none; }
select { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }
input::placeholder, textarea::placeholder { color: #b1b9c7; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
textarea { height: auto; min-height: 66px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.modal-body .form-row:last-child, .modal-body .field:last-child { margin-bottom: 0; }
.modal-body input, .modal-body select, .modal-body textarea { background: #fff; }
.input-err { border-color: var(--red) !important; }
.err-hint { color: var(--red); font-size: 11.5px; margin-top: 4px; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.checkline input { width: auto; height: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 130px; }
.filters .field label { margin-bottom: 4px; font-size: 12px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 13px; width: 100%; max-width: 560px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22); animation: pop .16s ease; }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head .t { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x { border: none; background: none; font-size: 17px; color: var(--muted2); cursor: pointer; padding: 2px 6px; line-height: 1; }
.x:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 300; }
.toast { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--green);
  padding: 10px 18px; border-radius: 9px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
  margin-bottom: 9px; font-size: 13.5px; animation: pop .16s ease; min-width: 220px; }
.toast.err { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-size: 16px; font-weight: 650; min-width: 130px; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 104px; background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 7px; cursor: pointer; transition: border .12s; overflow: hidden; }
.cal-cell:hover { border-color: #c7d2e8; }
.cal-cell.other { background: #fafbfd; }
.cal-cell.today { border-color: var(--primary); background: var(--primary-light); }
.cal-cell.sel { box-shadow: 0 0 0 2px var(--primary); }
.cal-cell .dnum { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; }
.cal-cell.today .dnum { color: var(--primary); font-weight: 700; }
.chip { font-size: 11px; padding: 1.5px 6px; border-radius: 5px; margin-top: 3px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; line-height: 16px; }
.chip:hover { opacity: .85; }
.cal-more { font-size: 11px; color: var(--muted); margin-top: 3px; padding-left: 2px; }
.day-panel { margin-top: 14px; }
.day-ev { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--border-light);
  border-radius: 9px; margin-bottom: 8px; background: #fff; }
.day-ev .bar { width: 3px; border-radius: 2px; align-self: stretch; }
.day-ev .body { flex: 1; min-width: 0; }
.day-ev .tt { font-size: 13px; font-weight: 500; }
.day-ev .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 库存矩阵 ---------- */
.matrix td, .matrix th { text-align: right; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .cell { cursor: pointer; border-radius: 6px; padding: 3px 7px; display: inline-block; min-width: 44px; }
.matrix .cell:hover { background: var(--primary-light); }
.matrix .cell.low { background: var(--orange-bg); color: var(--orange); font-weight: 600; }
.matrix .cell.zero { color: var(--muted2); }

/* ---------- 联系人 ---------- */
.contact-item { border: 1px solid var(--border-light); border-radius: 9px; padding: 11px 13px; margin-bottom: 9px; background: #fff; }
.contact-item .ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.contact-item .ci-name { font-weight: 600; font-size: 13.5px; }
.contact-item .ci-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 14px; font-size: 12.5px; }
.contact-item .ci-grid .k { color: var(--muted2); margin-right: 5px; }

/* ---------- 图表 ---------- */
.chart-box { padding: 6px 4px; }
.legend-inline { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend-inline i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ---------- 杂项 ---------- */
.flex { display: flex; } .aic { align-items: center; } .gap8 { gap: 8px; } .gap14 { gap: 14px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mb14 { margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs .tab { padding: 8px 15px; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
/* ---------- 分页器 ---------- */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light);
  font-size: 12.5px; color: var(--muted); }
.pager .pg-info b { color: var(--text); font-weight: 600; }
.pager .pg-nav { display: flex; gap: 4px; align-items: center; }
.pager .pg-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; font-family: inherit;
  font-variant-numeric: tabular-nums; transition: all .12s; }
.pager .pg-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.pager .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; font-weight: 500; }
.pager .pg-btn.dots { border-color: transparent; cursor: default; color: var(--muted2); }
.pager .pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-size select { display: inline-block; width: auto; height: 28px; padding: 0 24px 0 8px; font-size: 12.5px; line-height: 26px; }
.dl-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; font-size: 13px; }
.dl-inline .k { color: var(--muted); font-size: 12px; }
.kv-list .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border-light); font-size: 13px; }
.kv-list .row:last-child { border-bottom: none; }
.kv-list .row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 10px; display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border-light); }
.loading { text-align: center; color: var(--muted2); padding: 40px 0; font-size: 13px; }
.banner { background: var(--blue-bg); border: 1px solid var(--blue-border); color: #1e40af;
  border-radius: 9px; padding: 10px 14px; font-size: 12.8px; margin-bottom: 14px; line-height: 1.7; }
.banner.warn { background: var(--orange-bg); border-color: var(--orange-border); color: #9a3412; }

/* ---------- 窄屏 / 小窗口适配 ---------- */
@media (max-width: 860px) {
  .mask { padding: 16px 8px 24px; }
  .modal, .modal.wide { max-width: calc(100vw - 16px); }
  .form-row { flex-wrap: wrap; row-gap: 12px; }
  .form-row > .field { flex: 1 1 calc(50% - 6px); max-width: none !important; }
  .modal-body { padding: 14px 14px 16px; }
  .modal-foot { padding: 10px 14px; }
  .filters .field { flex: 1 1 140px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .content { padding: 14px 12px 32px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .date-now { display: none; }
}
@media (max-width: 560px) {
  .form-row > .field { flex: 1 1 100%; }
  .login-card { width: calc(100vw - 24px); padding: 26px 20px; }
}
