* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: #f4f6fa;
  color: #0f172a;
}

/* ---------------- 登录 ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f4f6fa 60%);
}
.login-card {
  width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px 32px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 64px; height: 64px; line-height: 64px; margin: 0 auto 16px;
  background: #2563eb; color: #fff; border-radius: 16px;
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}
.login-brand h1 { font-size: 20px; margin: 0 0 8px; }
.login-brand p { margin: 0; color: #94a3b8; font-size: 13px; }
.ipt-pre { color: #94a3b8; font-size: 13px; }
.login-tip {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid #f1f5f9;
  font-size: 12px; color: #94a3b8; line-height: 1.9;
}
.login-tip b { color: #2563eb; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 200px; flex-shrink: 0; background: #0f172a;
  display: flex; flex-direction: column;
}
.side-brand {
  height: 62px; display: flex; align-items: center; padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-logo {
  width: 30px; height: 30px; line-height: 30px; text-align: center;
  background: #2563eb; color: #fff; border-radius: 8px;
  font-size: 12px; font-weight: 700; margin-right: 10px;
}
.side-name { color: #e2e8f0; font-size: 14px; font-weight: 600; }
.side-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; padding: 10px 12px; margin-bottom: 4px;
  color: #94a3b8; font-size: 14px; border-radius: 8px; cursor: pointer;
  transition: all .16s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-on { background: #2563eb; color: #fff; font-weight: 500; }
.nav-on:hover { background: #2563eb; color: #fff; }
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  margin-right: 10px; opacity: .7;
}
.side-foot {
  padding: 14px 18px; color: #475569; font-size: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 62px; flex-shrink: 0; background: #fff; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #e8edf5;
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  background: #eff6ff; color: #1d4ed8; font-size: 13px;
  padding: 5px 12px; border-radius: 999px; margin-right: 6px;
}
.content { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }

/* ---------------- 卡片与统计 ---------------- */
.stat-card {
  background: #fff; border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06); margin-bottom: 16px;
}
.stat-card.flat { box-shadow: none; border: 1px solid #e8edf5; margin-bottom: 0; }
.stat-label { font-size: 13px; color: #94a3b8; }
.stat-value { font-size: 26px; font-weight: 700; margin: 8px 0 4px; }
.stat-sub { font-size: 12px; color: #cbd5e1; }

.card-head { display: flex; align-items: center; justify-content: space-between; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sum-text { font-size: 13px; color: #475569; }
.sum-text b { color: #0f172a; }

.t-red { color: #ef4444; }
.t-green { color: #10b981; }
.t-muted { color: #94a3b8; font-size: 12px; }
.sec-title { margin: 22px 0 10px; font-size: 14px; color: #0f172a; }

/* ---------------- 工作台快捷入口（#150） ---------------- */
.quick-entry {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 16px;
}
.qe-btn {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: #fff; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(15,23,42,.06);
  border: 1px solid #e8edf5; transition: all .18s ease;
  user-select: none;
}
.qe-btn:hover {
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.1);
  border-color: #c7d2fe;
}
.qe-btn:active { transform: translateY(0); }
.qe-ico {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.qe-create .qe-ico { background: linear-gradient(135deg,#2563eb,#4f46e5); }
.qe-invoice .qe-ico { background: linear-gradient(135deg,#f59e0b,#f97316); }
.qe-plan .qe-ico { background: linear-gradient(135deg,#10b981,#059669); }
.qe-balance .qe-ico { background: linear-gradient(135deg,#8b5cf6,#6366f1); }
.qe-t { font-size: 15px; font-weight: 600; color: #0f172a; }
.qe-d { font-size: 12px; color: #94a3b8; margin-top: 2px; }
/* #163 切换订单小按钮 */
.qe-btn { position: relative; }
.qe-switch {
  position: absolute; top: 8px; right: 10px;
  font-size: 11px; color: #6366f1; cursor: pointer;
  background: #eef2ff; border: 1px solid #e0e7ff;
  border-radius: 999px; padding: 2px 8px; line-height: 1.6;
  transition: all .15s ease;
}
.qe-switch:hover { background: #e0e7ff; color: #4338ca; }
.qe-btn .qe-t { padding-right: 56px; }

/* 详情抽屉区块聚焦高亮（#150） */
.sec-flash { animation: secFlash 1.6s ease; border-radius: 8px; }
@keyframes secFlash {
  0% { box-shadow: 0 0 0 3px rgba(37,99,235,.45); }
  60% { box-shadow: 0 0 0 3px rgba(37,99,235,.45); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

.attach-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.attach-item { width: 130px; }
.attach-name {
  font-size: 12px; color: #475569; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-meta { font-size: 11px; color: #cbd5e1; }

.el-table { font-size: 13px; }
.el-table .cell { line-height: 1.6; }
.el-card__header { padding: 14px 18px; font-weight: 600; }
.el-card__body { padding: 18px; }

@media (max-width: 1100px) {
  .sidebar { width: 64px; }
  .side-name, .nav-item span.nav-dot + * { display: none; }
  .nav-item { justify-content: center; font-size: 12px; padding: 10px 4px; }
  .side-brand { justify-content: center; padding: 0; }
  .side-logo { margin: 0; }
}

/* ---------------- 消息中心 / 待办预警（借鉴管家婆「消息提醒」） ---------------- */
.alert-bar {
  display: flex; align-items: center; gap: 12px;
  background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #f97316;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.alert-dot {
  width: 22px; height: 22px; line-height: 22px; text-align: center; flex: none;
  background: #f97316; color: #fff; border-radius: 50%; font-weight: 700; font-size: 13px;
}
.alert-text { flex: 1; font-size: 13px; color: #9a3412; }
.alert-text b { color: #c2410c; font-size: 14px; }

.bell-wrap { display: inline-flex; align-items: center; margin-right: 4px; }

.notify-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;
}
.notify-grow { flex: 1; }
.notify-empty { padding: 48px 0; text-align: center; color: #94a3b8; font-size: 13px; }
.notify-list { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.notify-item {
  border: 1px solid #e2e8f0; border-left: 3px solid #94a3b8;
  border-radius: 8px; padding: 10px 12px; cursor: pointer; background: #fff;
  transition: box-shadow .15s, background .15s;
}
.notify-item:hover { background: #f8fafc; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.notify-item.lv-danger { border-left-color: #ef4444; background: #fef2f2; }
.notify-item.lv-warning { border-left-color: #f59e0b; background: #fffbeb; }
.notify-item.lv-info { border-left-color: #10b981; background: #f0fdf4; }
.notify-item.is-read { background: #fff; border-left-color: #e2e8f0; opacity: .72; }
.notify-row { display: flex; align-items: center; justify-content: space-between; }
.notify-type { font-size: 11px; color: #64748b; }
.notify-time { font-size: 11px; color: #cbd5e1; }
.notify-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-top: 4px; }
.notify-content { font-size: 12px; color: #475569; line-height: 1.7; margin-top: 4px; }
.notify-foot { margin-top: 8px; display: flex; gap: 6px; }

/* ---------------- 新建订单弹窗：订购单/货单 上传条（先选照片，再点识别） ---------------- */
.dlg-up-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ---------------- 订单详情：采购记录上传条 ---------------- */
.dlg-proc-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.proc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.proc-thumbs .thumb {
  position: relative; width: 88px; height: 66px; border-radius: 6px; overflow: hidden;
  border: 1px solid #e2e8f0; flex: none;
}
.proc-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proc-thumbs .thumb .thumb-rm {
  position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; line-height: 16px;
  text-align: center; background: rgba(15,23,42,.55); color: #fff; border-radius: 50%;
  font-size: 12px; cursor: pointer;
}
/* #178 非图片附件（PDF/dwg 等）以文件名标签展示；图片则在上方缩略图里点击放大 */
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip {
  display: inline-block; max-width: 220px; padding: 2px 8px; border-radius: 10px;
  background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 新建订单：分步向导（#148） ---------------- */
.order-step-bar { margin-bottom: 14px; }
.order-step-body { min-height: 260px; }
.order-step-foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid #eef2f7;
  display: flex; align-items: center; justify-content: space-between;
}
.order-step-tip { font-size: 12px; color: #94a3b8; }
/* 核对步：紧凑两列摘要 */
.oc-summary { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 12px 14px; }
.oc-summary .oc-title { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 8px; }
.oc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: 13px; }
.oc-kv .oc-k { color: #64748b; }
.oc-kv .oc-v { color: #0f172a; font-weight: 600; word-break: break-all; }
.oc-lines { margin-top: 8px; }
.oc-line { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed #e2e8f0; }
.oc-line .oc-line-no { color: #94a3b8; width: 22px; flex: none; }
.oc-amt-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2e8f0; text-align: right; }

/* ---------------- 订单详情分步向导（需求D）：圆点导航 + 分步底栏 ---------------- */
.detail-steps {
  display: flex;
  gap: 6px;
  padding: 10px 4px 12px;
  margin: 0 -4px 10px;
  border-bottom: 1px solid #eef2f7;
  position: sticky;
  top: 0;
  background: rgba(244, 246, 250, .96);
  z-index: 5;
}
.dstep {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  color: #64748b;
}
.ds-no {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #64748b;
  transition: all .2s;
}
.ds-t { font-size: 11px; white-space: nowrap; }
.dstep.ds-on .ds-no {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
}
.dstep.ds-on .ds-t { color: #1d4ed8; font-weight: 600; }
.dstep.ds-done .ds-no {
  background: #dcfce7;
  color: #16a34a;
}
.dstep.ds-done .ds-t { color: #16a34a; }
.detail-step-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
