:root{--green:#1a4d2e;--green-mid:#2d6e47;--gold:#c9962a;--gold-light:#f0c96e;--bg:#f5f9f6;--card:#fff;--border:#d4e8d8;--text:#1a1a1a;--mid:#555;--wb-home-section-gap:18px;}
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'PingFang SC','Microsoft YaHei',sans-serif;background:var(--bg);color:var(--text);min-height:100vh;padding-bottom:env(safe-area-inset-bottom,0px);}

/* ── login ── */
.login-wrap{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px;}
.login-box{background:var(--card);border-radius:20px;padding:40px 36px;max-width:380px;width:100%;box-shadow:0 8px 40px rgba(26,77,46,.12);}
.login-logo{text-align:center;margin-bottom:24px;}
.login-logo .ico{font-size:52px;}
.login-logo h1{font-size:22px;font-weight:800;color:var(--green);margin-top:8px;}
.login-logo p{font-size:13px;color:#888;margin-top:4px;}
.lb{display:block;font-size:13px;font-weight:600;color:var(--green);margin-bottom:6px;}
.li{width:100%;padding:13px 16px;border:1.5px solid var(--border);border-radius:10px;font-size:16px;font-family:inherit;outline:none;transition:.2s;background:#fafcfa;}
.li:focus{border-color:var(--green);}
.key-wrap{position:relative;}
.key-wrap .li{padding-right:48px;}
.eye-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:44px;height:44px;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;font-size:18px;color:#888;padding:0;-webkit-tap-highlight-color:transparent;}
.err{color:#e74c3c;font-size:13px;min-height:20px;margin-top:6px;}
.btn-login{width:100%;min-height:48px;padding:14px 20px;background:var(--green);color:#fff;border:none;border-radius:10px;font-size:16px;font-weight:700;cursor:pointer;transition:.2s;margin-top:8px;touch-action:manipulation;-webkit-tap-highlight-color:transparent;display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-user-select:none;user-select:none;}
.btn-login:hover{background:var(--green-mid);}
.btn-login:active{opacity:.95;}
.back-link{text-align:center;margin-top:16px;font-size:13px;color:#888;}
.back-link a{color:var(--green);text-decoration:none;}

/* 只读账号提示 */
.wb-readonly-banner{background:#fff8e6;border-bottom:1px solid #f0d78c;color:#8d6b00;font-size:13px;line-height:1.5;padding:10px 16px;text-align:center;}
body.wb-role-viewer .wb-write-only{display:none!important;}
body.wb-role-viewer .wb-finance-only{display:none!important;}

/* ── app ── */
.app{display:none;min-height:100vh;flex-direction:column;}
.hdr{background:var(--green);color:#fff;padding:0 20px;padding-top:max(0px, env(safe-area-inset-top));min-height:56px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:100;box-shadow:0 2px 12px rgba(0,0,0,.15);}
/* 顶栏 2.0：与 mobile-unified 的 .wb-hdr 配合，避免旧 .hdr 单行 flex 压扁双行结构 */
.wb-hdr{display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:auto;padding-left:0;padding-right:0;padding-top:max(0px, env(safe-area-inset-top));}
@media(min-width:769px){
  .wb-hdr{flex-direction:row;flex-wrap:wrap;align-items:center;min-height:56px;padding:0 20px;padding-top:max(0px, env(safe-area-inset-top));}
}
.hdr-logo{font-size:20px;font-weight:800;flex:1;}
.hdr-user{font-size:13px;opacity:.8;}
.hdr-btn{background:rgba(255,255,255,.15);border:none;color:#fff;padding:7px 14px;min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:20px;font-size:13px;cursor:pointer;transition:.2s;box-sizing:border-box;}
.hdr-btn:hover{background:rgba(255,255,255,.25);}
.msg-center-drop{display:flex;flex-direction:column;}
.msg-tab{padding:6px 10px;border:none;background:#f0f0f0;border-radius:6px;font-size:12px;cursor:pointer;color:#555;}
.msg-tab.active{background:var(--green);color:#fff;}
.msg-tab:hover:not(.active){background:#e5e5e5;}
.loading-skeleton{padding:24px;}
.skeleton-line,.skeleton-block{background:linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);background-size:200% 100%;animation:skeleton 1.2s ease-in-out infinite;}
.skeleton-line{height:14px;border-radius:4px;}
.skeleton-block{border-radius:12px;}
@keyframes skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}
.empty-state{text-align:center;padding:48px 24px;color:#888;}
.empty-state-icon{font-size:48px;margin-bottom:12px;opacity:.7;}
.empty-state-title{font-size:16px;font-weight:600;color:#555;}
.empty-state-desc{font-size:13px;margin-top:8px;max-width:320px;margin-left:auto;margin-right:auto;}
.tabs{display:flex;background:#fff;border-bottom:2px solid var(--border);padding:0 20px;}
.tab{padding:14px 20px;min-height:44px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;cursor:pointer;border-bottom:3px solid transparent;color:#888;transition:.2s;white-space:nowrap;box-sizing:border-box;-webkit-user-select:none;user-select:none;}
.tab.active{color:var(--green);border-bottom-color:var(--green);}
.tab.tab-hidden{display:none !important;}
.content{flex:1;padding:16px 20px;max-width:min(100%,1360px);margin:0 auto;width:100%;}
.wb-dash-alert-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:10px;margin-top:4px;}
.wb-dash-alert-item{border-radius:12px;padding:12px 14px;background:#fafcfa;border:1px solid var(--border);cursor:pointer;text-align:left;transition:box-shadow .2s,background .2s;}
.wb-dash-alert-item:hover{box-shadow:0 2px 12px rgba(26,77,46,.08);background:#fff;}
.wb-dash-alert-item .wb-dt{font-size:12px;color:#666;font-weight:600;}
.wb-dash-alert-item .wb-dn{font-size:22px;font-weight:900;color:var(--green);margin-top:4px;}
.wb-dash-alert-item.warn{border-color:#e8c99a;background:linear-gradient(135deg,#fffdf8,#fff);}
.wb-dash-alert-item.warn .wb-dn{color:#b8860b;}
.wb-dash-alert-item.danger{border-color:#f5c6c6;background:linear-gradient(135deg,#fff8f8,#fff);}
.wb-dash-alert-item.danger .wb-dn{color:#c0392b;}
.wb-dash-today-list{font-size:13px;color:#444;line-height:1.55;}
.wb-dash-today-list li{margin:4px 0;}
.home-bento{margin-top:4px;}
.home-bento > .home-stats-row,
.home-bento > .home-shortcuts{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  width:100%;
}
@media(min-width:900px){
  .home-bento > .home-stats-row{ grid-template-columns:repeat(5,minmax(0,1fr)); }
  .home-bento > .home-shortcuts:not(.home-shortcuts-limited){ grid-template-columns:repeat(5,minmax(0,1fr)); }
}
.home-bento > .home-stats-row{ margin-bottom: 0; }
.home-bento > .home-shortcuts{ margin-top: 0; }
.home-bento .home-shortcut-card{margin-bottom:0;}
/* 与「顶部统计 → 快捷入口标题」同一垂直间距：快捷入口区块下方 → 数据看板 */
.home-bento .subsec-row{font-size:14px;font-weight:800;color:var(--green);margin:var(--wb-home-section-gap) 0 8px;padding-left:2px;}
.card.home-dashboard-card{margin-top:var(--wb-home-section-gap);}

/* ── 手机端：与电脑同一套页面，进入各 Tab 时重新请求接口，后台保存后刷新即可同步 ── */
@media (max-width:768px){
  .tabs{overflow-x:auto;-webkit-overflow-scrolling:touch;flex-wrap:nowrap;padding:0 6px;gap:0;scrollbar-width:none;}
  .tabs::-webkit-scrollbar{display:none;}
  .tab{flex-shrink:0;padding:11px 12px;font-size:12.5px;}
  .hdr{padding:8px 10px;height:auto;min-height:52px;flex-wrap:wrap;row-gap:6px;align-items:center;}
  .hdr-logo{font-size:15px;font-weight:800;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;}
  .hdr > div[style*="display:flex"]{flex-wrap:wrap;justify-content:flex-end;gap:6px;}
  .hdr-btn{font-size:12px;padding:6px 10px;min-height:40px;min-width:auto;}
  #msgCenterDrop{max-width:min(360px,calc(100vw - 24px))!important;width:min(360px,calc(100vw - 24px))!important;}
  .content{padding:12px 10px;max-width:100%;}
  .login-wrap{padding:12px;align-items:flex-start;padding-top:max(24px, env(safe-area-inset-top));}
  .login-box{padding:28px 20px;border-radius:16px;max-width:100%;}
  .msg-center-drop{right:0 !important;left:auto !important;width:min(calc(100vw - 16px), 360px) !important;max-height:min(72vh, 440px) !important;}
  .drawer{padding:18px 14px;max-height:90vh;border-radius:16px 16px 0 0;}
  .ph{flex-wrap:wrap;gap:8px;}
  .grid2.wb-sum-filters{grid-template-columns:1fr;}
  .cal-table{font-size:11px;}
  .cal-cell{min-height:64px;padding:4px;}
  .grid2{grid-template-columns:1fr;}
  .drawer{max-width:100%;padding-left:max(14px, env(safe-area-inset-left));padding-right:max(14px, env(safe-area-inset-right));padding-bottom:max(22px, env(safe-area-inset-bottom));}
  .drawer-title-toolbar{width:100%;margin-left:0;margin-top:8px;justify-content:flex-start;flex-wrap:wrap;overflow-x:visible;}
  .tbl,.data-table{font-size:12px;}
  .tbl th,.tbl td,.data-table th,.data-table td{padding:8px 9px;}
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .chart-grid,.report-grid{grid-template-columns:1fr;}
  .focus-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .insight-grid{grid-template-columns:1fr;}
  .filter-bar .fi{min-width:0;flex:1 1 110px;}
  .dr-footer{flex-wrap:wrap;justify-content:stretch;}
  .dr-footer .btn{flex:1 1 auto;min-width:0;}
  .stats-row,.home-stats-row{grid-template-columns:repeat(2,minmax(0,1fr));}
}
/* 平板宽度：客户抽屉内双栏与 360 跟进/购买区改为单列，避免挤压 */
@media(max-width:900px){
  .report-grid{grid-template-columns:1fr!important;}
  #drawerContent.drawer{max-width:100%!important;width:100%!important;}
  .wb-cust-summary-blk .wb-cust-info-grid{grid-template-columns:1fr!important;}
  .portrait-tags label{display:flex!important;align-items:center;margin-bottom:8px!important;margin-right:0!important;}
}

/* ── cards ── */
.card{background:var(--card);border-radius:14px;padding:16px;margin-bottom:14px;box-shadow:0 1px 8px rgba(0,0,0,.06);}
.card,.stat-card,.home-shortcut-card,.drawer,.sf-stat,.report-card{border:1px solid rgba(26,77,46,.1);box-shadow:0 1px 0 rgba(255,255,255,.86) inset,0 14px 36px rgba(26,77,46,.08);}
.btn,.hdr-btn,.btn-login{border-radius:999px;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;}
.fi,.li,select.fi,textarea.fi{border-radius:12px;border-color:#cfe1d5;background:#fbfdfb;}
.fi:focus,.li:focus,select.fi:focus,textarea.fi:focus{outline:2px solid rgba(201,150,42,.22);outline-offset:1px;border-color:#2d7a4e;background:#fff;}
.sf-table th,.sf-table td,.data-table th,.data-table td{vertical-align:middle;}
.ph{display:flex;align-items:center;gap:12px;margin-bottom:14px;}
.pt{font-size:18px;font-weight:800;color:var(--green);flex:1;}
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px;}
.home-stats-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px;}
.stat-card{background:var(--card);border-radius:12px;padding:14px;text-align:center;box-shadow:0 1px 6px rgba(0,0,0,.06);min-height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;}
.stat-num{font-size:28px;font-weight:900;color:var(--green);}
.stat-label{font-size:12px;color:#888;margin-top:4px;}
.home-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;width:100%;margin-top:14px;align-items:stretch;}
.home-shortcut-card{cursor:pointer;text-align:center;padding:20px;margin-bottom:0;min-height:110px;display:flex;flex-direction:column;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;transition:background .2s,box-shadow .2s;}
.home-shortcut-card:hover{background:#f8fcf9;box-shadow:0 2px 12px rgba(26,77,46,.08);}
.home-shortcut-card:active{background:#eef8f1;}
.home-shortcut-icon{font-size:36px;line-height:1;}
.home-shortcut-title{font-size:16px;font-weight:700;color:var(--green);margin-top:8px;}
.home-shortcut-desc{font-size:12px;color:#888;margin-top:4px;line-height:1.6;}
#wbHomeExecShortcuts.wb-home-exec--edit .wb-home-exec-editbar{display:flex!important;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:10px}
#wbHomeExecShortcuts.wb-home-exec--edit .home-shortcut-card{outline:2px dashed rgba(45,122,78,.45);position:relative}
.wb-home-exec-editbar{display:none}
.wb-home-exec-editbar .btn{min-height:36px;font-size:11px;padding:6px 8px}
.wb-pay-hub-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}
.wb-pay-hub-stat{background:#f4faf6;border:1px solid #dceee1;border-radius:10px;padding:10px 12px;text-align:center}
.wb-pay-hub-stat .n{font-size:22px;font-weight:800;color:#1a4d2e}
.wb-pay-hub-stat .l{font-size:11px;color:#666;margin-top:4px}
.wb-pay-hub-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.wb-pay-hub-card{background:linear-gradient(180deg,#fafdfb 0%,#fff 100%)}
@media(max-width:640px){.wb-pay-hub-grid{grid-template-columns:1fr}}
.wb-coop-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap}
.wb-coop-acc-head td{border-top:2px solid #dceee1}
.wb-coop-chevron{display:inline-block;width:14px;color:var(--green);font-size:10px}
.wb-coop-acc-table .wb-coop-grower-row td{background:#fafdfb}
@media(max-width:640px){.wb-coop-acc-table{font-size:11px}.wb-coop-acc-head td,.wb-coop-grower-row td{padding:6px 4px}}
.wb-health-card{position:relative;overflow:hidden;border:1px solid rgba(26,77,46,.16);background:linear-gradient(135deg,#ffffff 0%,#f6fbf7 52%,#eef8f2 100%);}
.wb-health-card:before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,var(--green),#2d7a4e,var(--gold));}
.wb-health-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.wb-health-title{font-size:18px;font-weight:900;color:var(--green);line-height:1.3;}
.wb-health-sub{font-size:12px;color:#6a7d70;margin-top:4px;line-height:1.55;}
.wb-health-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:12px 0;}
.wb-health-kpi{border:1px solid #d9eadf;background:rgba(255,255,255,.82);border-radius:12px;padding:12px 10px;min-height:74px;box-shadow:0 8px 22px rgba(26,77,46,.06);}
.wb-health-kpi .n{font-size:23px;font-weight:900;color:#133f27;line-height:1.1;font-variant-numeric:tabular-nums;}
.wb-health-kpi .l{font-size:12px;color:#607267;margin-top:7px;line-height:1.35;}
.wb-health-kpi .m{font-size:11px;color:#8a9a90;margin-top:4px;line-height:1.35;}
.wb-health-body{display:grid;grid-template-columns:1.1fr 1fr 1.15fr;gap:12px;align-items:stretch;}
.wb-health-panel{border:1px solid #dbeae0;background:rgba(255,255,255,.74);border-radius:12px;padding:12px;min-width:0;}
.wb-health-panel h4{margin:0 0 8px;font-size:14px;color:var(--green);}
.wb-health-risk{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border:1px solid #e5efe8;border-radius:10px;background:#fff;margin-bottom:7px;cursor:pointer;transition:transform .18s,box-shadow .18s,border-color .18s;}
.wb-health-risk:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(26,77,46,.1);border-color:#c9dfcf;}
.wb-health-risk b{font-size:13px;color:#263b2d;}
.wb-health-risk span{font-size:12px;color:#788a80;}
.wb-health-risk .v{font-size:18px;font-weight:900;color:var(--green);}
.wb-health-risk.high .v{color:#c2410c;}
.wb-health-risk.medium .v{color:#b7791f;}
.wb-health-risk-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.wb-health-risk-actions .btn{min-height:28px;padding:4px 9px;font-size:11px;}
.wb-health-list{margin:0;padding-left:18px;color:#53665b;font-size:12px;line-height:1.8;}
.wb-health-recent{display:flex;flex-direction:column;gap:7px;max-height:230px;overflow:auto;padding-right:2px;}
.wb-health-recent-item{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;border-bottom:1px dashed #dfeae2;padding-bottom:7px;font-size:12px;color:#53665b;}
.wb-health-recent-item .product-inline-link,.wb-event-row .product-inline-link{color:#1a4d2e;font-weight:700;text-decoration:none;border-bottom:1px dashed rgba(26,77,46,.35);}
.wb-health-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#e8f5ec;color:#1a4d2e;border:1px solid #cbe4d2;font-size:11px;font-weight:800;padding:3px 7px;white-space:nowrap;}
.wb-health-time{font-size:11px;color:#8c9d92;white-space:nowrap;}
.wb-health-empty{font-size:12px;color:#8a9a90;background:#f8fbf8;border:1px dashed #dbe8df;border-radius:10px;padding:10px;}
.wb-events-list{display:flex;flex-direction:column;gap:8px;max-height:68vh;overflow:auto;padding-right:4px;}
.wb-event-row{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;border:1px solid #dfeae2;border-radius:12px;background:#fff;padding:10px 12px;}
.wb-event-row b{color:#243b2c;font-size:13px;}
.wb-event-row p{margin:3px 0 0;color:#708177;font-size:12px;line-height:1.55;}
@media(max-width:1120px){.wb-health-grid{grid-template-columns:repeat(3,minmax(0,1fr));}.wb-health-body{grid-template-columns:1fr;}}
@media(max-width:620px){.wb-health-head{display:block}.wb-health-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.wb-health-kpi{min-height:68px}.wb-health-kpi .n{font-size:20px}.wb-health-recent-item{grid-template-columns:auto 1fr}.wb-health-time{grid-column:2}}
@media(max-width:520px){.home-stats-row,.stats-row{grid-template-columns:repeat(2,1fr);}.home-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));}.home-bento>.home-stats-row,.home-bento>.home-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));}.home-shortcut-card{min-height:96px;padding:16px 14px;}.stat-card{min-height:68px;}}
.home-shortcuts-limited{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%;margin:0;align-items:stretch}
@media(min-width:721px){
  .home-bento > .home-shortcuts.home-shortcuts-limited{grid-template-columns:repeat(6,minmax(0,1fr));}
}
@media(max-width:720px){
  .home-bento > .home-shortcuts.home-shortcuts-limited{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:520px){.home-shortcuts-limited{grid-template-columns:repeat(2,minmax(0,1fr));}.home-bento > .home-shortcuts.home-shortcuts-limited{grid-template-columns:repeat(2,minmax(0,1fr));}}
.wh-quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%;align-items:stretch;padding:2px 0;}
@media(max-width:520px){.wh-quick-actions{grid-template-columns:1fr;}}
.wh-quick-actions .wh-qa-head{grid-column:1/-1;font-size:12px;font-weight:700;color:#4a6352;margin:0 0 2px;letter-spacing:.02em;}
.wh-quick-actions .wh-qa-sub{grid-column:1/-1;font-size:11px;color:#7a8b82;margin:-2px 0 4px;line-height:1.45;}
.wh-quick-actions .wh-qa-gap{grid-column:1/-1;height:1px;background:linear-gradient(90deg,transparent,#d4e8d8,transparent);margin:2px 0 4px;}
.wh-act-core{background:var(--green);color:#fff;border:none;}
.wh-act-core:hover{background:var(--green-mid);}
.wh-act-aux{background:linear-gradient(180deg,#d4a84a,#c9962a);color:#fff;border:none;box-shadow:0 1px 0 rgba(255,255,255,.2) inset;}
.wh-act-aux:hover{filter:brightness(1.05);}
.wh-act-neutral{background:#f3f6f4;color:#2e4036;border:1px solid #cfd8d3;}
.wh-act-neutral:hover{background:#e8eeea;}
.wh-act-export{background:#f7faf8;color:#1a4d2e;border:1.5px solid #c5dcc9;}
.wh-act-export:hover{background:#eef6f0;}
.wh-quick-actions .btn{font-weight:600;padding:10px 12px;font-size:13px;border-radius:10px;min-height:42px;}
.wh-warehouse-table-wrap,.wh-table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-top:2px;box-sizing:border-box}
.wh-warehouse-table-wrap .data-table.wh-wide:not(.wh-txn-ledger)>thead>tr>th,
.wh-warehouse-table-wrap .data-table.wh-wide:not(.wh-txn-ledger)>tbody>tr>td{
  word-break:break-word;overflow-wrap:break-word;white-space:normal;vertical-align:middle;box-sizing:border-box;overflow-x:hidden
}
.wh-table-scroll .data-table>thead>tr>th,
.wh-table-scroll .data-table>tbody>tr>td{
  word-break:break-word;overflow-wrap:break-word;white-space:normal;vertical-align:middle;box-sizing:border-box;overflow-x:hidden
}
.data-table.wh-wide th,.data-table.wh-wide td{padding:8px 11px;font-size:12px;vertical-align:middle}
.data-table.wh-wide th{background:#eaf5ee;color:#1a4d2e;font-weight:700}
/* 流水台账：单元格在列宽内折行，禁止横向撑破；数量行用 <br> 保留两行结构 */
.data-table.wh-txn-ledger{min-width:720px;width:100%;max-width:100%;border-collapse:separate;border-spacing:0;table-layout:auto}
.data-table.wh-txn-ledger th,.data-table.wh-txn-ledger td{
  padding:10px 10px;border-bottom:1px solid #eceff0;
  word-break:break-word;overflow-wrap:break-word;white-space:normal;vertical-align:middle;box-sizing:border-box;overflow-x:hidden
}
.data-table.wh-txn-ledger thead th:nth-child(1),.data-table.wh-txn-ledger tbody td:nth-child(1){width:2.25rem;min-width:2.25rem;max-width:2.5rem;text-align:center}
.data-table.wh-txn-ledger thead th:nth-child(2),.data-table.wh-txn-ledger tbody td:nth-child(2){min-width:5.5rem;max-width:7rem;font-variant-numeric:tabular-nums}
.data-table.wh-txn-ledger thead th:nth-child(3),.data-table.wh-txn-ledger tbody td:nth-child(3){min-width:6.5rem;max-width:9rem}
.data-table.wh-txn-ledger thead th:nth-child(4),.data-table.wh-txn-ledger tbody td:nth-child(4){min-width:8rem;max-width:14rem}
.data-table.wh-txn-ledger thead th:nth-child(5),.data-table.wh-txn-ledger tbody td:nth-child(5),
.data-table.wh-txn-ledger thead th:nth-child(6),.data-table.wh-txn-ledger tbody td:nth-child(6){min-width:5.5rem;max-width:8rem;text-align:right}
.data-table.wh-txn-ledger thead th:nth-child(7),.data-table.wh-txn-ledger tbody td:nth-child(7){min-width:5.5rem;max-width:8rem;text-align:right}
.data-table.wh-txn-ledger thead th:nth-child(8),.data-table.wh-txn-ledger tbody td:nth-child(8){min-width:5rem;max-width:8.5rem}
.data-table.wh-txn-ledger thead th:nth-child(9),.data-table.wh-txn-ledger tbody td:nth-child(9){min-width:6rem;max-width:11rem}
.data-table.wh-txn-ledger thead th:nth-child(10),.data-table.wh-txn-ledger tbody td:nth-child(10){min-width:7rem;max-width:10rem}
.wh-stock-batch-row{margin-top:6px}
.wh-prod-name-main{line-height:1.35;font-weight:600}
.wh-txn-prod-spec{font-size:11px;color:#888;margin-top:3px;line-height:1.35}
.wh-txn-prod-batch{font-size:11px;color:#555;margin-top:3px;line-height:1.35}
.wh-txn-doc-sub{font-size:11px;color:#888;margin-top:2px;line-height:1.35}
.wh-txn-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 10px}
/* 流水/汇总：日期快捷 + 操作按钮紧凑网格（移动端铺满宽度） */
.wh-txn-quick-bar{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  width:100%;
  box-sizing:border-box;
  margin-top:2px;
}
.wh-txn-quick-bar .wh-txn-qbtn{
  width:100%;
  min-width:0;
  padding:8px 4px;
  font-size:12px;
  justify-content:center;
  text-align:center;
  line-height:1.25;
}
.wh-txn-quick-bar .wh-txn-qbtn-wide{grid-column:span 2;}
.wh-txn-quick-bar-sum{grid-template-columns:repeat(3,minmax(0,1fr));}
@media(min-width:769px){
  .wh-txn-quick-bar{
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
  }
  .wh-txn-quick-bar .wh-txn-qbtn-wide{grid-column:span 1;}
  .wh-txn-quick-bar-sum{grid-template-columns:repeat(3,minmax(0,auto));max-width:360px;margin-left:auto;}
}
.data-table.wh-txn-ledger .wh-txn-qty-cell{text-align:right;line-height:1.4;overflow-wrap:break-word;word-break:break-word}
.data-table.wh-txn-ledger .wh-txn-qty-sub{font-size:11px;color:#666}
.data-table.wh-txn-ledger .wh-txn-qty-empty{color:#999}
.data-table.wh-txn-ledger .wh-txn-customer-inner{display:block;line-height:1.45}
.wb-coop-scope-badge{display:inline-block;font-size:10px;font-weight:800;padding:1px 6px;border-radius:999px;margin-left:4px;vertical-align:middle;letter-spacing:.02em}
.wb-coop-scope-int{background:#e8f5ec;color:#1a7a42;border:1px solid rgba(26,122,66,.22)}
.wb-coop-scope-ext{background:#fff3e0;color:#c56a00;border:1px solid rgba(197,106,0,.22)}
.wb-coop-scope-direct{background:#e3f2fd;color:#1565c0;border:1px solid rgba(21,101,192,.18)}
.wb-coop-cell .wb-coop-scope-badge{margin-left:6px}
.data-table.wh-txn-ledger .wh-txn-people-stack{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;line-height:1.35}
.data-table.wh-txn-ledger .wh-txn-people-line{font-size:11px;color:#444;word-break:break-word;overflow-wrap:break-word;max-width:100%}
.data-table.wh-txn-ledger .wh-txn-ops-inner{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;max-width:100%}
.data-table.wh-txn-ledger .wh-txn-ops-btns{display:flex;flex-flow:row wrap;gap:6px;align-items:center}
.data-table.wh-txn-ledger .wh-txn-ops-btns.wh-txn-ops-inline{flex-wrap:nowrap}
.data-table.wh-txn-ledger .wh-txn-ops-btns .btn-sm{min-height:36px;padding:6px 11px;font-size:12px;white-space:nowrap}
.data-table.wh-txn-ledger .wh-txn-slip-tag{font-size:10px;color:#a67c00;line-height:1.3;word-break:break-word;overflow-wrap:break-word;cursor:help;border-bottom:1px dotted rgba(166,124,0,.45)}
.data-table.wh-txn-ledger th.wh-txn-time{font-variant-numeric:tabular-nums}
.data-table.wh-txn-ledger th.wh-txn-ops-h{text-align:left}
.data-table.wh-txn-ledger td.wh-txn-preline{white-space:pre-line}
.wh-txn-cards{display:none;flex-direction:column;gap:10px;margin-top:8px}
.wh-txn-card{background:#fafcfa;border:1px solid #e3ebe4;border-radius:12px;padding:12px 14px;box-shadow:0 1px 6px rgba(26,77,46,.05)}
.wh-txn-card-hd{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:8px}
.wh-txn-card-hd .nm{font-weight:700;color:#1a4d2e;font-size:14px;line-height:1.4;flex:1}
.wh-txn-card-hd .tag{font-size:11px;padding:2px 8px;border-radius:999px;background:#e8f5ec;color:#2d7a4e;white-space:nowrap}
.wh-txn-card-meta{font-size:12px;color:#666;line-height:1.65}
.wh-txn-card-meta b{color:#444;font-weight:600}
.wh-txn-card-qty{margin-top:8px;display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:12px}
.wh-txn-card-qty .lab{color:#888;font-size:11px;margin-bottom:2px}
.wh-txn-card-ops{margin-top:10px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
@media(max-width:768px){
  .wh-txn-ledger-wrap .wh-warehouse-table-wrap{display:none}
  .wh-txn-ledger-wrap .wh-txn-cards{display:flex}
}
.wh-section-hint{font-size:11px;color:#888;margin:0 0 8px;line-height:1.5}
.grid2.wb-txn-filters,.grid2.wb-sum-filters{width:100%;box-sizing:border-box;gap:6px 8px;margin-bottom:8px}
.grid2.wb-txn-filters .fr,.grid2.wb-sum-filters .fr{margin-bottom:0}
.grid2.wb-txn-filters .fr label,.grid2.wb-sum-filters .fr label{font-size:11px;margin-bottom:2px}
.grid2.wb-txn-filters .fi,.grid2.wb-sum-filters .fi{padding:6px 8px;font-size:12px}
.card{padding:12px 14px;margin-bottom:10px}
.card h4{margin:0 0 8px}
.wh-out-drawer-hint{font-size:11px;color:#666;margin:0 0 8px;line-height:1.5}
.wh-out-drawer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px;margin-bottom:4px}
@media(min-width:720px){.wh-out-drawer-meta{grid-template-columns:repeat(3,minmax(0,1fr))}}
.out-row-item.wh-out-line{padding:10px 12px;margin-bottom:8px;border:1px solid #e3ebe4;border-radius:10px;background:#fafcfa}
.wh-out-line-top{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.wh-out-line-qty{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:6px;align-items:end}
.wh-out-line-qty .fr:last-child{min-width:96px}
.wh-out-line-batch{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;margin-top:6px}
.wh-out-line-price{margin-top:6px}
.wh-out-line-foot{display:flex;justify-content:flex-end;margin-top:4px}
.wh-out-del-link{background:none;border:none;color:#c62828;font-size:12px;cursor:pointer;padding:2px 6px;text-decoration:underline}
.wh-out-hint{font-size:11px;line-height:1.45;margin:4px 0 0;color:#5f6f63;min-height:0}
.out_ton_hint{color:var(--green,#1a4d2e)}
.wh-out-stock-panel{margin-top:6px;padding:6px 8px;border-radius:8px;background:#f8faf8;border:1px dashed #d5e5d8;font-size:11px;line-height:1.45}
.data-table.wh-txn-ledger th,.data-table.wh-txn-ledger td{padding:6px 8px}
.data-table.wh-txn-ledger .wh-txn-ops-btns .btn-sm{min-height:30px;padding:4px 8px;font-size:11px}
.vol-hot{color:#c62828;font-weight:800}
.vol-fast{color:#e65100;font-weight:700}
.vol-mid{color:#1565c0;font-weight:600}
.vol-stable{color:#2e7d32;font-weight:600}
.price-latest-row{box-shadow:inset 3px 0 0 #c9962a;background:linear-gradient(90deg,#fffbf0,#fff)}

/* ── filters ── */
.filter-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
.wb-sales-row-ops{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;white-space:nowrap;}
.wb-sales-row-ops .btn-sm{flex:0 0 auto;min-width:auto;padding:4px 8px;min-height:32px;}
.wb-coop-stats-toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin-bottom:12px;}
.wb-coop-stats-toolbar .fi-label{flex:1 1 120px;max-width:160px;font-size:12px;}
.wb-coop-stats-toolbar .fi{padding:7px 10px;font-size:13px;}
.wb-coop-stats-toolbar .btn-sm{flex:0 0 auto;min-width:auto;white-space:nowrap;}
.summary-date-group{display:flex;flex-direction:column;gap:4px;min-width:0;}
.summary-date-group label{font-size:12px;color:var(--mid);}
.summary-date-group .fi{min-width:120px;max-width:160px;box-sizing:border-box;}
@media(max-width:600px){.summary-date-group .fi{max-width:100%;min-width:0;}}
.fi{padding:9px 12px;border:1.5px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;outline:none;background:#fafcfa;}
.fi:focus{border-color:var(--green);}

/* ── table ── */
.tbl{width:100%;border-collapse:collapse;font-size:13px;}
.tbl th{padding:10px 12px;background:#f5f5f5;text-align:left;font-weight:700;font-size:12px;color:#555;}
.tbl td{padding:10px 12px;border-bottom:1px solid #f0f0f0;}
.tbl tbody tr{min-height:44px;}
.tbl tbody td{min-height:44px;vertical-align:middle;}
.link-product-history{color:var(--green,#1a4d2e);text-decoration:none;}
.link-product-history:hover{text-decoration:underline;}
.tbl tr:hover td{background:#f9fbf9;}
.tbl tr{cursor:pointer;-webkit-user-select:none;user-select:none;}
.data-table{width:100%;border-collapse:collapse;font-size:13px;}
.data-table th,.data-table td{padding:8px 10px;border-bottom:1px solid #f0f0f0;vertical-align:middle;}
.data-table th{background:#f5f5f5;text-align:left;font-size:12px;color:#555;}
.wh-bar-wrap{height:6px;background:#e8ece9;border-radius:4px;overflow:hidden;margin-top:6px;max-width:100%;}
.wh-bar-fill{height:100%;border-radius:4px;background:linear-gradient(90deg,var(--green-mid),var(--green));transition:width .2s;}
.wh-bar-fill.bags{background:linear-gradient(90deg,#c9962a,#e8b84a);}
.data-table th.wh-prod-col,.data-table td.wh-prod-name{min-width:7rem;max-width:18rem;}
.data-table td.wh-prod-name{writing-mode:horizontal-tb;text-orientation:mixed;white-space:normal;word-break:break-word;line-height:1.35;}
.imp{color:var(--gold);}
.tag{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:600;}

/* ── buttons ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 18px;min-height:44px;min-width:44px;border-radius:8px;border:none;font-size:14px;font-weight:600;cursor:pointer;transition:.2s;font-family:inherit;touch-action:manipulation;box-sizing:border-box;-webkit-user-select:none;user-select:none;}
.btn-p{background:var(--green);color:#fff;}
.btn-p:hover{background:var(--green-mid);}
.btn-s{background:var(--gold);color:#fff;}
.btn-s:hover{opacity:.88;}
.btn-g{background:#f0f0f0;color:#555;}
.btn-g:hover{background:#e0e0e0;}
.btn-r{background:#fee;color:#e74c3c;border:1px solid #fcc;}
.btn-r:hover{background:#fdd;}
.btn-sm{padding:8px 12px;font-size:12px;min-height:44px;min-width:44px;}
button,.btn,.tab,.nav-back,a{-webkit-tap-highlight-color:transparent;tap-highlight-color:transparent;}

/* ── modal ── */
.overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:200;align-items:flex-end;justify-content:center;}
.overlay.open{display:flex;}
#overlayMapPicker.map-picker-open{display:flex !important;}
.drawer{background:#fff;border-radius:20px 20px 0 0;width:100%;max-width:680px;max-height:92vh;overflow-y:auto;padding:24px 20px;animation:slideUp .25s ease;}
.drawer.wb-md-drawer{
  --wb-drawer-w:1080px;
  width:min(100%,var(--wb-drawer-w));
  max-width:min(1080px,calc(100vw - 28px));
  overflow:hidden;
  overscroll-behavior:contain;
  display:flex;
  flex-direction:column;
  isolation:isolate;
}
.drawer.wb-md-drawer .dr-body.wb-md-quick-body{
  flex:1;
  min-height:0;
  overflow:auto;
  max-height:calc(100dvh - 128px);
  padding:0 2px 4px;
}
.drawer.wb-md-drawer .dr-footer{
  flex-shrink:0;
  margin-top:0;
  padding-top:12px;
  border-top:1px solid #eef3ef;
}
.wb-md-quick-split{
  display:grid;
  grid-template-columns:minmax(320px,.86fr) minmax(380px,1.14fr);
  gap:14px;
  align-items:start;
  min-height:0;
}
.wb-md-quick-map-card,
.wb-md-quick-form-card{
  background:#f8fbf9;
  border:1px solid #dde8e2;
  border-radius:14px;
  padding:12px 14px;
  box-shadow:0 1px 0 rgba(255,255,255,.9) inset;
}
.wb-md-quick-map-card{
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  position:relative;
  z-index:1;
  height:min(66dvh,620px);
  max-height:620px;
}
.wb-md-quick-form-card{
  min-width:0;
  position:relative;
  z-index:3;
  overflow-y:visible;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
.wb-md-quick-card-hd{
  font-size:13px;
  font-weight:700;
  color:#1a4d2e;
  margin:0 0 10px;
  letter-spacing:.02em;
}
.wb-md-quick-map-card .wb-map-base-strip{margin-bottom:8px;flex-shrink:0;}
.wb-md-map-shell{
  position:relative;
  flex:1;
  min-height:260px;
  height:100%;
  max-width:100%;
  overflow:hidden;
  isolation:isolate;
  contain:layout paint size;
  border-radius:12px;
  border:1px solid #cddfd4;
  background:#eef2ee;
  z-index:0;
}
.wb-md-map-shell #md_draw_map{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  z-index:0!important;
  overflow:hidden!important;
}
.wb-md-map-shell .leaflet-container,
.wb-md-map-shell .leaflet-map-pane,
.wb-md-map-shell .leaflet-pane{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
}
.wb-md-map-shell .leaflet-top,
.wb-md-map-shell .leaflet-bottom{z-index:400!important;}
.wb-md-map-shell .leaflet-control-container{position:absolute;inset:0;pointer-events:none;}
.wb-md-map-shell .leaflet-control{pointer-events:auto;}
.wb-md-map-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
  flex-shrink:0;
}
.wb-md-map-tip{
  font-size:11px;
  line-height:1.45;
  margin:8px 0 0;
  flex-shrink:0;
}
.drawer.wb-md-drawer .wb-md-quick-form-card .fr{margin-bottom:10px;}
.drawer.wb-md-drawer .wb-md-quick-form-card .grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px;}
.wb-md-preset-bar{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;}
.wb-md-map-merged-card{border-left:4px solid #2d7a4e;}
.wb-md-form-only{max-width:100%;width:100%;}
.wb-md-location-actions{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 8px;}
.wb-md-preset,.wb-md-chip{
  border:1px solid #d8e7dd;
  background:#fff;
  color:#1a4d2e;
  border-radius:999px;
  padding:7px 10px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.wb-md-preset{background:#eef8f1;}
.wb-md-chip-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.wb-md-chip{padding:5px 8px;font-weight:600;color:#51665a;background:#f8fbf9;}
.wb-md-chip:hover,.wb-md-preset:hover{border-color:#9bc8a8;background:#e9f6ed;}
.wb-md-section-title{font-size:13px;font-weight:800;color:#1a4d2e;margin:14px 0 10px;padding-top:12px;border-top:1px dashed #dbe8df;}
.drawer.wb-md-drawer .wb-md-extra-grid{margin-bottom:4px;}
.wb-md-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;}
.wb-md-detail-kv{border:1px solid #e4eee7;border-radius:10px;background:#f8fbf9;padding:9px 10px;}
.wb-md-detail-kv b{display:block;color:#1a4d2e;font-size:12px;margin-bottom:3px;}
.wb-md-detail-kv span{font-size:13px;color:#405347;line-height:1.45;overflow-wrap:anywhere;}
@media (max-width:860px){
  .drawer.wb-md-drawer{--wb-drawer-w:100%;max-width:100%;}
  .wb-md-quick-split{grid-template-columns:1fr;min-height:0;height:auto;}
  .wb-md-quick-map-card{height:auto;max-height:none;width:100%;}
  .wb-md-map-shell{min-height:240px;height:240px;flex:none;}
  .wb-md-quick-form-card{max-height:none;}
  .drawer.wb-md-drawer .wb-md-quick-form-card .grid2{grid-template-columns:1fr;}
}
#md_map .leaflet-container{border-radius:12px;}
.wb-map-base-strip .btn-sm{font-size:11px;padding:4px 8px;}
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.drawer-title{font-size:17px;font-weight:800;color:var(--green);margin-bottom:16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.drawer-title-toolbar{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:nowrap;justify-content:flex-end;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding-bottom:2px;}
.drawer-title-toolbar::-webkit-scrollbar{height:4px;}
.drawer-title-toolbar::-webkit-scrollbar-thumb{background:#c5d4c8;border-radius:4px;}
.drawer-title-toolbar .btn-sm{min-height:38px;padding:7px 11px;font-weight:600;white-space:nowrap;}
.drawer-title-toolbar .wb-tb-dd{position:relative;display:inline-flex;vertical-align:middle;}
.drawer-title-toolbar .wb-tb-dd>summary{list-style:none;cursor:pointer;border-radius:8px;}
.drawer-title-toolbar .wb-tb-dd>summary::-webkit-details-marker{display:none;}
.drawer-title-toolbar .wb-tb-dd-panel{position:absolute;right:0;top:calc(100% + 4px);z-index:40;background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px;min-width:168px;box-shadow:0 10px 32px rgba(26,77,46,.12);display:flex;flex-direction:column;gap:6px;}
.drawer-title-toolbar .wb-tb-dd[open] summary{box-shadow:0 0 0 2px rgba(201,150,42,.35);}
.drawer-title-toolbar .btn-tb-outline{background:#fff;color:var(--green);border:1.5px solid #b8d4c4;}
.drawer-title-toolbar .btn-tb-outline:hover{background:#f5faf7;}
.drawer-title-toolbar.wb-cust-fn-toolbar{flex-wrap:nowrap;gap:4px;justify-content:flex-end;overflow-x:auto;max-width:100%;margin-left:0;}
.drawer-title-toolbar.wb-cust-fn-toolbar .btn-sm{min-width:auto;max-width:none;padding:6px 10px;flex:0 0 auto;font-size:12px;}
.wb-cust-drawer-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding-bottom:10px;border-bottom:1px solid #e8f0ec;margin-bottom:4px;}
.wb-cust-drawer-name{flex:1 1 140px;font-weight:800;font-size:16px;color:var(--green,#1a4d2e);min-width:0;}
.wb-cust-drawer-close{margin-left:4px!important;flex-shrink:0;}
.customer-type-divider td{background:linear-gradient(90deg,#e8f5ec,#fff);padding:10px 12px!important;border-top:2px solid #c5dcc9;border-bottom:1px solid #e0ebe4;font-size:12px;font-weight:700;color:var(--green,#1a4d2e);}
.customer-type-divider em{font-style:normal;font-weight:400;color:#888;margin-left:8px;font-size:11px;}
.customer-coop-head td{background:#f7fbf8;cursor:pointer;font-size:13px;border-bottom:1px dashed #d4e8dc;}
.customer-coop-toggle{border:none;background:#e8f5ec;color:var(--green);border-radius:6px;width:26px;height:26px;cursor:pointer;font-weight:700;margin-right:6px;}
.customer-member-row td:first-child+td{padding-left:8px;}
.customer-member-indent{color:#888;font-size:12px;}
.cust-sort-th{cursor:pointer;user-select:none;}
.cust-sort-th:hover{color:var(--green,#1a4d2e);}
.customer-row-actions .btn{padding:5px 7px;font-size:11px;}
@media (max-width:768px){
  .drawer-title-toolbar.wb-cust-fn-toolbar .btn-sm{min-width:0;max-width:none;width:100%;flex:1 1 calc(50% - 4px);}
}
.wh-slip-ops{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-start;}
.wh-slip-ops .btn{white-space:nowrap;}
/* 问题诊断四步向导 */
.diag-steps{display:flex;align-items:center;gap:4px;margin-bottom:20px;flex-wrap:wrap;}
.diag-step{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:20px;font-size:12px;font-weight:600;color:#999;background:#f0f0f0;}
.diag-step.active{color:#fff;background:var(--green);}
.diag-step.done{color:var(--green);background:#e8f5ec;}
.diag-chip-wrap{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px;}
.diag-chip{display:inline-block;padding:8px 14px;border-radius:20px;font-size:13px;border:1.5px solid var(--border);background:#fafcfa;cursor:pointer;transition:.2s;}
.diag-chip:hover{border-color:var(--green);background:#f0f7f2;}
.diag-chip.active{border-color:var(--green);background:var(--green);color:#fff;}
.diag-chip.multi.active{border-color:var(--green);background:#e8f5ec;color:var(--green);}
.fr{margin-bottom:12px;}
.fr label{display:block;font-size:12px;font-weight:600;color:var(--green);margin-bottom:5px;}
.fr .fi{width:100%;}
#wb_cust_region_wrap .rp-cn-row,#wb_diag_region_wrap .rp-cn-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:stretch;}
#wb_cust_region_wrap .rp-cn-actions,#wb_diag_region_wrap .rp-cn-actions{margin-top:6px;}
@media(max-width:560px){
  #wb_cust_region_wrap .rp-cn-row,#wb_diag_region_wrap .rp-cn-row{grid-template-columns:1fr;}
}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.dr-footer{display:flex;gap:10px;margin-top:16px;justify-content:flex-end;}
.close-btn{background:none;border:none;font-size:22px;cursor:pointer;color:#888;margin-left:auto;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0;flex-shrink:0;}

/* ── purchase table ── */
.pur-table{width:100%;border-collapse:collapse;font-size:13px;margin-top:8px;}
.pur-table th{padding:8px 10px;background:#f0f7f2;text-align:left;font-size:12px;color:var(--green);}
.pur-table td{padding:8px 10px;border-bottom:1px solid #f0f0f0;}
.home-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
@media(max-width:600px){.home-table-wrap .tbl,.home-table-wrap .pur-table{min-width:480px;}}
.customer-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
@media(max-width:600px){.customer-table-wrap .tbl-customer-list{min-width:880px;}}
.total-bar{background:#f0f7f2;border-radius:8px;padding:10px 14px;display:flex;gap:20px;margin:10px 0;}
.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px;}
.mini-stat{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);}
.mini-stat .n{font-size:24px;font-weight:800;color:var(--green);}
.mini-stat .l{font-size:12px;color:#888;margin-top:4px;}
/* 合同明细编辑表：手机端勿隐藏第4/6列（否则单价列被误藏） */
.wb-ce-items-tbl{font-size:12px;}
@media(max-width:600px){
  .tbl:not(.tbl-home):not(.pur-table):not(.wb-ce-items-tbl) th:nth-child(4),.tbl:not(.tbl-home):not(.pur-table):not(.wb-ce-items-tbl) td:nth-child(4),
  .tbl:not(.tbl-home):not(.pur-table):not(.wb-ce-items-tbl) th:nth-child(6),.tbl:not(.tbl-home):not(.pur-table):not(.wb-ce-items-tbl) td:nth-child(6){display:none;}
}
/* 需求调查模块卡片 */
.wb-dm-hero{background:linear-gradient(135deg,#f6fbf7 0%,#e8f4ec 55%,#dff0e4 100%);border:1px solid #cfe8d6;border-radius:16px;padding:18px 18px 16px;margin-bottom:16px;box-shadow:0 2px 14px rgba(26,77,46,.06);}
.wb-dm-hero h2{margin:0 0 8px;font-size:20px;font-weight:900;color:var(--green);}
.wb-dm-hero p{margin:0;font-size:13px;color:#4a6354;line-height:1.75;}
.wb-dm-stat-row{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px;}
.wb-dm-form-card{border-left:4px solid #c9962a;}
.wb-dm-list-head{font-size:16px;font-weight:800;color:var(--green);margin:8px 2px 12px;}
.wb-dm-campaign{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start;padding:16px;border-radius:14px;border:1px solid #e0ebe3;background:linear-gradient(180deg,#fff 0%,#fafdfb 100%);box-shadow:0 1px 10px rgba(0,0,0,.04);}
.wb-dm-campaign .wb-dm-qr{flex-shrink:0;border-radius:10px;border:1px solid #e8ece9;box-shadow:0 1px 6px rgba(0,0,0,.05);}
.wb-dm-campaign .wb-dm-body{flex:1;min-width:0;}
.wb-dm-title{font-size:16px;font-weight:800;color:#1a4d2e;line-height:1.35;}
.wb-dm-meta{font-size:12px;color:#6f7f74;margin:6px 0;line-height:1.65;}
.wb-dm-url{font-size:11px;word-break:break-all;color:#5c6b62;background:#f4faf6;padding:8px 10px;border-radius:8px;border:1px dashed #d4e5d9;}
.wb-dm-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;}
.pager{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px;font-size:12px;color:#666;}
.chart-box{width:100%;height:340px;background:#fff;border-radius:12px;}
.subsec{font-size:15px;font-weight:800;color:var(--green);margin-bottom:10px;}
.pill-list{display:flex;flex-wrap:wrap;gap:8px;}
.pill{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 14px;min-height:44px;min-width:44px;border-radius:999px;background:#f0f7f2;border:1px solid var(--border);font-size:12px;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;}
.pill input{margin:0;}
.muted{color:#888;font-size:12px;}
.summary-stat-click{cursor:pointer;transition:background .2s,box-shadow .2s;}
.summary-stat-click:hover{background:#f0f7f2;box-shadow:0 2px 10px rgba(26,77,46,.1);}
.summary-detail-block{margin-bottom:16px;}
.summary-detail-head{margin-bottom:6px;}
.summary-detail-link{color:var(--green);font-size:12px;font-weight:600;text-decoration:none;margin-left:8px;}
.summary-detail-link:hover{text-decoration:underline;}
.summary-line{font-size:12px;color:#666;background:#f8fbf8;border:1px dashed #d9e8dc;border-radius:8px;padding:8px 10px;margin-bottom:10px;}
.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.report-stack{display:flex;flex-direction:column;gap:14px;width:100%;}
.report-stack .report-card-stack{width:100%;margin:0;}
.tbl-report-stack{table-layout:auto;width:100%;}
.tbl-report-stack .sr-cell-products{max-width:420px;line-height:1.45;font-size:12px;}
.report-card{background:#f9fcfa;border:1px solid var(--border);border-radius:12px;padding:12px;}
.report-card .tbl{table-layout:fixed;}
.report-card .tbl th,.report-card .tbl td{white-space:normal;word-break:break-word;vertical-align:top;}
.scope-note{font-size:12px;color:#6f7f74;margin:-4px 0 10px;}
.focus-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.focus-card{background:linear-gradient(180deg,#ffffff 0%,#f6fbf7 100%);border:1px solid var(--border);border-radius:14px;padding:14px;box-shadow:0 1px 8px rgba(0,0,0,.04);}
.focus-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;}
.focus-card-title{font-size:13px;font-weight:700;color:var(--green);}
.focus-card-ico{font-size:20px;opacity:.9;}
.focus-card-num{font-size:28px;font-weight:900;color:var(--green);}
.focus-card-desc{font-size:12px;color:#7b8a80;line-height:1.5;min-height:36px;margin-top:4px;}
.focus-card .btn{margin-top:10px;width:100%;}
.insight-grid{display:grid;grid-template-columns:1fr 1.4fr;gap:12px;margin-bottom:16px;}
.insight-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;box-shadow:0 1px 8px rgba(0,0,0,.04);}
.tasklog-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 14px;}
.tasklog-toolbar-main{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.tasklog-toolbar-note{font-size:12px;color:#6f7f74;}
.tasklog-range-chip{display:inline-flex;align-items:center;justify-content:center;padding:8px 14px;min-height:40px;border-radius:999px;background:#f4faf5;border:1px solid var(--border);font-size:12px;font-weight:700;color:var(--green);cursor:pointer;}
.tasklog-range-chip.active{background:var(--green);color:#fff;border-color:var(--green);}
.tasklog-result-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#f8fbf8;border:1px dashed #d9e8dc;border-radius:10px;padding:10px 12px;margin-bottom:16px;}
.tasklog-result-summary b{color:var(--green);}
.tasklog-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px;}
.tasklog-section-meta{font-size:12px;color:#7b8a80;}
.progress-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px;}
.progress-title{font-size:14px;font-weight:700;color:var(--green);}
.progress-num{font-size:26px;font-weight:900;color:var(--green);}
.progress-track{height:10px;background:#edf3ee;border-radius:999px;overflow:hidden;}
.progress-bar{height:100%;background:linear-gradient(90deg,#2d7a4e,#62b37a);border-radius:999px;}
.progress-meta{font-size:12px;color:#7b8a80;line-height:1.7;margin-top:10px;}
.timeline-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;}
.timeline-day{border:1px solid #edf3ee;background:#fafdfb;border-radius:12px;padding:10px;cursor:pointer;transition:.2s;}
.timeline-day:hover{background:#f3faf5;border-color:#d6e8da;}
.timeline-day.active{border-color:#2d7a4e;background:#eef8f1;}
.timeline-week{font-size:11px;color:#7b8a80;}
.timeline-date{font-size:14px;font-weight:800;color:#1f2d1f;margin-top:2px;}
.timeline-count{font-size:20px;font-weight:900;color:#2d6e47;margin-top:8px;}
.timeline-sub{font-size:11px;color:#7b8a80;margin-top:4px;line-height:1.5;}
.tasklog-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:stretch;}
.tasklog-columns>.report-card{display:flex;flex-direction:column;min-height:680px;margin-bottom:0;}
#tasklogTaskList,#tasklogWorklogList{flex:1;min-height:0;max-height:760px;overflow:auto;padding-right:4px;}
#tasklogTaskList::-webkit-scrollbar,#tasklogWorklogList::-webkit-scrollbar{width:8px;}
#tasklogTaskList::-webkit-scrollbar-thumb,#tasklogWorklogList::-webkit-scrollbar-thumb{background:#d9e8dc;border-radius:999px;}
.tasklog-stack{display:grid;gap:10px;}
.task-item-card,.log-item-card{background:#fff;border:1px solid #edf3ee;border-radius:14px;padding:14px 16px;box-shadow:0 1px 8px rgba(0,0,0,.04);}
.task-item-title,.log-item-title{font-size:15px;font-weight:700;color:#1f2d1f;line-height:1.5;}
.task-item-meta,.log-item-meta{font-size:12px;color:#7b8a80;margin-top:4px;line-height:1.5;}
.task-item-notes,.log-item-preview{font-size:12px;color:#666;line-height:1.7;white-space:pre-wrap;word-break:break-word;margin-top:8px;}
.task-item-actions,.log-item-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;}
.tasklog-panel-hero{background:linear-gradient(135deg,#f8fcf9 0%,#eef8f1 100%);border:1px solid #dceee1;border-radius:16px;padding:16px 16px 14px;margin-bottom:12px;}
.tasklog-panel-kicker{font-size:12px;font-weight:700;color:#7b8a80;}
.tasklog-panel-title{font-size:20px;font-weight:900;color:var(--green);margin-top:6px;}
.tasklog-panel-desc{font-size:12px;color:#6f7f74;line-height:1.8;margin-top:8px;}
.tasklog-panel-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px;}
.tasklog-panel-metrics .metric{background:#fff;border:1px solid #e6f0e8;border-radius:12px;padding:12px;text-align:center;}
.tasklog-panel-metrics b{display:block;font-size:22px;color:var(--green);line-height:1.1;}
.tasklog-panel-metrics span{display:block;font-size:11px;color:#7b8a80;margin-top:5px;}
.tasklog-timeline{position:relative;display:grid;gap:14px;padding-left:14px;}
.tasklog-timeline::before{content:'';position:absolute;left:7px;top:4px;bottom:4px;width:2px;background:linear-gradient(180deg,#d8eadc 0%,#eef6f0 100%);border-radius:999px;}
.tasklog-time-group{position:relative;display:grid;gap:10px;}
.tasklog-time-group::before{content:'';position:absolute;left:-14px;top:8px;width:10px;height:10px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px #eef8f1;}
.tasklog-time-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.tasklog-time-date{font-size:14px;font-weight:900;color:#1f2d1f;}
.tasklog-time-sub{font-size:11px;color:#7b8a80;margin-top:2px;}
.tasklog-time-count{font-size:11px;color:#7b8a80;font-weight:700;white-space:nowrap;}
.tasklog-time-cards{display:grid;gap:10px;}
.tasklog-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:420px;border:1px dashed #d9e8dc;border-radius:16px;background:linear-gradient(180deg,#fbfefc 0%,#f5faf6 100%);text-align:center;padding:28px 22px;}
.tasklog-empty-ico{font-size:38px;line-height:1;}
.tasklog-empty-title{font-size:18px;font-weight:800;color:var(--green);margin-top:10px;}
.tasklog-empty-desc{font-size:13px;line-height:1.8;color:#6f7f74;max-width:320px;margin-top:8px;}
.tasklog-empty-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:14px;}
.tasklog-empty-mini{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;max-width:360px;margin-top:18px;}
.tasklog-empty-mini .item{background:#fff;border:1px solid #e7f0e9;border-radius:12px;padding:12px;}
.tasklog-empty-mini b{display:block;font-size:20px;color:var(--green);}
.tasklog-empty-mini span{display:block;font-size:12px;color:#7b8a80;margin-top:4px;}
.tasklog-day-group{display:grid;gap:10px;}
.tasklog-day-title{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 2px;color:#2d6e47;font-size:13px;font-weight:800;}
.tasklog-day-title span:last-child{font-size:11px;color:#8a968f;font-weight:600;}
.tasklog-morebar{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:16px;padding-top:4px;}
.date-pill{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;}
.date-pill.overdue{background:#fff1f0;color:#d84a3a;}
.date-pill.today{background:#eef9ef;color:#2e7d32;}
.date-pill.upcoming{background:#f5f7fa;color:#5f6b7a;}
.template-row{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px;}
.template-chip{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;min-height:40px;border-radius:999px;border:1px solid var(--border);background:#f8fbf9;color:var(--green);font-size:12px;font-weight:700;cursor:pointer;}
.template-chip:hover{background:#eef8f1;}
.ledger-shell{margin-top:16px;}
.ledger-top{display:grid;grid-template-columns:1.2fr .8fr;gap:12px;margin-bottom:12px;}
.ledger-hero{background:linear-gradient(135deg,#1a4d2e 0%,#2d6e47 65%,#4f8f62 100%);color:#fff;border-radius:16px;padding:18px;}
.ledger-hero-title{font-size:22px;font-weight:900;}
.ledger-hero-meta{font-size:13px;opacity:.9;line-height:1.8;margin-top:8px;}
.ledger-mini-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.ledger-mini{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;}
.ledger-mini .n{font-size:24px;font-weight:900;color:var(--green);}
.ledger-mini .l{font-size:12px;color:#7b8a80;margin-top:4px;}
.ledger-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.ledger-list{display:grid;gap:8px;}
.ledger-item{padding:10px 12px;border:1px solid #edf3ee;border-radius:12px;background:#fff;}
.ledger-item-title{font-size:13px;font-weight:700;color:#1f2d1f;line-height:1.6;}
.ledger-item-meta{font-size:12px;color:#7b8a80;line-height:1.6;margin-top:3px;}
.ledger-empty{font-size:12px;color:#9aa5a0;text-align:center;padding:24px 8px;}
.ledger-summary-grid{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:12px;margin-bottom:12px;}
.portrait-stack{display:grid;gap:10px;}
.portrait-tags{display:flex;flex-wrap:wrap;gap:8px;}
.portrait-tag{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef8f1;color:var(--green);font-size:12px;font-weight:700;border:1px solid #dceee1;}
.portrait-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.portrait-kv-item{background:#fff;border:1px solid #edf3ee;border-radius:12px;padding:10px 12px;}
.portrait-kv-item b{display:block;font-size:15px;color:#1f2d1f;line-height:1.5;}
.portrait-kv-item span{display:block;font-size:12px;color:#7b8a80;margin-top:4px;}
.rhythm-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px;}
.rhythm-mini{background:#fff;border:1px solid #edf3ee;border-radius:12px;padding:10px 12px;}
.rhythm-mini .n{font-size:18px;font-weight:900;color:#2d6e47;}
.rhythm-mini .l{font-size:12px;color:#7b8a80;margin-top:4px;}
.rhythm-bars{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;align-items:end;min-height:126px;}
.rhythm-bar{display:flex;flex-direction:column;align-items:center;gap:8px;}
.rhythm-bar-track{width:100%;height:78px;border-radius:12px;background:#edf3ee;overflow:hidden;display:flex;align-items:flex-end;}
.rhythm-bar-fill{width:100%;background:linear-gradient(180deg,#7bc58e,#2d7a4e);border-radius:12px 12px 0 0;min-height:8px;}
.rhythm-bar-value{font-size:13px;font-weight:800;color:#1f2d1f;}
.rhythm-bar-label{font-size:11px;color:#7b8a80;}
.suggest-list{display:grid;gap:10px;}
.suggest-item{background:#fff;border:1px solid #edf3ee;border-radius:12px;padding:12px;}
.suggest-item-title{font-size:13px;font-weight:700;color:#1f2d1f;line-height:1.6;}
.suggest-item-meta{font-size:12px;color:#7b8a80;line-height:1.7;margin-top:4px;}
.plot-map-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 10px;}
.plot-map-summary{font-size:12px;color:#666;background:#f8fbf8;border:1px dashed #d9e8dc;border-radius:8px;padding:8px 10px;margin-top:10px;line-height:1.7;}
.plot-map-preview{font-size:12px;color:#666;background:#f8fbf8;border:1px dashed #d9e8dc;border-radius:8px;padding:10px 12px;line-height:1.7;}
.customer-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.customer-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;box-shadow:0 1px 8px rgba(0,0,0,.04);}
.customer-card::before{content:'';display:block;height:4px;border-radius:999px;margin:-14px -14px 12px;}
.customer-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px;}
.customer-card-name{font-size:16px;font-weight:800;color:#1f2d1f;line-height:1.4;}
.customer-card-meta{font-size:12px;color:#7b8a80;line-height:1.6;margin-top:4px;}
.customer-card-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0;}
.customer-card-item{background:#f9fcfa;border:1px solid #edf3ee;border-radius:10px;padding:10px;}
.customer-card-item b{display:block;font-size:14px;color:#1f2d1f;line-height:1.4;}
.customer-card-item span{display:block;font-size:11px;color:#7b8a80;margin-top:4px;}
.customer-card-actions{display:flex;gap:6px;flex-wrap:nowrap;margin-top:10px;align-items:stretch;}
.customer-card-actions .btn{flex:1 1 0;min-width:0;padding:6px 8px;font-size:12px;white-space:nowrap;text-align:center;}
.customer-row-actions{display:inline-flex;flex-wrap:nowrap;gap:6px;align-items:center;white-space:nowrap;}
.customer-row-actions .btn{flex-shrink:0;}
.customer-card.stage-prospect::before,.customer-card.stage-inactive::before{background:#95a5a6;}
.customer-card.stage-contact::before{background:#3498db;}
.customer-card.stage-developing::before{background:#e67e22;}
.customer-card.stage-trial::before{background:#c2185b;}
.customer-card.stage-partner::before{background:#27ae60;}
.plot-crop-group{margin-bottom:12px;border:1px solid #edf3ee;border-radius:12px;background:#fff;overflow:hidden;}
.plot-crop-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;background:#f7fbf8;border-bottom:1px solid #edf3ee;}
.plot-crop-title{font-size:13px;font-weight:800;color:var(--green);}
.plot-crop-meta{font-size:12px;color:#7b8a80;}

/* ── 农事日历 ── */
.cal-table{width:100%;border-collapse:collapse;font-size:13px;}
.cal-table th{padding:8px 4px;background:#f0f7f2;text-align:center;font-weight:600;color:var(--green);}
.cal-cell{vertical-align:top;min-height:80px;min-width:44px;border:1px solid #eee;padding:8px;cursor:pointer;background:#fff;-webkit-user-select:none;user-select:none;}
.cal-cell:hover{background:#f9fcf9;}
.cal-cell.empty{background:#fafafa;cursor:default;}
.cal-num{font-size:12px;color:#666;margin-bottom:4px;}
.cal-task{font-size:11px;background:#e8f5ec;color:#2e7d32;padding:6px 8px;min-height:32px;border-radius:4px;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;display:flex;align-items:center;-webkit-user-select:none;user-select:none;}
.cal-task:hover{background:#c8e6c9;}
.cal-event{background:#fff3e0;color:#e65100;}
.cal-event:hover{background:#ffe0b2;}
.cal-more{font-size:10px;color:#888;margin-top:2px;}

/* ── activity ── */
.act-item{padding:10px;border-bottom:1px solid #f5f5f5;font-size:13px;}
/* ── universal search-select component ── */
.ss-wrap{position:relative;width:100%;}
.ss-input{width:100%;padding:9px 36px 9px 36px;border:1.5px solid var(--border);border-radius:8px;font-size:13px;outline:none;background:#fafcfa;transition:border-color .2s;font-family:inherit;box-sizing:border-box;}
.ss-input:focus{border-color:var(--green);background:#fff;}
.ss-icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);font-size:14px;color:#999;pointer-events:none;user-select:none;}
.ss-clear{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:16px;color:#bbb;cursor:pointer;display:none;user-select:none;padding:4px;}
.ss-input.has-val ~ .ss-clear{display:block;}
.ss-dropdown{display:none;position:absolute;top:calc(100% + 3px);left:0;right:0;background:#fff;border:1.5px solid var(--border);border-radius:10px;max-height:220px;overflow-y:auto;z-index:9999;box-shadow:0 6px 24px rgba(0,0,0,.12);}
.ss-dropdown.open{display:block;}
.ss-item{padding:12px 14px;min-height:44px;display:flex;align-items:center;font-size:13px;cursor:pointer;border-bottom:1px solid #f5f5f5;transition:background .1s;-webkit-user-select:none;user-select:none;}
.ss-item:last-child{border-bottom:none;}
.ss-item.selected{background:#e8f5ec;color:var(--green);font-weight:600;}
.ss-item:active{background:#d4eedd;}
.ss-empty{padding:14px;text-align:center;color:#bbb;font-size:13px;}
.act-date{color:var(--green);font-weight:700;font-size:12px;}
.act-badge{display:inline-block;background:#e8f5ec;color:var(--green);padding:2px 8px;border-radius:12px;font-size:11px;margin:0 6px;}

@media(max-width:600px){
  body{overflow-x:hidden;}
  .stats-row{grid-template-columns:repeat(3,1fr);}
  .metric-grid{grid-template-columns:repeat(2,1fr);}
  .grid2{grid-template-columns:1fr;}
  .chart-grid,.report-grid,.tasklog-columns,.focus-grid,.insight-grid,.ledger-top,.ledger-grid,.ledger-summary-grid,.customer-card-grid{grid-template-columns:1fr;}
  .home-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -4px 0 0;}
  .home-table-wrap .pur-table,.home-table-wrap .tbl{min-width:480px;}
  .chart-box{height:280px;}
  .content{padding:12px;}
  .hdr{padding:10px 14px;height:auto;gap:8px;flex-wrap:wrap;}
  .hdr-logo{font-size:18px;min-width:0;}
  .hdr-user{width:100%;order:3;font-size:12px;}
  .hdr-btn{margin-left:auto;}
  #msgCenterDrop{position:fixed!important;left:12px!important;right:12px!important;top:56px!important;width:auto!important;max-width:none!important;box-sizing:border-box;}
  .tabs{padding:0 12px;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch;}
  .tab{padding:12px 14px;flex:0 0 auto;}
  .ph{flex-wrap:wrap;align-items:flex-start;}
  .ph .btn{width:100%;justify-content:center;}
  .tasklog-toolbar,.tasklog-section-head,.tasklog-result-summary{align-items:flex-start;}
  .filter-bar .fi,.filter-bar .btn{width:100%;max-width:none !important;}
  .drawer{padding:18px 14px 22px;max-height:94vh;border-radius:16px 16px 0 0;}
  .tasklog-columns>.report-card{min-height:auto;}
  #tasklogTaskList,#tasklogWorklogList{max-height:none;overflow:visible;padding-right:0;}
  .tasklog-empty{min-height:260px;}
  .tasklog-panel-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .dr-footer{flex-direction:column;}
  .dr-footer .btn{width:100%;justify-content:center;}
  .login-box{padding:28px 20px;}
}
@media(max-width:420px){
  .metric-grid{grid-template-columns:1fr;}
  .stats-row{grid-template-columns:1fr 1fr 1fr;gap:8px;}
  .stat-card,.mini-stat{padding:12px;}
}

/* 2026-06 全工作台界面细节统一：抽屉宽度、内容密度、表格与移动端抗溢出 */
.overlay.open{padding:0 18px;padding-top:max(20px,env(safe-area-inset-top,0px));}
.drawer{
  width:min(100%,var(--wb-drawer-w,760px));
  max-width:min(var(--wb-drawer-w,760px),calc(100vw - 36px));
  max-height:min(92dvh,920px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
  border:1px solid rgba(255,255,255,.7);
  box-shadow:0 -18px 48px rgba(15,40,25,.18),0 1px 0 rgba(255,255,255,.8) inset;
}
.drawer.wb-drawer-compact{--wb-drawer-w:560px;}
.drawer.wb-drawer-standard{--wb-drawer-w:760px;}
.drawer.wb-drawer-wide{--wb-drawer-w:1040px;}
.drawer.wb-drawer-data{--wb-drawer-w:1120px;}
#plotEditorDrawerContent.drawer{--wb-drawer-w:960px;}
.drawer > .drawer-title,
.drawer > form > .drawer-title{
  position:sticky;
  top:0;
  z-index:12;
  margin:0;
  padding:18px 20px 14px;
  background:linear-gradient(180deg,#fff,#f8fbf9);
  border-bottom:1px solid #e5eee8;
}
.drawer > .drawer-title > span:first-child{min-width:0;word-break:break-word;line-height:1.35;}
.drawer > .dr-body,
.drawer > form,
.drawer > .wb-health-empty,
.drawer > .wb-events-list,
.drawer > .card,
.drawer > p,
.drawer > .grid2,
.drawer > .fr,
.drawer > table,
.drawer > .tbl,
.drawer > .data-table,
.drawer > .report-grid,
.drawer > .diag-steps,
.drawer > #diagWizardContent,
.drawer > input[type="hidden"] ~ *{
  min-width:0;
}
.drawer > .dr-body,
.drawer > form,
.drawer > #diagWizardContent{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:18px 20px;
  -webkit-overflow-scrolling:touch;
}
.drawer > .dr-body.dr-body-preview,
.drawer > .dr-body:has(+ .dr-footer-preview){
  padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));
}
.wh-preview-scroll,
.wh-slip-preview-body{
  overflow-x:auto;
  overflow-y:visible;
  max-width:100%;
  -webkit-overflow-scrolling:touch;
}
.dr-footer-preview{
  flex-wrap:wrap;
  gap:8px;
}
.dr-footer-slip .btn{
  flex:1 1 calc(50% - 6px);
  min-width:0;
}
@media(max-width:720px){
  .drawer > .dr-body.dr-body-preview{
    padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));
  }
  .dr-footer-preview{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }
  .dr-footer-slip{
    grid-template-columns:1fr 1fr;
  }
  .dr-footer-slip label[for],
  .dr-footer-slip label[style*="margin-right:auto"]{
    grid-column:1 / -1;
    margin:0 0 4px!important;
  }
  .dr-footer-slip .btn{
    width:100%;
    flex:none;
  }
}
.drawer > .wb-cust-drawer{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0 20px 18px;
  -webkit-overflow-scrolling:touch;
}
.drawer > .wb-cust-drawer > .drawer-title{
  position:sticky;
  top:0;
  z-index:12;
  margin:0 -20px 16px;
  padding:18px 20px 14px;
  background:linear-gradient(180deg,#fff,#f8fbf9);
  border-bottom:1px solid #e5eee8;
}
.drawer > .wb-cust-drawer > .dr-footer{
  position:sticky;
  bottom:0;
  margin-left:-20px;
  margin-right:-20px;
}
.drawer > :not(.drawer-title):not(.dr-body):not(form):not(#diagWizardContent):not(.dr-footer){
  margin-left:20px;
  margin-right:20px;
}
.drawer > :not(.drawer-title):first-child{margin-top:18px;}
.drawer > :not(.drawer-title):last-child:not(.dr-footer){margin-bottom:20px;}
.drawer > form{display:block;}
.drawer > form > :not(.drawer-title):not(.dr-footer){margin-left:0;margin-right:0;}
.drawer .dr-body .card,
.drawer > .card{margin-bottom:12px;}
.drawer .grid2{gap:12px 14px;}
.drawer .fr{margin-bottom:12px;}
.drawer .subsec,
.drawer .fi-label{
  display:block;
  margin:14px 0 7px;
  color:#1a4d2e;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}
.drawer pre,
.drawer textarea[style*="monospace"],
.drawer textarea[id*="json"],
.drawer textarea[id*="JSON"]{
  background:#f7faf8!important;
  border:1px solid #dfeae3!important;
  border-radius:10px!important;
}
.drawer img{
  max-width:100%;
  height:auto;
}
.drawer .muted{
  line-height:1.65;
}
.drawer .btn + .btn,
.drawer a.btn + .btn,
.drawer .btn + a.btn{margin-left:0;}
.drawer .fi,
.drawer input,
.drawer select,
.drawer textarea{max-width:100%;min-width:0;}
.drawer textarea.fi{resize:vertical;}
.drawer .tbl,
.drawer .data-table,
.drawer .sf-table{width:100%;max-width:100%;}
.drawer.wb-drawer-data .dr-body,
.drawer.wb-drawer-wide .dr-body{overflow:auto;}
.drawer.wb-drawer-data table,
.drawer.wb-drawer-wide table{min-width:720px;}
.drawer.wb-drawer-compact .dr-body,
.drawer.wb-drawer-compact > form{padding-top:16px;}
.drawer.wb-drawer-compact .card{box-shadow:none;}
.drawer.wb-md-drawer > .dr-body.wb-md-quick-body{
  padding:18px 20px;
  overflow:auto;
  max-height:none;
}
.drawer.wb-md-drawer .wb-md-quick-split{
  display:flex!important;
  flex-direction:column!important;
  grid-template-columns:1fr!important;
  align-items:stretch!important;
  gap:14px;
}
.drawer.wb-md-drawer .wb-md-quick-map-card{
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  flex:0 0 auto!important;
  z-index:1;
}
.drawer.wb-md-drawer .wb-md-quick-form-card{
  width:100%!important;
  max-width:100%!important;
  z-index:3;
  overflow:visible;
}
.drawer.wb-md-drawer .wb-md-map-shell{
  width:100%!important;
  height:300px!important;
  min-height:300px!important;
  max-width:100%!important;
  overflow:hidden!important;
  clip-path:inset(0 round 12px);
  contain:layout paint size;
}
.drawer.wb-md-drawer #md_draw_map,
.drawer.wb-md-drawer #md_draw_map.leaflet-container{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  overflow:hidden!important;
  clip-path:inset(0 round 12px);
}
.drawer.wb-md-drawer #md_draw_map .leaflet-pane,
.drawer.wb-md-drawer #md_draw_map .leaflet-map-pane,
.drawer.wb-md-drawer #md_draw_map .leaflet-tile-pane,
.drawer.wb-md-drawer #md_draw_map .leaflet-overlay-pane{
  max-width:100%!important;
  max-height:100%!important;
}
.dr-footer,
.drawer > form > .dr-footer{
  position:sticky;
  bottom:0;
  z-index:12;
  margin:0;
  padding:14px 20px calc(14px + env(safe-area-inset-bottom,0px));
  background:linear-gradient(180deg,rgba(255,255,255,.88),#fff);
  border-top:1px solid #e5eee8;
  box-shadow:0 -10px 24px rgba(26,77,46,.06);
}
.dr-footer .btn{min-width:96px;}
.drawer-title-toolbar{min-width:0;}
.drawer-title-toolbar .btn-sm{border-radius:999px;}
.close-btn{border-radius:50%;background:#f2f5f3;color:#607267;transition:background .18s,color .18s,transform .18s;}
.close-btn:hover{background:#e4ece7;color:#1a4d2e;transform:none;}
.filter-bar,
.toolbar,
.row-btns,
.adm-nav-toolbar,
.tasklog-toolbar-main{
  min-width:0;
}
.filter-bar .fi,
.filter-bar .btn,
.toolbar .fi,
.toolbar .btn{min-width:0;}
.card,.report-card,.mini-stat,.stat-card{min-width:0;}
.tbl th,.tbl td,.data-table th,.data-table td,.sf-table th,.sf-table td{overflow-wrap:anywhere;}
.content,
.tab-content,
.card,
.report-card,
.dashboard-section,
.customer-panel,
.tasklog-panel{min-width:0;}
.home-stats-row,
.stats-row,
.metric-grid,
.report-grid,
.chart-grid,
.customer-card-grid,
.tasklog-panel-metrics,
.ledger-metric-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));
}
.home-table-wrap,
.customer-table-wrap,
.table-wrap,
.wh-table-scroll,
.sf-table-wrap,
.tasklog-table-wrap{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.home-table-wrap table,
.customer-table-wrap table,
.table-wrap table,
.wh-table-scroll table,
.sf-table-wrap table,
.tasklog-table-wrap table{min-width:720px;}
.ph,
.section-head,
.card-head,
.report-card-head,
.tasklog-section-head{min-width:0;gap:10px;}
.ph > *,
.section-head > *,
.card-head > *,
.report-card-head > *,
.tasklog-section-head > *{min-width:0;}
.ph .pt,
.section-head h2,
.card-head h2,
.report-card-head h2{overflow-wrap:anywhere;}
.wb-funnel-card{border-left:4px solid #1f8a5b;margin-bottom:14px;}
.wb-funnel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px;}
.wb-funnel-title{font-size:18px;font-weight:900;color:#173f2b;line-height:1.25;}
.wb-funnel-sub{font-size:12px;color:#66766c;line-height:1.55;}
.wb-funnel-head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;flex-shrink:0;}
.wb-funnel-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr));gap:10px;margin:12px 0;}
.wb-funnel-step{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left;border:1px solid #e0ece5;background:#fbfdfb;border-radius:12px;padding:12px;cursor:pointer;min-width:0;transition:background .18s,border-color .18s,transform .18s;}
.wb-funnel-step:hover{background:#f3faf5;border-color:#c8e2d0;transform:translateY(-1px);}
.wb-funnel-index{width:26px;height:26px;border-radius:50%;background:#e5f3e9;color:#1f6f46;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:900;flex-shrink:0;}
.wb-funnel-step-main{display:flex;flex-direction:column;gap:4px;min-width:0;}
.wb-funnel-step-main b{font-size:13px;color:#214936;line-height:1.25;overflow-wrap:anywhere;}
.wb-funnel-step-main small{font-size:11px;color:#7b8980;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.wb-funnel-step-main i{display:block;height:5px;background:#edf3ef;border-radius:999px;overflow:hidden;}
.wb-funnel-step-main em{display:block;height:100%;min-width:4px;background:linear-gradient(90deg,#2d7a4e,#d5a642);border-radius:inherit;}
.wb-funnel-count{font-size:22px;font-weight:900;color:#173f2b;line-height:1;}
.wb-funnel-amount{grid-column:2 / 4;font-size:12px;font-weight:800;color:#b47714;justify-self:end;}
.wb-funnel-body{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);gap:12px;margin-top:12px;}
.wb-funnel-panel{border:1px solid #e5eee8;border-radius:12px;padding:12px;background:#fff;}
.wb-funnel-panel h4{margin:0 0 10px;color:#294332;font-size:14px;}
.wb-funnel-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;border:1px solid #eef3ef;border-radius:10px;padding:10px;margin-bottom:8px;background:#fbfdfb;}
.wb-funnel-action.high{border-color:#f0d2c2;background:#fff8f4;}
.wb-funnel-action > div:first-child{cursor:pointer;min-width:0;}
.wb-funnel-action b{display:block;color:#294332;font-size:13px;line-height:1.35;}
.wb-funnel-action span{display:block;color:#7b8980;font-size:12px;line-height:1.45;margin-top:2px;}
.wb-funnel-action-side{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.wb-funnel-action-side strong{font-size:20px;color:#173f2b;}
.wb-funnel-action-side small{font-size:12px;color:#b47714;font-weight:800;}
.wb-funnel-recent{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;padding:9px 0;border-bottom:1px dashed #e2ebe6;cursor:pointer;}
.wb-funnel-recent:last-child{border-bottom:0;}
.wb-funnel-recent span{font-size:11px;color:#1f6f46;background:#eaf6ee;border-radius:999px;padding:3px 7px;white-space:nowrap;}
.wb-funnel-recent b{font-size:13px;color:#294332;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.wb-funnel-recent small{font-size:11px;color:#8a978f;white-space:nowrap;}
.wb-funnel-drawer-loading{padding:22px;text-align:center;color:#77887f;background:#f8fbf9;border:1px solid #e5eee8;border-radius:12px;}
.wb-funnel-items{display:flex;flex-direction:column;gap:10px;padding-bottom:8px;}
.wb-funnel-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;border:1px solid #e5eee8;border-radius:12px;background:#fff;padding:12px;}
.wb-funnel-item-main{min-width:0;}
.wb-funnel-item-main > div{display:flex;align-items:center;gap:8px;min-width:0;}
.wb-funnel-item-main b{font-size:14px;color:#243f30;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.wb-funnel-item-main p{margin:6px 0 2px;color:#66766c;font-size:12px;line-height:1.45;overflow-wrap:anywhere;}
.wb-funnel-item-main small{color:#8a978f;font-size:11px;line-height:1.4;}
.wb-funnel-item-type{font-size:11px;color:#1f6f46;background:#eaf6ee;border-radius:999px;padding:3px 7px;white-space:nowrap;flex-shrink:0;}
.wb-funnel-item-side{display:flex;align-items:center;gap:8px;justify-content:flex-end;flex-wrap:wrap;}
.wb-funnel-item-side strong{font-size:13px;color:#b47714;white-space:nowrap;}
.sf-sub-summary{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-width:220px;
}
.sf-sub-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  max-width:260px;
  padding:5px 8px;
  border-radius:999px;
  background:#f2f8f4;
  color:#50665a;
  font-size:12px;
  line-height:1.35;
}
.sf-sub-chip b{color:#1a4d2e;font-weight:800;}
.sf-file-link{
  display:inline-flex;
  align-items:center;
  max-width:260px;
  margin:2px 6px 2px 0;
  padding:5px 8px;
  border-radius:999px;
  background:#e8f5ec;
  color:#1a4d2e;
  text-decoration:none;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sf-sub-detail-head{
  display:grid;
  gap:4px;
  padding:12px;
  margin-bottom:12px;
  border:1px solid #e1ece5;
  border-radius:12px;
  background:#fbfdfb;
}
.sf-sub-detail-head b{font-size:16px;color:#1a4d2e;}
.sf-sub-detail-head span,.sf-sub-detail-head small{color:#66766c;font-size:12px;}
.sf-sub-detail-table th{
  width:160px;
  color:#1a4d2e;
  background:#f7fbf8;
}
.row-btns,
.toolbar,
.filter-bar,
.drawer-title-toolbar{align-items:center;}
.row-btns .btn,
.toolbar .btn,
.filter-bar .btn{flex-shrink:0;}
@media(min-width:901px){
  .drawer.wb-drawer-wide .grid2,
  .drawer.wb-drawer-data .grid2{grid-template-columns:repeat(2,minmax(0,1fr));}
  .drawer.wb-drawer-compact .grid2{grid-template-columns:1fr;}
}
@media(max-width:900px){
  .overlay.open{padding:0;align-items:flex-end;}
  .drawer,
  #drawerContent.drawer,
  #mapPickerDrawerContent.drawer,
  #plotEditorDrawerContent.drawer{
    width:100%!important;
    max-width:100%!important;
    height:auto;
    max-height:min(94dvh,920px);
    border-radius:20px 20px 0 0;
    border-left:0;
    border-right:0;
  }
  .drawer > .drawer-title,
  .drawer > form > .drawer-title{padding:16px 16px 12px;}
  .drawer > .dr-body,
  .drawer > form,
  .drawer > #diagWizardContent{padding:16px;}
  .drawer > .wb-cust-drawer{padding:0 16px 16px;}
  .drawer > .wb-cust-drawer > .drawer-title{margin-left:-16px;margin-right:-16px;padding:16px 16px 12px;}
  .drawer > .wb-cust-drawer > .dr-footer{margin-left:-16px;margin-right:-16px;}
  .drawer > .wb-cust-drawer,
  .drawer > .wb-cust-drawer.wb-cust-360,
  .drawer > .wb-cust-360{
    margin-left:0!important;
    margin-right:0!important;
    padding:0!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box;
  }
  .drawer > :not(.drawer-title):not(.dr-body):not(form):not(#diagWizardContent):not(.dr-footer):not(.wb-qr-drawer-body):not(.wb-cust-drawer):not(.wb-cust-360){
    margin-left:16px;
    margin-right:16px;
  }
  .drawer .grid2{grid-template-columns:1fr!important;}
  .drawer.wb-md-drawer > .dr-body.wb-md-quick-body{padding:16px;}
  .drawer.wb-md-drawer .wb-md-quick-split{display:flex!important;flex-direction:column!important;grid-template-columns:1fr!important;}
  .drawer.wb-md-drawer .wb-md-quick-map-card{height:auto;max-height:none;}
  .drawer.wb-md-drawer .wb-md-map-shell{height:240px!important;min-height:240px!important;flex:none;}
  .drawer.wb-md-drawer .wb-md-quick-form-card{max-height:none;overflow:visible;}
  .wb-funnel-head{flex-direction:column;}
  .wb-funnel-head-actions{justify-content:flex-start;width:100%;}
  .wb-funnel-body{grid-template-columns:1fr;}
  .wb-funnel-action{grid-template-columns:1fr;}
  .wb-funnel-action-side{justify-content:flex-start;}
  .wb-funnel-item{grid-template-columns:1fr;}
  .wb-funnel-item-side{justify-content:flex-start;}
  .content{padding-left:12px;padding-right:12px;}
  .ph,
  .section-head,
  .card-head,
  .report-card-head,
  .tasklog-section-head{align-items:flex-start;flex-wrap:wrap;}
  .row-btns,
  .toolbar,
  .filter-bar,
  .drawer-title-toolbar{width:100%;flex-wrap:wrap;}
  .row-btns .btn,
  .toolbar .btn,
  .filter-bar .btn{flex:1 1 140px;}
  .home-table-wrap table,
  .customer-table-wrap table,
  .table-wrap table,
  .wh-table-scroll table,
  .sf-table-wrap table,
  .tasklog-table-wrap table{min-width:640px;}
}
@media(max-width:600px){
  .drawer > .drawer-title,
  .drawer > form > .drawer-title{font-size:16px;align-items:flex-start;}
  .drawer-title-toolbar{width:100%;margin-left:0;justify-content:flex-start;flex-wrap:wrap;overflow:visible;}
  .drawer-title-toolbar .btn-sm,
  .drawer-title-toolbar .wb-tb-dd{flex:1 1 calc(50% - 6px);max-width:none;}
  .dr-footer{display:grid;grid-template-columns:1fr;gap:8px;}
  .dr-footer .btn{width:100%;min-width:0;}
  .drawer.wb-drawer-data table,
  .drawer.wb-drawer-wide table{min-width:640px;}
  .home-stats-row,
  .stats-row,
  .metric-grid,
  .report-grid,
  .chart-grid,
  .customer-card-grid,
  .tasklog-panel-metrics,
  .ledger-metric-grid{grid-template-columns:1fr!important;}
  .wb-funnel-step{grid-template-columns:auto minmax(0,1fr) auto;}
  .wb-funnel-step-main small{white-space:normal;}
  .wb-funnel-recent{grid-template-columns:auto minmax(0,1fr);}
  .wb-funnel-recent small{grid-column:2;color:#8a978f;}
  .row-btns .btn,
  .toolbar .btn,
  .filter-bar .btn{flex-basis:100%;}
}


/* ── 2026 优化：手机端工作台作为轻量 App 使用 ── */
@media(max-width:680px){
  .app{background:#f3f8f5;}
  .hdr{box-shadow:0 4px 18px rgba(0,0,0,.14);}
  .tabs{position:sticky;top:52px;z-index:90;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--border);}
  .tab{border-radius:10px;margin:6px 2px;border-bottom:0;background:#f2f7f4;color:#496052;}
  .tab.active{background:#e5f2e9;color:var(--green);box-shadow:inset 0 0 0 1px #cfe5d5;}
  .content{padding-bottom:calc(18px + env(safe-area-inset-bottom,0px));}
  .card{border-radius:16px;box-shadow:0 4px 18px rgba(26,77,46,.07);}
  .filter-bar,.row-btns,.toolbar{gap:8px;}
  .btn,.btn-sm,.fi,select,textarea,input{font-size:16px;}
  .btn-sm{min-height:38px;}
  .table-wrap,.wh-table-scroll,.customer-table-wrap,.home-table-wrap{border-radius:12px;}
}

/* 客户码 QR 抽屉 + 移动端布局修正 */
.wb-qr-drawer-body{padding:0 16px 20px;max-width:100%;box-sizing:border-box;}
.wb-qr-card{display:flex;flex-direction:column;align-items:center;padding:16px 12px;background:#fff;border:1px solid #e8efe8;border-radius:14px;margin:0 auto;max-width:280px;}
.wb-qr-img{border-radius:10px;background:#fff;}
.wb-qr-cust-name{margin:10px 0 2px;font-size:17px;font-weight:700;color:#1a4d2e;text-align:center;line-height:1.35;}
.wb-qr-hint{margin:0;font-size:12px;text-align:center;}
.wb-qr-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;}
.wb-qr-actions .btn{flex:1 1 calc(50% - 8px);min-width:120px;justify-content:center;}
.drawer.wb-drawer-compact > .wb-qr-drawer-body{margin-left:0!important;margin-right:0!important;}
@media(max-width:900px){
  .overlay.open{padding:0!important;padding-top:max(0px,env(safe-area-inset-top,0px))!important;}
  #drawerContent.wb-cust-360-drawer{width:100%!important;max-width:100%!important;border-radius:0;margin:0!important;padding:0!important;}
  .wb-c360-tabs{padding-left:12px;padding-right:12px;}
  .wb-c360-panels{padding-left:12px;padding-right:12px;}
  .wb-c360-mobile-topbar{padding-left:12px;padding-right:12px;}
}
@media(max-width:768px){
  .overlay.open{padding:0!important;}
  .drawer{width:100%!important;max-width:100%!important;border-radius:20px 20px 0 0;}
  .drawer > :not(.drawer-title):not(.dr-body):not(form):not(#diagWizardContent):not(.dr-footer):not(.wb-qr-drawer-body){
    margin-left:12px;margin-right:12px;
  }
  .tabs .tab-wb-secondary{display:none!important;}
  .tabs .tab-wb-more{display:flex!important;}
  .wb-more-modules-btn{display:inline-flex!important;}
}
@media(min-width:769px){
  .tabs .tab-wb-more{display:none!important;}
  .wb-more-modules-btn{display:none!important;}
}
.wb-more-modules-btn{display:none;}
.wb-more-sheet-overlay{
  position:fixed;inset:0;z-index:200;background:rgba(15,40,25,.45);
  display:flex;align-items:flex-end;justify-content:center;
  opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s;
}
.wb-more-sheet-overlay.open{opacity:1;visibility:visible;}
.wb-more-sheet{
  width:100%;max-width:520px;max-height:min(78vh,640px);
  background:#fff;border-radius:20px 20px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));
  box-shadow:0 -8px 32px rgba(0,0,0,.15);overflow:auto;
  transform:translateY(100%);transition:transform .25s ease;
}
.wb-more-sheet-overlay.open .wb-more-sheet{transform:translateY(0);}
.wb-more-sheet-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-size:16px;color:var(--green);}
.wb-more-sheet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.wb-more-mod-card{
  border:1px solid var(--border);border-radius:12px;background:#fafcfa;
  padding:12px 8px;text-align:center;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:4px;min-height:88px;
}
.wb-more-mod-card:active{background:#eef6f0;}
.wb-more-mod-ic{font-size:22px;line-height:1;}
.wb-more-mod-title{font-size:12px;font-weight:700;color:var(--green);}
.wb-more-mod-desc{font-size:10px;color:#888;line-height:1.3;}
body.wb-more-sheet-open{overflow:hidden;}
