*{box-sizing:border-box;margin:0;padding:0}
:root{
  --brand:#5B6ABF; --brand2:#7C6BD6; --brand-soft:#EEF0FB;
  --bg:#F6F7FB; --card:#FFFFFF; --line:#E7E9F3;
  --txt:#1F2233; --txt2:#6B7089; --txt3:#9CA1B8;
  --ok:#2E9E7A; --ok-bg:#E8F6F0;
  --warn:#C9821C; --warn-bg:#FDF3E3;
  --bad:#C4525B; --bad-bg:#FBECEE;
  --pink:#F3EAF6; --mint:#E7F4F1; --sky:#E9F0FB; --butter:#FCF3E2;
  --r:14px;
}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:var(--bg); color:var(--txt); font-size:14px; line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
button,input,select,textarea{font-family:inherit;font-size:14px;color:inherit;outline:none}
button{cursor:pointer;border:none;background:none}
a{color:var(--brand);text-decoration:none}

/* ---------- 登录 ---------- */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(1200px 600px at 20% 10%,#EEF0FC 0%,transparent 60%),
             radial-gradient(900px 500px at 85% 90%,#F4EDF8 0%,transparent 55%),var(--bg);padding:24px}
.login-card{width:380px;background:#fff;border:1px solid var(--line);border-radius:20px;
  padding:38px 34px 30px;box-shadow:0 18px 48px rgba(60,70,130,.10)}
.login-logo{width:46px;height:46px;border-radius:13px;background:linear-gradient(135deg,var(--brand),var(--brand2));
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:19px;
  margin-bottom:18px;box-shadow:0 6px 16px rgba(91,106,191,.28)}
.login-card h1{font-size:21px;font-weight:650;letter-spacing:.3px}
.login-card .sub{color:var(--txt2);font-size:13px;margin:6px 0 26px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;color:var(--txt2);margin-bottom:6px}
.field input,.field select{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;
  padding:0 13px;background:#FBFBFD;transition:.16s}
.field input:focus,.field select:focus{border-color:var(--brand);background:#fff;
  box-shadow:0 0 0 3px rgba(91,106,191,.10)}
.btn{height:42px;border-radius:10px;padding:0 18px;font-weight:550;transition:.16s;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.btn-primary{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;
  box-shadow:0 4px 14px rgba(91,106,191,.26)}
.btn-primary:hover{filter:brightness(1.06)}
.btn-primary:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
.btn-ghost{background:#fff;border:1px solid var(--line);color:var(--txt2)}
.btn-ghost:hover{border-color:#C9CEE6;color:var(--txt)}
.btn-sm{height:32px;padding:0 12px;font-size:13px;border-radius:8px}
.w-full{width:100%;margin-top:8px}
.err-msg{color:var(--bad);font-size:12.5px;margin-top:10px;min-height:18px}

/* ---------- 布局 ---------- */
.shell{display:flex;min-height:100vh}
.side{width:208px;background:#fff;border-right:1px solid var(--line);padding:20px 12px;
  display:flex;flex-direction:column;position:fixed;height:100vh;z-index:20}
.brand{display:flex;align-items:center;gap:9px;padding:0 8px 20px}
.brand .mark{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,var(--brand),var(--brand2));
  color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700}
.brand b{font-size:14.5px;font-weight:650;letter-spacing:.2px}
.nav{flex:1;display:flex;flex-direction:column;gap:2px}
.nav-item{display:flex;align-items:center;gap:9px;padding:9px 11px;border-radius:9px;
  color:var(--txt2);font-size:13.5px;cursor:pointer;transition:.14s}
.nav-item:hover{background:#F7F8FD;color:var(--txt)}
.nav-item.active{background:var(--brand-soft);color:var(--brand);font-weight:550}
.nav-item .ic{width:16px;text-align:center;font-size:14px;opacity:.85}
.nav-sep{height:1px;background:var(--line);margin:8px 10px}
.side-foot{padding:10px 10px 0;border-top:1px solid var(--line)}
.userbox{padding:10px 4px}
.userbox .nm{font-size:13px;font-weight:550}
.userbox .rl{font-size:11.5px;color:var(--txt3)}
.main{flex:1;margin-left:208px;padding:0 0 40px;min-width:0}

/* ---------- 顶栏 ---------- */
.topbar{background:rgba(255,255,255,.86);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);
  padding:16px 28px;display:flex;align-items:center;justify-content:space-between;
  position:sticky;top:0;z-index:10}
.topbar h2{font-size:17px;font-weight:620}
.topbar .desc{font-size:12.5px;color:var(--txt3);margin-top:2px}
.top-actions{display:flex;align-items:center;gap:10px}
.wrap{padding:22px 28px 0;max-width:1560px}

/* ---------- 卡片 / 统计 ---------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px;margin-bottom:18px}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:15px 16px;position:relative;overflow:hidden}
.stat .lb{font-size:12.5px;color:var(--txt2);display:flex;align-items:center;gap:6px}
.stat .vl{font-size:25px;font-weight:670;letter-spacing:-.4px;margin-top:6px;line-height:1.2}
.stat .ft{font-size:11.5px;color:var(--txt3);margin-top:3px}
.stat::after{content:"";position:absolute;right:-18px;top:-18px;width:56px;height:56px;border-radius:50%;background:var(--brand-soft);opacity:.55}
.stat.p .vl{color:var(--brand)} .stat.p::after{background:var(--pink)}
.stat.g .vl{color:var(--ok)}    .stat.g::after{background:var(--mint)}
.stat.y .vl{color:var(--warn)}  .stat.y::after{background:var(--butter)}
.stat.b .vl{color:var(--bad)}   .stat.b::after{background:var(--bad-bg)}

.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;margin-bottom:18px}
.card-hd{padding:14px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;gap:12px;flex-wrap:wrap}
.card-hd h3{font-size:14.5px;font-weight:600;display:flex;align-items:center;gap:7px}
.card-hd .hint{font-size:12px;color:var(--txt3);font-weight:400}
.card-bd{padding:0}
.card-bd.pad{padding:16px 18px}

/* ---------- 表格 ---------- */
.tbl-scroll{overflow-x:auto}
/* 列宽拖动手柄（表头 th 已是 position:sticky，可作为定位基准） */
.col-grip{position:absolute;top:0;right:-3px;width:8px;height:100%;cursor:col-resize;z-index:5}
.col-grip::after{content:'';position:absolute;top:22%;bottom:22%;left:3px;width:2px;background:transparent;border-radius:2px}
thead th:hover>.col-grip::after,.col-grip.active::after{background:#AEBBE4}
/* 逐张明细表：固定布局+不换行，列宽完全由表头拖动控制 */
.tbl-wide td{white-space:nowrap;overflow:hidden;padding-left:8px;padding-right:8px}
/* 内层明细表头要盖过外层 sticky 表头，否则拖动手柄会被挡住点不到 */
.sub thead th{z-index:5}
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{background:#FAFBFE;color:var(--txt2);font-weight:550;text-align:left;
  padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap;font-size:12.5px;
  position:sticky;top:0;z-index:2}
tbody td{padding:9px 12px;border-bottom:1px solid #F1F2F8;vertical-align:middle}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#FCFCFF}
tbody tr.sub{background:#FAFBFF}
tbody tr.sub:hover{background:#F7F9FF}
.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--txt2)}
.goods{font-weight:550;max-width:260px}
.tag{display:inline-block;padding:2px 8px;border-radius:6px;font-size:11.5px;line-height:1.7;white-space:nowrap}
.tag.ok{background:var(--ok-bg);color:var(--ok)}
.tag.wait{background:var(--warn-bg);color:var(--warn)}
.tag.off{background:#F2F3F7;color:var(--txt3)}
.tag.bad{background:var(--bad-bg);color:var(--bad)}
.tag.info{background:var(--sky);color:#4A6BB5}
.tag.pink{background:var(--pink);color:#8B5FA8}

/* 行内填报控件 */
.inp{height:30px;border:1px solid var(--line);border-radius:7px;padding:0 9px;background:#fff;
  width:100%;transition:.14s;font-size:13px}
.inp:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(91,106,191,.09)}
.inp.money{width:104px;text-align:right;font-variant-numeric:tabular-nums}
.inp-note{width:150px}
select.inp{width:104px;padding-right:22px;appearance:none;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A6ABC2'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 8px center}
.inp.other{width:104px}
.cell-fill{display:flex;align-items:center;gap:6px}
.save-dot{width:6px;height:6px;border-radius:50%;background:transparent;flex:0 0 auto}
.save-dot.dirty{background:var(--warn)}
.save-dot.saved{background:var(--ok)}
.btn-exp{border:1px solid var(--line);background:#fff;border-radius:7px;height:27px;padding:0 9px;
  font-size:12px;color:var(--txt2)}
.btn-exp:hover{border-color:#C9CEE6;color:var(--brand)}

/* ---------- 工具条 ---------- */
.toolbar{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.toolbar .sp{flex:1}
.search{height:34px;border:1px solid var(--line);border-radius:9px;padding:0 12px;background:#fff;width:220px}
.search:focus{border-color:var(--brand)}
select.filter{height:34px;border:1px solid var(--line);border-radius:9px;padding:0 30px 0 11px;background:#fff;
  appearance:none;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A6ABC2'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;min-width:130px}
.chk{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--txt2);cursor:pointer}
.chk input{accent-color:var(--brand)}

/* 进度条 */
.bar{height:6px;border-radius:4px;background:#EFF1F8;overflow:hidden;min-width:70px}
.bar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--brand),var(--brand2))}
.bar.low i{background:linear-gradient(90deg,#E0A24A,#D9843C)}
.bar.zero i{background:#DDE0EC}

/* 提示 */
.toast{position:fixed;left:50%;bottom:34px;transform:translateX(-50%) translateY(20px);
  background:#252A3E;color:#fff;padding:10px 20px;border-radius:10px;font-size:13px;
  opacity:0;pointer-events:none;transition:.22s;z-index:999;box-shadow:0 10px 30px rgba(0,0,0,.18)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.bad{background:#A63F48}
.empty{padding:44px 20px;text-align:center;color:var(--txt3);font-size:13px}
.loading{padding:40px;text-align:center;color:var(--txt3);font-size:13px}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:16px;overflow-x:auto}
.tab{padding:9px 15px;font-size:13.5px;color:var(--txt2);cursor:pointer;border-bottom:2px solid transparent;
  white-space:nowrap;transition:.14s}
.tab:hover{color:var(--txt)}
.tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:550}
.pager{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 16px;
  border-top:1px solid var(--line);font-size:12.5px;color:var(--txt2)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--txt2);padding:10px 18px;
  background:#FAFBFE;border-bottom:1px solid var(--line)}
.legend span{display:inline-flex;align-items:center;gap:5px}
.dot{width:7px;height:7px;border-radius:50%}
.kpi-row{display:flex;gap:22px;flex-wrap:wrap;padding:14px 18px;background:#FBFBFE;border-bottom:1px solid var(--line)}
.kpi{font-size:12.5px;color:var(--txt2)}
.kpi b{display:block;font-size:17px;color:var(--txt);font-weight:640;margin-top:1px}
@media(max-width:900px){
  .side{width:64px;padding:16px 8px}
  .brand b,.nav-item span:not(.ic),.userbox{display:none}
  .main{margin-left:64px}
  .wrap{padding:16px}
  .topbar{padding:12px 16px}
}

/* ---- 修改密码弹窗 ---- */
#pwd-mask{position:fixed;inset:0;background:rgba(38,50,63,.45);z-index:200;
  display:flex;align-items:center;justify-content:center}
.pwd-modal{background:#fff;border-radius:14px;padding:26px 26px 20px;width:min(360px,92vw);
  box-shadow:0 18px 50px rgba(31,45,61,.25)}
.pwd-modal h3{margin:0 0 10px;font-size:17px;color:var(--txt)}
.pwd-tip{font-size:12.5px;color:#A63F48;background:#FBEDEE;border-radius:8px;
  padding:8px 12px;margin-bottom:12px}
.pwd-modal .field{margin-top:10px}
.pwd-btns{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}

/* ---- 新订单提醒条（醒目版）---- */
.alert-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  border-radius:14px;padding:14px 18px;margin-bottom:16px}
.alert-hot{background:linear-gradient(100deg,#FFF2F3 0%,#FFF7F2 60%,#FFFDFA 100%);
  border:1px solid #F2C6CB;border-left:6px solid var(--bad);
  box-shadow:0 8px 24px rgba(196,82,91,.14)}
.alert-quiet{background:#fff;border:1px solid var(--line);border-left:6px solid #DDE1EC;color:var(--txt2)}
.alert-main{display:flex;align-items:center;gap:12px;min-width:0}
.alert-ico{width:42px;height:42px;border-radius:13px;flex:0 0 auto;
  background:var(--bad);color:#fff;display:flex;align-items:center;justify-content:center;
  font-size:20px;box-shadow:0 5px 14px rgba(196,82,91,.32);
  animation:alertPulse 1.7s ease-in-out infinite}
.alert-ico.quiet{background:#EDEFF7;color:#99A1B9;box-shadow:none;animation:none;font-size:17px}
@keyframes alertPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}
.alert-title{font-size:16.5px;font-weight:650;color:#A5383F;letter-spacing:.2px;line-height:1.35}
.alert-title em{font-style:normal;font-size:24px;font-weight:750;color:var(--bad);margin:0 3px;
  font-variant-numeric:tabular-nums}
.alert-title.quiet{font-size:14.5px;color:var(--txt2);font-weight:550}
.alert-sub{font-size:12.5px;color:#AE6A6E;margin-top:2px}
.alert-act{display:flex;gap:8px;align-items:center;margin-left:auto}
.btn-danger{background:var(--bad);color:#fff;box-shadow:0 6px 16px rgba(196,82,91,.28)}
.btn-danger:hover{background:#B2464E}
.alert-week{font-size:13px;color:var(--txt2);white-space:nowrap}
.alert-week b{font-size:17px;color:var(--brand);margin:0 3px;font-variant-numeric:tabular-nums}
@media(max-width:900px){.alert-act{margin-left:0}.alert-week{width:100%}}

/* 总部催办提醒条（门店端） */
.alert-warn{background:linear-gradient(100deg,#FFF8E8 0%,#FFFBF2 60%,#FFFEFB 100%);
  border:1px solid #F0DBAE;border-left:6px solid #E8A93A;
  box-shadow:0 8px 24px rgba(200,150,50,.14)}
.alert-done{background:linear-gradient(100deg,#EEF9F2 0%,#F7FCF9 60%,#FDFEFE 100%);
  border:1px solid #C8E6D5;border-left:6px solid #4FA97B}
.alert-ico.warn{background:#E8A93A;box-shadow:0 5px 14px rgba(200,150,50,.30);
  animation:alertPulse 2.2s ease-in-out infinite;font-size:19px}
.alert-ico.done{background:#4FA97B;box-shadow:0 5px 14px rgba(79,169,123,.28);
  animation:none;font-size:18px}
.alert-title.warn{color:#9A6A16}
.alert-title.warn em{color:#C98A1E}
.alert-title.done{color:#2F7A55;font-size:15px;font-weight:600}
.btn-warn{background:#E8A93A;color:#fff;box-shadow:0 6px 16px rgba(200,150,50,.28)}
.btn-warn:hover{background:#D69B2C}

/* 饼图（券卡统计 / 订单状态） */
.charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:16px;margin-bottom:18px}
.charts .card{margin-bottom:0}
.pie-wrap{display:flex;align-items:center;gap:20px;padding:16px 18px;flex-wrap:wrap}
.pie-wrap svg{flex:0 0 auto}
.pie-legend{flex:1;min-width:170px;display:flex;flex-direction:column;gap:7px}
.pie-li{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--txt2)}
.pie-li .dot{width:8px;height:8px;flex:0 0 auto}
.pie-nm{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pie-ct{color:var(--txt);font-weight:550;font-variant-numeric:tabular-nums}
.pie-pc{width:50px;text-align:right;color:var(--txt3);font-variant-numeric:tabular-nums}

/* ---- 填报催办 ---- */
.fill-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pend-row>td{background:#FAFBFE;padding:10px 14px 12px}
.pend-box{display:flex;flex-wrap:wrap;gap:8px}
.pend-chip{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--txt2);
  background:#fff;border:1px solid var(--line);border-radius:999px;padding:4px 11px}
.pend-chip b{color:var(--warn);font-weight:650;font-variant-numeric:tabular-nums}
#remind-mask{position:fixed;inset:0;background:rgba(38,50,63,.45);z-index:210;
  display:flex;align-items:center;justify-content:center;padding:20px}
.remind-modal{background:#fff;border-radius:14px;padding:22px 22px 16px;width:min(600px,94vw);
  max-height:86vh;display:flex;flex-direction:column;box-shadow:0 18px 50px rgba(31,45,61,.25)}
.remind-modal h3{margin:0 0 8px;font-size:16.5px;color:var(--txt)}
.rm-tip{font-size:12.5px;color:var(--txt2);margin-bottom:10px}
.remind-modal textarea{width:100%;flex:1;min-height:250px;border:1px solid var(--line);border-radius:10px;
  padding:12px 14px;font-size:13px;line-height:1.75;color:var(--txt);resize:vertical;background:#FBFCFE}
.rm-meta{font-size:12px;color:var(--txt3);margin-top:8px}
.remind-btns{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}

/* 已锁定的填报字段（首次填报后不可改） */
.inp[readonly]{background:#F5F6FA;color:#6B7089;cursor:not-allowed}
