/* ============================================================
   公司一体化平台 · iOS 风格主题 (v1.0 / 2026-10-04)
   设计语言:Apple HIG — 系统色 / 毛玻璃 / 圆角卡片 / 克制留白
   类名保持与旧版一致,仅视觉重写,不影响业务逻辑
   ============================================================ */

:root {
  /* 系统色 */
  --blue: #007aff;
  --blue-dark: #0062cc;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;
  --pink: #ff2d55;

  /* 层次背景 */
  --bg: #f2f2f7;
  --card: #ffffff;
  --sidebar: rgba(249, 249, 250, 0.78);

  /* 文字层级 */
  --label: #1c1c1e;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.34);

  /* 线条与填充 */
  --separator: rgba(60, 60, 67, 0.11);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.08);

  /* 圆角 */
  --r-s: 8px;
  --r: 12px;
  --r-m: 14px;
  --r-l: 18px;

  /* 阴影:多层、极淡 */
  --sh-s: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sh: 0 1px 3px rgba(0, 0, 0, 0.03), 0 8px 22px -10px rgba(0, 0, 0, 0.1);
  --sh-l: 0 24px 60px -16px rgba(0, 0, 0, 0.24);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(0, 122, 255, 0.2); }

/* 细滚动条(轨道透明) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 120, 128, 0.24); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 120, 128, 0.4); }

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 12% -10%, rgba(0, 122, 255, 0.16), transparent 62%),
    radial-gradient(880px 520px at 92% 8%, rgba(175, 82, 222, 0.14), transparent 60%),
    linear-gradient(180deg, #fbfbfd 0%, #f2f2f7 100%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 40px 32px 32px;
  box-shadow: var(--sh-l);
  animation: rise 0.5s var(--ease) both;
}
.login-card h1 { font-size: 24px; font-weight: 700; text-align: center; letter-spacing: -0.02em; color: var(--label); }
.login-card .sub { text-align: center; color: var(--label-2); font-size: 13px; margin: 6px 0 26px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--label-2); margin-bottom: 7px; padding-left: 2px; }
.login-card input {
  width: 100%; padding: 13px 16px; font-size: 15px; outline: none;
  background: var(--fill-2);
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.login-card input:focus {
  background: #fff; border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.16);
}
.login-card .btn { width: 100%; margin-top: 8px; padding: 14px; font-size: 15px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--label-3); text-align: center; line-height: 1.7; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }

/* 侧边栏:iPadOS 式浅色毛玻璃 */
.sidebar {
  width: 236px; flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border-right: 1px solid var(--separator);
}
.sidebar .logo { padding: 22px 20px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.sidebar .logo-text { min-width: 0; }
/* 收起/展开按钮(老板 2026-10-06) */
.side-toggle {
  cursor: pointer; color: var(--label-3); font-size: 13px; line-height: 1;
  padding: 5px 7px; border-radius: 6px; user-select: none; flex-shrink: 0;
}
.side-toggle:hover { background: var(--fill-2); color: var(--label); }
.sidebar .logo h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--label);
}
.sidebar .logo p { font-size: 11.5px; color: var(--label-3); margin-top: 3px; }
.sidebar nav { flex: 1; padding: 2px 10px 14px; overflow-y: auto; }

