/* ========== CRMS 进销存流向核对系统 通用样式（自包含，无外部依赖） ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}
a { color: #1a6ee0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar { background: #16345c; color: #fff; }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; height: 52px;
}
.brand { font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand em { font-style: normal; font-size: 12px; color: #9fb8d8; margin-left: 6px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-item {
  color: #cfe0f5; padding: 6px 12px; border-radius: 6px; font-size: 13.5px;
  white-space: nowrap;
}
.nav-item:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.nav-item.on { color: #fff; background: rgba(255,255,255,.16); font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.user-box b { font-size: 13px; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #3f6fae; color: #fff;
}
.tag-admin { background: #d97706; }
.logout { color: #fecaca; font-size: 13px; }

/* 容器 */
.container { max-width: 1280px; margin: 16px auto; padding: 0 16px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 700; }
.period-badge {
  background: #eef4ff; border: 1px solid #c9ddf7; color: #1a4f9e;
  padding: 4px 10px; border-radius: 6px; font-size: 12.5px;
}

/* 卡片 */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.07); margin-bottom: 16px; }
.card-head { padding: 12px 16px; border-bottom: 1px solid #eef0f3; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
  border-left: 4px solid #1a6ee0;
}
.stat.warn { border-left-color: #d97706; }
.stat.bad { border-left-color: #dc2626; }
.stat.ok { border-left-color: #16a34a; }
.stat .num { font-size: 24px; font-weight: 700; }
.stat .lbl { color: #777; font-size: 12.5px; margin-top: 2px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; font-size: 13px; }
.table th { background: #f8fafc; color: #555; font-weight: 600; white-space: nowrap; }
.table tr:hover td { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 30px; text-align: center; color: #999; }

/* 状态徽标 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge.gray { background: #e5e7eb; color: #4b5563; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.badge.purple { background: #ede9fe; color: #5b21b6; }

/* 按钮 */
.btn {
  display: inline-block; padding: 6px 14px; border-radius: 7px; border: 1px solid transparent;
  background: #1a6ee0; color: #fff; font-size: 13px; cursor: pointer; line-height: 1.5;
}
.btn:hover { opacity: .88; text-decoration: none; color: #fff; }
.btn-green { background: #16a34a; }
.btn-red { background: #dc2626; }
.btn-gray { background: #6b7280; }
.btn-outline { background: #fff; color: #1a6ee0; border-color: #1a6ee0; }
.btn-outline:hover { background: #f0f6ff; color: #1a6ee0; }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }

/* 表单 */
.f {
  width: 100%; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13.5px; background: #fff; color: #333;
}
.f:focus { outline: none; border-color: #1a6ee0; box-shadow: 0 0 0 2px rgba(26,110,224,.15); }
textarea.f { resize: vertical; }
label.lbl { display: block; font-size: 12.5px; color: #555; margin-bottom: 5px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-row { margin-bottom: 14px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.form-inline { display: inline; }
.input-sm { padding: 4px 8px; font-size: 12.5px; width: auto; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* 筛选条 */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .f { width: auto; }

/* 页脚 */
.footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px 0; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; }
.detail-item .k { color: #777; font-size: 12.5px; }
.detail-item .v { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16345c 0%, #1a5ca8 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 34px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-title { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub { text-align: center; color: #888; font-size: 12.5px; margin-bottom: 24px; }
.login-hint {
  margin-top: 18px; background: #f8fafc; border: 1px dashed #d1d5db;
  border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #6b7280; line-height: 1.8;
}

/* 简易弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-mask.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 420px; max-width: 92vw; padding: 20px; }
.modal-title { font-weight: 700; margin-bottom: 12px; }
.modal-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }

.mono { font-family: Consolas, monospace; }
.muted { color: #6b7280; }
.small { font-size: 12px; }

/* 报表数字填报框（小号、整数） */
.qty-input {
  width: 72px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #fff;
  color: #333;
}
.qty-input:focus { outline: none; border-color: #1a6ee0; box-shadow: 0 0 0 2px rgba(26,110,224,.15); }
.qty-ro {
  display: inline-block;
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #374151;
  background: #f8fafc;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  padding: 3px 8px;
}
