/* ============ 每日目标复盘系统 - 全局样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f4f6f8; color: #222; font-size: 14px; line-height: 1.5;
}
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #1f4e79; color: #fff;
  box-shadow: 0 2px 8px rgba(31, 78, 121, .25);
}
.topbar-inner {
  max-width: 640px; margin: 0 auto; padding: 12px 14px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b7bb8, #1f4e79);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.brand-name { font-size: 16px; font-weight: 700; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14);
  border-radius: 16px; padding: 3px 10px; max-width: 150px;
}
.user-chip .uname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.22); white-space: nowrap; }
.btn-logout { background: rgba(255,255,255,.14); border-radius: 16px; padding: 3px 10px; color: #fff; font-size: 12px; }
.btn-logout:active { background: rgba(255,255,255,.3); }

/* 窄屏(<=480px)顶部导航压缩: 隐藏品牌名, 简化用户区 */
@media (max-width: 480px) {
  .topbar-inner { padding: 9px 8px 7px; }
  .brand { gap: 5px; }
  .brand-name { display: none; }
  .user-chip { padding: 2px 6px; max-width: 80px; }
  .user-chip .uname { display: none; }
  .topbar-right { gap: 6px; }
  .btn-logout { padding: 2px 8px; font-size: 11px; }
  .tab { padding: 9px 5px; font-size: 12px; min-width: 72px; }
  .page { padding: 92px 10px 90px; }
}