/* 一级:业务板块(可折叠分组) */
.sidebar .nav-group { margin-bottom: 1px; }
.sidebar .nav-group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-s);
  color: #000; font-size: 15px; font-weight: 600;   /* 老板 2026-10-07:菜单不要灰色,用黑色;字体调大 */
  cursor: pointer; user-select: none;
  transition: background 0.18s, color 0.18s;
}
.sidebar .nav-group-head:hover { background: var(--fill-2); color: #000; }
.sidebar .nav-group-head.on { color: #000; }
.sidebar .nav-group-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar .nav-group-label { flex: 1; }
.sidebar .nav-arrow {
  font-size: 11px; color: #333;
  transition: transform 0.24s var(--ease); transform: rotate(-90deg);
}
.sidebar .nav-arrow.open { transform: rotate(0deg); }

/* 二级:具体功能 — 选中态用 iOS 药丸高亮(非左边框) */
.sidebar .nav-group-body { padding: 1px 0 5px; }
.sidebar .nav-group-body a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 14px; margin: 1px 0;
  border-radius: var(--r-s);
  color: #000; font-size: 15px; font-weight: 500;   /* 老板 2026-10-07:菜单不要灰色,用黑色;字体调大 */
  transition: background 0.18s, color 0.18s;
}
.sidebar .nav-group-body a:hover { background: var(--fill-2); color: #000; }
.sidebar .nav-group-body a.active {
  background: rgba(0, 122, 255, 0.13); color: var(--blue); font-weight: 600;
}
.sidebar .nav-group-body a .nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #666; flex-shrink: 0; transition: background 0.18s, transform 0.18s;
}
.sidebar .nav-group-body a.active .nav-dot { background: var(--blue); transform: scale(1.15); }

/* 底部用户信息卡 */
.sidebar .user-box {
  margin: 0 10px 12px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--separator);
  border-radius: var(--r-m);
  font-size: 13px;
}
.sidebar .user-box .name { color: var(--label); font-weight: 600; }
.sidebar .user-box .role { color: var(--label-3); font-size: 11.5px; margin-top: 1px; }
.sidebar .logout {
  display: inline-block; margin-top: 9px; color: var(--red);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: opacity 0.18s;
}
.sidebar .logout:hover { opacity: 0.7; }

/* 主内容区 */
.main { flex: 1; min-width: 0; padding: 28px 30px 44px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; color: var(--label); margin-bottom: 4px; }
.page-sub { color: var(--label-2); font-size: 13.5px; margin-bottom: 22px; }

