/* 业务待办·电脑端 —— 单文件样式，不引任何外部资源（内网/离线也能用） */

:root {
  --brand: #2E7BC6;
  --brand-dark: #1F5E9E;
  --danger: #C0392B;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --line: #E2E7EE;
  --text: #1F2937;
  --muted: #6B7280;
  --radius: 10px;
}

* { box-sizing: border-box; }

/*
 * ⚠️ 必须显式声明 [hidden]。
 * HTML 的 hidden 属性只带 UA 样式 `display:none`，而下面 `.login-wrap { display:flex }`
 * 是作者样式，优先级更高 —— 结果就是「登录成功后登录框还赖在页面上」。
 * 这条 !important 是故意的，别再删。
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(31, 41, 55, .08);
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card label { display: block; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}
.login-msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: var(--danger); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; font-size: 16px; }
.tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.tab:hover { background: #EEF3F9; }
.tab.active { background: #E7F0FA; color: var(--brand-dark); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* ---------- 概览 ---------- */
.stats {
  display: flex;
  gap: 12px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 120px;
}
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- 面板 ---------- */
main { padding: 16px 20px 40px; }
.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 8px; }
.card h3 { font-size: 14px; margin: 18px 0 8px; }

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.spacer { flex: 1; }

.input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  min-width: 120px;
}
.input:focus { outline: 2px solid #CFE1F5; border-color: var(--brand); }

.btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.btn:hover { background: #F7F9FC; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #F0C8C1; }
.btn.danger:hover { background: #FDF2F0; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.grid2 label { font-size: 13px; color: var(--muted); display: block; }
.grid2 .input { width: 100%; margin-top: 4px; }
.grid-full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* 目标销量下面那行提示：填了就换成正向确认（颜色跟 App 端的 TOP 橙一致） */
.muted.ok { color: #854F0B; }
.radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #EEF1F5;
  white-space: nowrap;
}
.table thead th { background: #F8FAFC; font-weight: 600; color: #475569; position: sticky; top: 0; }
.table tbody tr:hover { background: #FAFCFF; }
.table .w-check { width: 36px; }
.table td.wrap { white-space: normal; max-width: 260px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #EAF2FB;
  color: var(--brand-dark);
  font-size: 12px;
  margin-right: 4px;
}
.pill.wk { background: #EDF1F7; color: #475569; margin-left: 4px; }
/* 网点标识：冰柜蓝、TOP 橙（页面上只有 TOP 用橙，一眼能认出重点店） */
.pill.fridge { background: #E3F0FB; color: #1B5E8A; margin-left: 4px; }
.pill.top { background: #FDEFDA; color: #9A6410; margin-left: 4px; }
.pill.gray { background: #F1F3F6; color: #64748B; }
.pill.ok { background: #E7F6EC; color: #1F7A44; }
.pill.warn { background: #FDF3E3; color: #A6650B; }
.pill.danger { background: #FCEBEB; color: #A32D2D; }

/* ---------- 本月销量列（v1.6.22，跟手机端对齐） ---------- */
/* 达标（≥100%）才上绿：绿在这个 App 里只表达「办完了 / 达标了」 */
.sales-ok { color: #1F7A44; }
/* 完成率 pill 跟数值保持同一行，别换行把行高撑开 */
#cust-body .pill { margin-left: 4px; }
/* 两个新筛选下拉：跟负责人下拉同宽，不撑爆工具栏 */
#fridge-filter, #sales-filter { width: auto; padding: 4px 8px; font-size: 12px; }

.progress { display: inline-block; width: 72px; height: 6px; background: #EEF1F5; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

.mw-preview { margin-top: 6px; line-height: 2; }

/* ---------- 导入预览 ---------- */
.preview-note { margin: 12px 0 6px; font-size: 13px; }
.errors { max-height: 160px; overflow: auto; background: #FFF8F6; border: 1px solid #F5DAD3; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #9C3B27; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #1F2937;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; }
}


/* ---------- 编辑客户弹窗 ---------- */
.w-act { width: 78px; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(22, 33, 44, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }

/* 编辑客户弹窗要更宽：频率与拜访日并排后，窄了 chip 会折成一列 */
.modal.wide { max-width: 660px; }

/* 并排的两个字段（左窄右宽：频率 3 个选项，拜访日 8 个） */
.field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }

.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(16, 30, 48, .18);
}
.modal h3 {
  margin: 0;
  padding: 16px 18px 10px;
  font-size: 16px;
  color: var(--text);
}
.modal-body {
  padding: 0 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-foot {
  padding: 12px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }
.field .req { color: var(--danger); }

.day-chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.day-chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}


/* ---------- 每页条数 ---------- */
.pager-size {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.pager-size .input {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
}

/* ---------- 客户跟进（v1.6.14） ---------- */
.fu-group { font-size: 12px; color: var(--muted); margin: 12px 0 2px; }
.fu-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.fu-item:last-child { border-bottom: none; }
.fu-item input[type=checkbox] { margin-top: 3px; flex: 0 0 auto; }
.fu-item .fu-text { flex: 1; font-size: 13px; line-height: 1.5; word-break: break-word; }
.fu-item.done .fu-text { color: var(--muted); text-decoration: line-through; }
.fu-item .fu-time { font-size: 11px; color: var(--brand); margin-top: 3px; }
.fu-empty { font-size: 13px; color: var(--muted); padding: 12px 0; }

/* ---------- 底部备案信息（2026-10-15） ---------- */
/* 工信部要求：境内服务器站点底部展示备案号，并链到 beian.miit.gov.cn */
.site-footer {
  padding: 16px 20px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }

/* 登录页里的备案行：登录页本身是 100vh 撑满，靠它保证「首屏就能看到」 */
.login-icp {
  margin: 14px 0 0;
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.login-icp a { color: var(--muted); text-decoration: none; }
.login-icp a:hover { color: var(--brand); text-decoration: underline; }