.tabs {
  max-width: 640px; margin: 0 auto;
  display: flex; overflow-x: auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: 82px; padding: 10px 8px; text-align: center;
  color: rgba(255,255,255,.72); font-size: 13px; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.tab.active { color: #fff; font-weight: 600; border-bottom-color: #fff; background: rgba(255,255,255,.06); }

/* ---------- 页面容器 ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 104px 12px 96px; }
.page.no-tabs { padding-top: 76px; }
.section-title { font-size: 15px; font-weight: 700; color: #1f4e79; margin: 18px 0 10px; display: flex; align-items: center; gap: 6px; }
.section-title:first-child { margin-top: 6px; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border-radius: 12px; padding: 15px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(31,78,121,.06); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.card-title { font-size: 14px; font-weight: 700; color: #222; }
.card-sub { font-size: 12px; color: #888; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; display: block; }
.form-label .req { color: #d64545; }
.input, .textarea, .select {
  width: 100%; padding: 11px 12px; border: 1px solid #e0e6ec; border-radius: 10px;
  background: #fbfcfe; font-size: 14px; outline: none; transition: border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: #1f4e79; background: #fff; }
.textarea { min-height: 80px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; }

/* 只读信息行 */
.info-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.info-cell {
  flex: 1; min-width: calc(50% - 5px); background: #f7f9fb; border-radius: 10px; padding: 9px 12px;
}
.info-cell .k { font-size: 11px; color: #888; }
.info-cell .v { font-size: 14px; font-weight: 600; color: #222; margin-top: 1px; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; padding: 13px; border-radius: 12px;
  font-size: 16px; font-weight: 600; text-align: center; transition: all .15s;
}
.btn-primary { background: #1f4e79; color: #fff; }
.btn-primary:active { background: #163a5c; }
.btn-ghost { background: #eef2f7; color: #1f4e79; }
.btn-ghost:active { background: #e0e7ef; }
.btn-sm { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; border-radius: 8px; font-weight: 600; }
.btn-danger { background: #d64545; color: #fff; }
.btn-danger-ghost { background: #fdecec; color: #d64545; }
.btn:disabled { opacity: .5; }

/* 补救措施 筛选按钮 */
.remedy-btns { display: flex; gap: 10px; }
.remedy-btn {
  flex: 1; padding: 12px; border-radius: 12px; border: 1.5px solid #e0e6ec;
  background: #fff; text-align: center; font-size: 14px; color: #666;
}
.remedy-btn.active-ot { border-color: #1f4e79; background: #eef4fa; color: #1f4e79; font-weight: 700; }
.remedy-btn.active-rp { border-color: #b0760a; background: #fdf3e0; color: #8a5a00; font-weight: 700; }
.remedy-panel { margin-top: 10px; background: #f7f9fb; border-radius: 10px; padding: 12px; }

/* ---------- 动态行 ---------- */
.dyn-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.dyn-no {
  width: 24px; height: 24px; border-radius: 50%; background: #eef2f7; color: #1f4e79;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 9px;
}
.dyn-input { flex: 1; padding: 10px 12px; border: 1px solid #e0e6ec; border-radius: 10px; font-size: 14px; outline: none; background: #fbfcfe; }
.dyn-input:focus { border-color: #1f4e79; background: #fff; }
.dyn-del { flex-shrink: 0; width: 34px; height: 38px; margin-top: 1px; border-radius: 10px; background: #f7f9fb; color: #999; font-size: 18px; }
.dyn-del:active { background: #fdecec; color: #d64545; }
.add-row-btn {
  width: 100%; padding: 10px; border: 1.5px dashed #c6d2de; border-radius: 10px;
  color: #1f4e79; font-size: 13px; font-weight: 600; background: #fbfcfe;
}
.add-row-btn:active { background: #eef4fa; }

/* ---------- 7天状态条 ---------- */
.week-strip { display: flex; gap: 6px; }
.day-cell {
  flex: 1; text-align: center; background: #f7f9fb; border-radius: 10px; padding: 7px 2px 5px;
}
.day-cell .d { font-size: 10px; color: #999; }
.day-cell .md { font-size: 12px; font-weight: 600; margin: 1px 0 3px; }
.day-cell .st { font-size: 14px; font-weight: 800; }
.day-cell.ok { background: #e6f5ec; }
.day-cell.ok .st { color: #2e9e5b; }
.day-cell.no { background: #fdecec; }
.day-cell.no .st { color: #d64545; }
.day-cell.today { box-shadow: inset 0 0 0 1.5px #1f4e79; }
.day-cell .st-txt { font-size: 10px; }

/* ---------- 数据导航 ---------- */
.nav-cards { display: flex; gap: 10px; }
.nav-card { flex: 1; background: #f7f9fb; border-radius: 12px; padding: 13px 6px; text-align: center; }
.nav-num { font-size: 24px; font-weight: 800; color: #1f4e79; line-height: 1.2; }
.nav-card.warn .nav-num { color: #d64545; }
.nav-label { font-size: 12px; color: #666; margin-top: 2px; }
.nav-list { margin-top: 10px; background: #f7f9fb; border-radius: 10px; padding: 10px 12px; }
.nav-list .list-title { font-size: 12px; font-weight: 700; color: #d64545; margin-bottom: 6px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #fff; border-radius: 14px; padding: 3px 10px; font-size: 12px; color: #555; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.chip.warn { background: #fdecec; color: #d64545; }
.chip.ok { background: #e6f5ec; color: #2e9e5b; }

/* 团队切换横向 chip 列表 */
.team-switch { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; margin: 6px 0 10px; scrollbar-width: none; }
.team-switch::-webkit-scrollbar { display: none; }
.ts-chip {
  flex-shrink: 0; padding: 6px 13px; border-radius: 16px;
  background: #fff; border: 1px solid #e0e6ec; font-size: 12px; color: #555; cursor: pointer;
  white-space: nowrap; transition: all .12s;
}
.ts-chip:active { background: #eef2f7; }
.ts-chip.active { background: #1f4e79; color: #fff; border-color: #1f4e79; font-weight: 600; }

/* 部门汇总(数据看板) */
.dept-block { margin-bottom: 8px; background: #f7f9fb; border-radius: 10px; padding: 10px 12px; }
.dept-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; }
.dept-head .cnt { font-size: 12px; color: #888; font-weight: 400; }
.dept-progress { height: 4px; background: #e0e6ec; border-radius: 2px; margin: 8px 0 6px; overflow: hidden; }
.dept-progress .fill { height: 100%; background: #2e9e5b; border-radius: 2px; }
.dept-miss { font-size: 12px; color: #d64545; }

/* ---------- 记录卡片 ---------- */
.rec-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(31,78,121,.06); }
.rec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rec-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.rec-meta { font-size: 12px; color: #999; }
.rec-date { font-size: 12px; color: #1f4e79; font-weight: 600; background: #eef4fa; padding: 2px 8px; border-radius: 10px; }
.sec-title { font-size: 12px; font-weight: 700; color: #1f4e79; margin: 10px 0 6px; }
.item-chip { background: #f7f9fb; border-radius: 8px; padding: 7px 10px; font-size: 13px; margin-bottom: 4px; display: flex; gap: 8px; }
.item-chip .no { color: #1f4e79; font-weight: 700; flex-shrink: 0; }
.remedy-tag {
  display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; margin: 2px 6px 2px 0;
}
.remedy-tag.ot { background: #eef4fa; color: #1f4e79; }
.remedy-tag.rp { background: #fdf3e0; color: #8a5a00; }
.empty-tip { text-align: center; color: #aaa; padding: 40px 0; font-size: 13px; }

/* 审批 */
.approve-box { background: #f7f9fb; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.approve-item { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.approve-item:last-child { margin-bottom: 0; }
.approve-item .who { font-weight: 600; color: #1f4e79; margin-bottom: 2px; }
.approve-item .time { font-size: 11px; color: #aaa; }
.approve-input { width: 100%; padding: 9px 10px; border: 1px solid #e0e6ec; border-radius: 8px; font-size: 13px; outline: none; background: #fff; }
.approve-input:focus { border-color: #1f4e79; }
.approve-submit { margin-top: 6px; display: inline-block; padding: 6px 16px; background: #1f4e79; color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; }
.approve-submit:active { background: #163a5c; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #1f4e79 0%, #1a4270 55%, #163a5c 100%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 34px 26px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.login-logo {
  width: 140px; height: 62px; border-radius: 14px; margin: 0 auto 16px;
  background: linear-gradient(135deg, #3b7bb8, #1f4e79);
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; font-weight: 800; color: #fff; letter-spacing: 3px;
}
.login-title { text-align: center; font-size: 20px; font-weight: 800; color: #1f4e79; }
.login-sub { text-align: center; font-size: 12px; color: #999; margin: 4px 0 24px; }
.login-tip { text-align: center; font-size: 12px; color: #aaa; margin-top: 16px; line-height: 1.6; }
.err-msg { background: #fdecec; color: #d64545; font-size: 13px; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; display: none; }
.err-msg.show { display: block; }

/* ---------- 搜索栏 ---------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search-bar .input { flex: 1; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* 日期范围快捷栏 */
.date-bar { display: flex; flex-direction: column; gap: 8px; }
.date-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.dp {
  padding: 7px 14px; border: 1px solid #e0e6ec; border-radius: 8px;
  background: #fff; color: #555; font-size: 13px; cursor: pointer;
  transition: all .12s; font-weight: 500;
}
.dp:active { background: #eef2f7; }
.dp.active { background: #1f4e79; color: #fff; border-color: #1f4e79; font-weight: 600; }
.date-custom { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.date-c {
  flex: 1; padding: 8px 10px; border: 1px solid #e0e6ec; border-radius: 8px;
  font-size: 13px; background: #fbfcfe; outline: none;
}
.date-c:focus { border-color: #1f4e79; background: #fff; }
.filter-bar .input, .filter-bar .select { flex: 1; min-width: 110px; }
.filter-bar .date-input { flex: 1.2; min-width: 130px; }

/* ---------- 后台管理 ---------- */
.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-tab { flex: 1; padding: 9px; border-radius: 10px; background: #eef2f7; color: #1f4e79; font-size: 13px; font-weight: 600; text-align: center; }
.sub-tab.active { background: #1f4e79; color: #fff; }
.upload-zone { border: 1.5px dashed #c6d2de; border-radius: 12px; padding: 18px; text-align: center; color: #888; font-size: 13px; margin-bottom: 10px; background: #fbfcfe; }
.upload-zone.active { border-color: #1f4e79; background: #eef4fa; color: #1f4e79; }
.upload-zone input[type=file] { display: none; }
.user-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #f0f3f6;
}
.user-row:last-child { border-bottom: none; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #eef2f7; color: #1f4e79;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.user-meta { font-size: 11px; color: #999; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; padding: 1px 7px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.tag.super { background: #fdecec; color: #d64545; }
.tag.gm { background: #efe9fb; color: #6b4bb8; }
.tag.manager { background: #eef4fa; color: #1f4e79; }
.tag.staff { background: #f0f3f6; color: #777; }
.tag.on { background: #e6f5ec; color: #2e9e5b; }
.tag.off { background: #f0f3f6; color: #999; }

/* 表格(访客中心) */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(31,78,121,.06); }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
table.list th { background: #f7f9fb; color: #666; font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; font-size: 12px; }
table.list td { padding: 10px 12px; border-top: 1px solid #f0f3f6; white-space: nowrap; }
table.list tr:first-child td { border-top: none; }

/* ---------- 底部 ---------- */
.footer { text-align: center; color: #bbb; font-size: 11px; padding: 20px 0 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(20,32,48,.5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: 100%; max-width: 340px; background: #fff; border-radius: 16px;
  padding: 22px 18px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-title { font-size: 16px; font-weight: 700; color: #1f4e79; margin-bottom: 4px; }
.modal-sub { font-size: 12px; color: #888; margin-bottom: 14px; }
.modal .input { margin-bottom: 10px; }
.modal-btns { display: flex; gap: 10px; margin-top: 12px; }
.modal-btns .btn { flex: 1; padding: 11px; font-size: 14px; }

/* 提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,78,121,.95); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 24px; z-index: 999; opacity: 0; pointer-events: none; transition: all .25s;
  max-width: 82%; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 加载 */
.loading { text-align: center; color: #999; padding: 30px 0; font-size: 13px; }

/* PC 端微调: 内容更宽舒适 */
@media (min-width: 768px) {
  .page { max-width: 760px; }
  .topbar-inner, .tabs { max-width: 760px; }
}