/* ===== 卡片与通用 ===== */
.card {
  background: var(--card);
  border-radius: var(--r-l);
  padding: 20px 22px;
  box-shadow: var(--sh);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 14px; color: var(--label); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 17px; border: none; border-radius: var(--r);
  font-size: 14px; font-weight: 590; letter-spacing: -0.01em;
  background: var(--blue); color: #fff;
  transition: transform 0.16s var(--ease), background 0.18s, opacity 0.18s, box-shadow 0.18s;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.24);
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: scale(0.965); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-green { background: var(--green); box-shadow: 0 1px 2px rgba(52, 199, 89, 0.24); }
.btn-green:hover { background: #2fb350; }
.btn-red { background: var(--red); box-shadow: 0 1px 2px rgba(255, 59, 48, 0.24); }
.btn-red:hover { background: #e0342a; }
.btn-gray { background: #8e8e93; box-shadow: none; }
.btn-gray:hover { background: #7c7c81; }
/* 次级:iOS tinted 按钮 */
.btn-ghost { background: var(--fill); color: var(--blue); box-shadow: none; }
.btn-ghost:hover { background: rgba(120, 120, 128, 0.18); color: var(--blue-dark); }
/* 描边按钮 */
.btn-outline {
  background: transparent; color: var(--blue);
  border: 1.5px solid rgba(0, 122, 255, 0.28); box-shadow: none;
}
.btn-outline:hover { background: rgba(0, 122, 255, 0.08); border-color: rgba(0, 122, 255, 0.5); }

/* 标签 */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 590; letter-spacing: -0.005em;
}
.tag-blue { background: rgba(0, 122, 255, 0.13); color: #0062cc; }
.tag-green { background: rgba(52, 199, 89, 0.15); color: #1e8f3f; }
.tag-red { background: rgba(255, 59, 48, 0.13); color: #d02b21; }
.tag-gray { background: var(--fill); color: var(--label-2); }
.tag-amber { background: rgba(255, 149, 0, 0.15); color: #b26a00; }
.tag-orange { background: rgba(255, 149, 0, 0.15); color: #c26a00; }
.tag-purple { background: rgba(175, 82, 222, 0.14); color: #8b3fb8; }

/* ===== 表格(inset grouped 风格) ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 8px 12px;
  font-size: 11.5px; font-weight: 600; color: var(--label-2);
  text-transform: none; letter-spacing: 0.01em;
  background: transparent;
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px; font-size: 13.5px; color: var(--label);
  border-bottom: 1px solid var(--separator);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--fill-2); }
.table .empty { text-align: center; color: var(--label-3); padding: 36px 0; font-size: 13px; }
/* 可排序表头 */
.table th.th-sort { cursor: pointer; user-select: none; transition: color 0.18s; }
.table th.th-sort:hover { color: var(--blue); }
.table th.th-sort i { font-style: normal; font-size: 10px; color: var(--blue); }

/* 数值着色(ROI 等) */
.text-green { color: var(--green) !important; }
.text-amber { color: var(--orange) !important; }
.text-red { color: var(--red) !important; }
/* 未打标签的可点击占位 */
.tag-edit { color: var(--label-3); font-size: 12px; cursor: pointer; transition: color 0.18s; }
.tag-edit:hover { color: var(--blue); }

/* ===== 按运营细分:行可点开看该运营的账户 ===== */
.op-row { cursor: pointer; }
.op-row:hover td { background: var(--fill-2); }
.op-toggle {
  display: inline-block; width: 16px; color: var(--label-3);
  font-size: 11px; transition: transform 0.18s var(--ease), color 0.18s;
}
.op-toggle.open { transform: rotate(90deg); color: var(--blue); }
.op-sub td { background: rgba(120, 120, 128, 0.055); font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.op-sub:hover td { background: rgba(120, 120, 128, 0.09); }
.op-sub-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--label-2); }

/* ===== 共享钱包余额条 ===== */
.wallet-strip {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; margin-bottom: 13px;
  border-radius: var(--r-m);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.105), rgba(0, 122, 255, 0.04));
  border: 1px solid rgba(0, 122, 255, 0.16);
}
.wallet-strip .wallet-ico { font-size: 17px; flex-shrink: 0; }
.wallet-strip .wallet-mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet-strip .wallet-name { font-size: 13.5px; font-weight: 650; color: var(--label); }
.wallet-strip .wallet-sub { font-size: 11.5px; color: var(--label-2); line-height: 1.5; }
.wallet-strip .wallet-bal { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.wallet-strip .wallet-bal-num {
  font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--blue); font-variant-numeric: tabular-nums;
}
.wallet-strip .wallet-bal-label { font-size: 11px; color: var(--label-2); }
.wallet-strip.multi { align-items: flex-start; }

/* ===== 未标记账户提醒 ===== */
.untagged-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; margin-bottom: 14px;
  border-radius: var(--r-m);
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.13), rgba(255, 149, 0, 0.05));
  border: 1px solid rgba(255, 149, 0, 0.3);
}
.untagged-alert .ua-ico { font-size: 17px; flex-shrink: 0; }
.untagged-alert .ua-text { font-size: 12.5px; color: var(--label); line-height: 1.55; min-width: 0; }
.untagged-alert .ua-text b { color: #b26a00; }
.untagged-alert .ua-btn {
  margin-left: auto; flex-shrink: 0;
  background: var(--orange); color: #fff; box-shadow: none;
}
.untagged-alert .ua-btn:hover { background: #e08600; }

/* 未标记账户卡:琥珀色强调,新账户一眼可见 */
.biz-card.untagged { border: 1px solid rgba(255, 149, 0, 0.32); }
.biz-card.untagged .biz-name { color: #b26a00; }
.untagged-tip { font-size: 11.5px; color: var(--label-2); margin: -6px 0 12px; line-height: 1.6; }

/* ===== 统计数字卡 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border-radius: var(--r-l); padding: 18px 20px;
  box-shadow: var(--sh);
}
.stat-card .label { font-size: 12.5px; color: var(--label-2); font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; color: var(--label); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.amber { color: var(--orange); }
.stat-card .value.orange { color: #f97316; }

/* ===== P0:订单分配 / 线索池 / 团队看板 ===== */
.mini-stat {
  background: var(--card); border: 1px solid var(--separator);
  border-radius: var(--r-m); padding: 14px 16px;
}
.mini-num { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--label); margin: 4px 0 2px; }
.mini-num.red { color: var(--red); }
.pool-cell {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--fill-2); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px;
}
.pool-cell b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.rowsel { background: rgba(0, 122, 255, 0.08) !important; }

/* ===== 工作台 ===== */
.wb-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.order-card-big { border: 1px solid var(--separator); border-radius: var(--r-l); padding: 24px; background: var(--card); }
.order-card-big .o-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.order-card-big .o-name { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; }
.order-card-big .o-phone { font-size: 25px; font-weight: 700; color: var(--label); letter-spacing: 0.5px; margin: 8px 0 6px; }
.order-card-big .o-meta { color: var(--label-2); font-size: 14.5px; font-weight: 500; line-height: 1.9; }
.order-card-big .o-product {
  margin-top: 14px; background: var(--fill-2); border-radius: var(--r); padding: 14px 16px;
  font-size: 15.5px; font-weight: 600;
}
.result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.result-btns .btn { padding: 13px; font-size: 15px; font-weight: 600; }
.wb-side .my-order {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--separator); font-size: 13.5px;
}
.wb-side .my-order:last-child { border-bottom: none; }

/* 回拨待办卡片 */
.my-order {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; border: 1px solid var(--separator); border-radius: var(--r-m);
  background: var(--fill-2); font-size: 13.5px;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.my-order:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.my-order.recall-warn {
  background: rgba(255, 149, 0, 0.1); border-color: rgba(255, 149, 0, 0.4);
}
.my-order.recall-warn:hover { box-shadow: 0 4px 14px -4px rgba(255, 149, 0, 0.4); }
/* 未接通:红色高亮,提醒优先回拨 */
.my-order.recall-unreached {
  background: rgba(255, 59, 48, 0.08); border-color: rgba(255, 59, 48, 0.35);
}
.my-order.recall-unreached:hover { box-shadow: 0 4px 14px -4px rgba(255, 59, 48, 0.35); }
tr.recall-unreached td { background: rgba(255, 59, 48, 0.07) !important; }
tr.recall-unreached:hover td { background: rgba(255, 59, 48, 0.12) !important; }
tr.recall-warn td { background: rgba(255, 149, 0, 0.1) !important; }
tr.recall-warn:hover td { background: rgba(255, 149, 0, 0.16) !important; }

.wb-empty { text-align: center; color: var(--label-3); padding: 48px 0; }
.wb-empty .icon { font-size: 42px; margin-bottom: 12px; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select {
  padding: 9px 13px; font-size: 13.5px; outline: none;
  background: var(--card); color: var(--label);
  border: 1px solid var(--separator); border-radius: var(--r);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}
.filter-bar .spacer { flex: 1; }

/* ===== 看板 ===== */
.funnel { display: flex; align-items: flex-end; gap: 40px; padding: 10px 4px; }
.funnel .f-item { text-align: center; }
.funnel .f-bar { width: 70px; border-radius: 8px 8px 3px 3px; margin: 0 auto; }
.funnel .f-num { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.funnel .f-label { font-size: 12px; color: var(--label-2); margin-top: 8px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-row .b-label { width: 60px; color: var(--label-2); flex-shrink: 0; }
.bar-row .b-track { flex: 1; background: var(--fill); border-radius: 999px; height: 20px; overflow: hidden; }
.bar-row .b-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4aa3ff, var(--blue));
  transition: width 0.4s var(--ease);
}
.bar-row .b-num { width: 80px; text-align: right; color: var(--label-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }

.rank-list .rank-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--separator);
}
.rank-list .rank-item:last-child { border-bottom: none; }
.rank-item .rank-no {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--fill); color: var(--label-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-no { background: rgba(255, 204, 0, 0.22); color: #b58900; }
.rank-item:nth-child(2) .rank-no { background: rgba(142, 142, 147, 0.2); color: #6c6c70; }
.rank-item:nth-child(3) .rank-no { background: rgba(255, 149, 0, 0.18); color: #b26a00; }

.rank-item-cmp { align-items: stretch; }
.rank-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.rank-bar-row .rk-label { width: 30px; color: var(--label-3); flex-shrink: 0; }
.rank-bar-row .b-track { flex: 1; background: var(--fill); border-radius: 999px; height: 9px; overflow: hidden; }
.rank-bar-row .b-fill { height: 100%; border-radius: 999px; }
.rank-bar-row .rk-val { width: 34px; text-align: right; color: var(--label-2); font-weight: 600; flex-shrink: 0; }

/* 分段控件(iOS Segmented Control) */
.seg {
  display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px;
}
.seg-btn {
  padding: 5px 13px; font-size: 12.5px; font-weight: 550; color: var(--label-2);
  border-radius: 8px; cursor: pointer; user-select: none;
  transition: background 0.2s var(--ease), color 0.2s, box-shadow 0.2s;
}
.seg-btn:hover { color: var(--label); }
.seg-btn.on {
  background: var(--card); color: var(--label); font-weight: 640;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* ===== 进度 / 提示 ===== */
.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.35s var(--ease); }

.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 13.5px; font-weight: 550; letter-spacing: -0.01em;
  z-index: 999; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0; transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(255, 59, 48, 0.9); }

/* ===== 表单字段 / 弹窗 / 分页 ===== */
.card .field { margin-bottom: 14px; }
.card .field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--label-2); margin-bottom: 7px; }
.card .field input, .card .field textarea {
  width: 100%; padding: 10px 13px; font-size: 13.5px; outline: none;
  background: var(--fill-2); color: var(--label);
  border: 1px solid transparent; border-radius: var(--r);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card .field input:focus, .card .field textarea:focus {
  background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}
.card .field .hint { font-size: 12px; color: var(--label-3); margin-top: 6px; }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade 0.22s var(--ease) both;
}
.modal {
  background: var(--card); border-radius: 22px; padding: 24px;
  width: 100%; max-width: 460px;
  box-shadow: var(--sh-l);
  animation: pop 0.3s var(--ease) both;
}
.modal-title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; color: var(--label); margin-bottom: 18px; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-row label { width: 70px; flex: none; font-size: 13px; color: var(--label-2); font-weight: 500; }
.form-row input, .form-row select {
  flex: 1; padding: 9px 12px; font-size: 13.5px; outline: none;
  background: var(--fill-2); color: var(--label);
  border: 1px solid transparent; border-radius: var(--r);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.form-row input:focus, .form-row select:focus {
  background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
/* 删除类确认:必须手动输入「确认」两个字(老板 2026-10-04 23:3x) */
.del-warn {
  margin: 4px 0 2px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 59, 48, 0.08); border: 1px solid rgba(255, 59, 48, 0.22);
  font-size: 12.5px; line-height: 1.65; color: #d02b21;
}
.del-warn b { color: #b71c1c; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 14px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ===== 服务器状态页 ===== */
.bar-sub { font-size: 12px; color: var(--label-3); margin: -6px 0 10px 70px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.sys-item label { display: block; font-size: 12px; color: var(--label-3); margin-bottom: 4px; }
.sys-item span { font-size: 13.5px; color: var(--label); font-weight: 600; word-break: break-all; }

/* ===== 通用网格 ===== */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.page { display: block; }

/* ===== 手动收起侧栏(老板 2026-10-06):收成 68px 图标栏,复用响应式那套规则 ===== */
.sidebar { transition: width .18s ease; }
.side-collapsed .sidebar { width: 68px; }
.side-collapsed .sidebar .logo { padding: 18px 0 12px; justify-content: center; }
.side-collapsed .sidebar .logo-text { display: none; }
.side-collapsed .sidebar nav { padding: 2px 6px 14px; }
.side-collapsed .sidebar .nav-group-head { justify-content: center; padding: 10px 0; gap: 0; }
.side-collapsed .sidebar .nav-group-label, .side-collapsed .sidebar .nav-arrow { display: none; }
.side-collapsed .sidebar .nav-group-icon { width: auto; font-size: 18px; }
.side-collapsed .sidebar .nav-group-body a { justify-content: center; padding: 10px 0; gap: 0; }
.side-collapsed .sidebar .nav-text { display: none; }
.side-collapsed .sidebar .nav-group-body a .nav-dot { width: 7px; height: 7px; }
.side-collapsed .sidebar .user-box { display: none; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .wb-grid { grid-template-columns: 1fr; }
  .sidebar { width: 68px; }
  .sidebar .logo h2, .sidebar .logo p { display: none; }
  .sidebar .logo { padding: 18px 0; text-align: center; }
  .sidebar nav { padding: 2px 6px 14px; }
  .sidebar .nav-group-head { justify-content: center; padding: 10px 0; gap: 0; }
  .sidebar .nav-group-label, .sidebar .nav-arrow { display: none; }
  .sidebar .nav-group-icon { width: auto; font-size: 18px; }
  .sidebar .nav-group-body a { justify-content: center; padding: 10px 0; gap: 0; }
  .sidebar .nav-text { display: none; }
  .sidebar .nav-group-body a .nav-dot { width: 7px; height: 7px; }
  .sidebar .user-box { display: none; }
  .main { padding: 18px 16px 32px; }
  .page-title { font-size: 22px; }
}

/* 窄屏(手机):明细表横向滚动不换行 */
@media (max-width: 640px) {
  .biz-detail { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .biz-detail .table { min-width: 560px; }
  .biz-detail .table th, .biz-detail .table td { white-space: nowrap; }
  .biz-tabs { flex-wrap: wrap; }
  .biz-card .card-head { flex-wrap: wrap; gap: 6px; }
  .result-btns { grid-template-columns: 1fr; }
  /* 日期工具栏:窄屏换行,否则 3 按钮 + 2 日期框 + 查询 会顶出屏幕 */
  .biz-head { margin-bottom: 14px; }
  .biz-tools { flex-wrap: wrap; row-gap: 8px; }
  .biz-date { width: 128px; }
  .untagged-alert { flex-wrap: wrap; }
  .untagged-alert .ua-btn { margin-left: 0; }
}

/* ===== 离线降级提示 ===== */
.offline-box {
  text-align: center; padding: 32px 14px; color: var(--label-2);
  background: var(--fill-2); border: 1px dashed rgba(120, 120, 128, 0.28);
  border-radius: var(--r-m);
  font-size: 14px; font-weight: 550; line-height: 1.8; margin-top: 8px;
}
.offline-box span { font-size: 12px; color: var(--label-3); font-weight: 400; }

/* ===== 广告部工作台 ===== */
.adwork-tabs {
  display: flex; align-items: center; gap: 4px;
  background: var(--fill); border-radius: var(--r);
  padding: 3px; margin-bottom: 14px; border-bottom: none;
}
.adwork-tabs button {
  border: none; background: none; padding: 8px 16px; font-size: 13.5px; font-weight: 550;
  color: var(--label-2); cursor: pointer; border-radius: 10px;
  transition: background 0.2s var(--ease), color 0.2s, box-shadow 0.2s;
}
.adwork-tabs button.active {
  color: var(--label); background: var(--card); font-weight: 640;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.adwork-open { margin-left: auto; margin-right: 10px; font-size: 12.5px; color: var(--blue); font-weight: 500; }
.adwork-frame {
  width: 100%; height: calc(100vh - 230px); min-height: 480px;
  border: none; display: block; background: var(--card); border-radius: var(--r);
}

/* ===== 部门占位页 ===== */
.dept-hero {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.92) 0%, rgba(175, 82, 222, 0.88) 100%);
  border-radius: var(--r-l); padding: 40px 32px; color: #fff; margin-bottom: 20px; text-align: center;
  box-shadow: 0 16px 40px -16px rgba(0, 122, 255, 0.5);
}
.dept-hero .dept-icon { font-size: 46px; margin-bottom: 10px; }
.dept-hero h2 { margin: 0 0 8px; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.dept-hero .dept-sub { margin: 0; opacity: 0.92; font-size: 14px; }
.dept-plan { list-style: none; padding: 0; margin: 0; }
.dept-plan li { padding: 9px 0; border-bottom: 1px solid var(--separator); font-size: 14px; }
.dept-plan li:last-child { border-bottom: none; }

/* ===== 业务数据汇总域(biz) ===== */
.biz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.biz-head .page-title { margin-bottom: 3px; }
.biz-tools { display: flex; align-items: center; gap: 8px; }
.biz-date {
  padding: 8px 12px; font-size: 13px; color: var(--label);
  background: var(--card); border: 1px solid var(--separator); border-radius: var(--r);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.biz-date:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14); }
.biz-tilde { color: var(--label-3); font-size: 13px; }

/* 数据新鲜度条:数据更新于 xx / 自动同步开关 */
.biz-syncbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -6px 0 14px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--separator); border-radius: var(--r);
  font-size: 12.5px; color: var(--label-2);
}
.biz-syncbar b { color: var(--label-1); font-weight: 600; }
.biz-syncbar .sync-sep { color: var(--label-3); }
.biz-syncbar .sync-toggle { margin-left: auto; }
.biz-syncbar.err { color: #D02B21; border-color: rgba(208, 43, 33, 0.3); }
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--label-3);
}
.sync-dot.on { background: #1DA84C; box-shadow: 0 0 0 3px rgba(29, 168, 76, 0.15); }
.sync-dot.off { background: #C7C7CC; }

.biz-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.biz-tab {
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 550;
  cursor: pointer; user-select: none;
  background: var(--card); color: var(--label-2);
  border: 1px solid var(--separator);
  transition: background 0.2s var(--ease), color 0.2s, border-color 0.2s, transform 0.16s var(--ease);
}
.biz-tab:hover { background: var(--fill-2); color: var(--label); }
.biz-tab:active { transform: scale(0.97); }
.biz-tab.on {
  background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 640;
  box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

.biz-total { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.biz-total-item {
  flex: 1; min-width: 150px;
  background: var(--card); border-radius: var(--r-l); padding: 16px 18px;
  box-shadow: var(--sh);
  border-left: 3px solid var(--blue);
}
.biz-total-v { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; color: var(--label); }
.biz-total-k { font-size: 12.5px; color: var(--label-2); margin-top: 3px; }

/* 板块模块:上下单列堆叠 */
.biz-grid { display: flex; flex-direction: column; gap: 16px; }
.biz-card { display: flex; flex-direction: column; }
.biz-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.biz-icon { font-size: 20px; }
.biz-name { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; color: var(--label); }
.biz-card-head .tag { margin-left: auto; }

/* 拖拽排序 */
.drag-handle {
  cursor: grab; color: var(--label-3); font-size: 15px; line-height: 1; user-select: none;
  padding: 0 2px; letter-spacing: -1px; transition: color 0.18s;
}
.biz-card:hover .drag-handle { color: var(--label-2); }
.biz-card.dragging { opacity: 0.45; }
.biz-card.drag-over { outline: 2px dashed var(--blue); outline-offset: 4px; border-radius: var(--r-l); }
.card-order { display: flex; gap: 4px; margin-left: 10px; }
.ord-btn {
  width: 24px; height: 24px; border: 1px solid var(--separator);
  background: var(--fill-2); border-radius: 7px;
  color: var(--label-2); font-size: 11px; line-height: 1; padding: 0; cursor: pointer;
  transition: background 0.18s, transform 0.16s var(--ease);
}
.ord-btn:hover:not(:disabled) { background: var(--fill); }
.ord-btn:active:not(:disabled) { transform: scale(0.92); }
.ord-btn:disabled { opacity: 0.3; cursor: default; }
.biz-reorder-hint { margin-left: auto; font-size: 11.5px; color: var(--label-3); align-self: center; }

/* KPI 小方块 */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.kpi { background: var(--fill-2); border-radius: var(--r-m); padding: 12px 14px; }
.kpi-v { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--label); word-break: break-all; }
.kpi-k { font-size: 11.5px; color: var(--label-2); margin-top: 3px; }
/* 钱包余额卡片:接在转化成本后,浅蓝底做区分 */
.kpi-wallet { background: rgba(0, 122, 255, 0.08); }
.kpi-wallet .kpi-v { color: var(--blue); }
.kpi-wallet .kpi-sub { font-size: 10.5px; color: var(--label-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 概览分组(店铺板块):毛数据 / 净数据 两块 */
.kpi-group + .kpi-group { margin-top: 14px; }
.kpi-group-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px; padding-left: 9px; border-left: 3px solid var(--label-3);
}
.kpi-group-head .kg-title { font-size: 13px; font-weight: 650; color: var(--label); }
.kpi-group-head .kg-sub { font-size: 11.5px; color: var(--label-2); }
.kg-gross .kpi-group-head { border-left-color: #F08C2E; }
.kg-gross .kpi { background: rgba(240, 140, 46, 0.10); }
.kg-gross .kpi-v { color: #C4691A; }
.kg-net .kpi-group-head { border-left-color: #1DA84C; }
.kg-net .kpi { background: rgba(29, 168, 76, 0.09); }
.kg-net .kpi-v { color: #15803D; }

/* 折叠表:地区分布等长表,默认只露前 N 行 */
.biz-fold { display: flex; justify-content: center; margin-top: 8px; }
.biz-fold .btn { font-size: 12px; }

.biz-bars { display: flex; align-items: flex-end; gap: 2px; height: 66px; margin-top: 14px; position: relative; padding-bottom: 0; }
.bar-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 58px; }
.bar {
  width: 100%; max-width: 18px; min-height: 2px;
  background: linear-gradient(180deg, #5aa9ff, var(--blue));
  border-radius: 3px 3px 1px 1px;
}
.bar.bar2 { background: linear-gradient(180deg, #5fdd7f, var(--green)); }
.bar-legend { position: absolute; right: 0; bottom: -2px; font-size: 10px; color: var(--label-3); }

.biz-bars-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--label-2); margin-top: 10px; }
.biz-bars-legend span { display: flex; align-items: center; gap: 5px; }
.biz-bars-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.biz-bars-legend i.sw0 { background: var(--blue); }
.biz-bars-legend i.sw1 { background: var(--green); }

.biz-detail { margin-top: 16px; }
.biz-detail .table th { font-size: 11.5px; }
.biz-detail-title { font-size: 12.5px; font-weight: 600; color: var(--label-2); margin-bottom: 7px; }

.biz-import { display: flex; gap: 8px; margin-top: 14px; }
.biz-path {
  flex: 1; padding: 8px 12px; font-size: 12.5px;
  background: var(--fill-2); border: 1px solid transparent; border-radius: var(--r);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.biz-path:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14); }
.biz-msg { margin-top: 8px; font-size: 12.5px; color: var(--label-2); }
.biz-note { margin-top: 12px; font-size: 11.5px; color: var(--label-3); line-height: 1.65; }
