/* ============ 旅美美 · 协同办公系统 ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --cyan: #0891b2;
  --cyan-bg: #cffafe;
  --blue-bg: #dbeafe;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --gray-bg: #f1f5f9;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录页（参考 CRI 用户系统：左右分区 + 毛玻璃卡片 + 风景背景） ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: stretch; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
}
.login-page .login-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  animation: bgSlowIn .8s ease;
}
@keyframes bgSlowIn { from { opacity: 0; } to { opacity: 1; } }
/* 无自定义背景时使用默认风景图（张家界峰林） */
.login-page .login-bg-default {
  position: absolute; inset: 0;
  background: url("/static/img/login-bg-default.jpg") center/cover no-repeat;
}
.login-veil {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(15,23,42,.78) 0%, rgba(30,58,138,.46) 38%, rgba(15,23,42,.30) 62%, rgba(15,23,42,.52) 100%);
}
.login-body {
  position: relative; z-index: 2; width: 100%; max-width: 1280px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; padding: 48px 56px;
}
/* 左侧品牌宣传区 */
.login-hero { flex: 1; color: #fff; max-width: 620px; }
.login-hero .lh-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 38px;
}
.login-hero .lh-top img, .login-hero .lh-top .logo {
  width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -1px;
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
}
.login-hero .lh-top .lh-name { font-size: 24px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.login-hero .lh-top .lh-sub { font-size: 13px; color: rgba(226,232,240,.85); margin-top: 2px; }
.login-hero h1 {
  font-size: 40px; line-height: 1.32; font-weight: 800; letter-spacing: 2px;
  margin: 0 0 14px; text-shadow: 0 3px 18px rgba(0,0,0,.45);
}
.login-hero h1 .grad {
  background: linear-gradient(92deg, #93c5fd 0%, #e0f2fe 60%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-hero .lh-slogan {
  font-size: 17px; font-weight: 600; color: rgba(226,232,240,.95);
  margin-bottom: 26px; text-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.login-hero .lh-features { display: flex; flex-direction: column; gap: 12px; }
.login-hero .lh-feat {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(226,232,240,.92);
}
.login-hero .lh-feat::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #7dd3fc; box-shadow: 0 0 10px rgba(125,211,252,.8);
}
/* 右侧登录卡片：毛玻璃 */
.login-card {
  position: relative; z-index: 2; width: 400px; flex-shrink: 0;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 20px; padding: 34px 34px 26px;
  box-shadow: 0 24px 60px rgba(2,8,40,.45), inset 0 1px 0 rgba(255,255,255,.9);
  display: flex; flex-direction: column;
}
/* 品牌区 LOGO：与登录卡片视觉融合。--login-logo-h 为占位首字方块尺寸，
   --login-logo-img-h 为上传 LOGO 的显示高度（放大后约卡片的 1/3，识别度优先） */
.login-card { --login-logo-h: 84px; --login-logo-img-h: 108px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: var(--login-logo-h, 84px); height: var(--login-logo-h, 84px);
  border-radius: 20px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: calc(var(--login-logo-h, 84px) * .43); font-weight: 800; letter-spacing: -1px;
  box-shadow: 0 10px 26px rgba(37,99,235,.32), inset 0 1px 0 rgba(255,255,255,.22);
}
/* 用户上传 LOGO（建议透明底 png/webp/svg）：去掉白底徽章、描边与投影，
   图形直贴毛玻璃卡片实现视觉融合；高度放大、宽度随原图比例自适应，
   object-fit 防拉伸变形；圆角仅对不透明图（如 jpg）生效，与卡片圆角语言统一。
   上传入口：系统管理 → 品牌与外观 → LOGO 图片 */
.login-logo.img {
  width: auto; height: var(--login-logo-img-h, 108px);
  min-width: var(--login-logo-h, 84px); max-width: 300px;
  margin: 0 auto 8px; padding: 0;
  background: none; border: none; border-radius: 16px;
  object-fit: contain; box-shadow: none;
}
.login-brand p { color: #0f2350; font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.login-card .field { margin-bottom: 16px; }
/* 带图标的圆角填充输入框（参考 CRI） */
.login-card .field .inp {
  position: relative; display: flex; align-items: center;
}
.login-card .field .inp svg {
  position: absolute; left: 13px; width: 17px; height: 17px; color: #94a3b8; pointer-events: none;
}
.login-card .field .inp input {
  padding-left: 40px; border-radius: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  transition: border-color .15s, box-shadow .15s;
}
.login-card .field .inp input:focus {
  background: #fff; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.login-card .btn-primary {
  border-radius: 10px; letter-spacing: 8px; text-indent: 8px;
  box-shadow: 0 8px 22px rgba(37,99,235,.35);
}
.login-tip {
  margin-top: 18px; padding: 10px 12px; background: rgba(248,250,252,.9); border-radius: 8px;
  font-size: 12px; color: var(--muted); line-height: 1.8; border: 1px solid #eef2f7;
}
.login-footer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  text-align: center; padding: 14px 16px;
  font-size: 12px; color: rgba(226,232,240,.75);
  text-shadow: 0 1px 6px rgba(0,0,0,.5); letter-spacing: .5px;
}
@media (max-width: 960px) {
  .login-body { flex-direction: column; padding: 40px 22px; gap: 26px; }
  .login-hero { max-width: 560px; text-align: center; }
  .login-hero .lh-top { justify-content: center; }
  .login-hero .lh-features { align-items: center; }
  .login-hero h1 { font-size: 28px; }
  .login-card { width: 100%; max-width: 400px; }
}
/* 小屏手机：LOGO 等比缩小保持融合布局，卡片内边距收紧 */
@media (max-width: 480px) {
  .login-card { --login-logo-h: 66px; --login-logo-img-h: 86px; padding: 30px 24px 22px; }
  .login-logo.img { max-width: 240px; }
}

/* ---------- 应用框架 ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 228px; background: var(--sidebar); color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; transition: width .2s;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(148,163,184,.14);
}
.sidebar .brand .logo {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px;
}
.sidebar .brand b { color: #fff; font-size: 15px; display: block; line-height: 1.3; }
.sidebar .brand span { font-size: 11px; color: #64748b; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-group-title {
  font-size: 11px; color: #475569; padding: 12px 10px 6px; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #94a3b8; cursor: pointer; margin-bottom: 2px; font-size: 14px;
  transition: all .15s; user-select: none;
}
.nav-item:hover { background: rgba(148,163,184,.12); color: #e2e8f0; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item .n-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px;
  border-radius: 9px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .page-sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .bell {
  position: relative; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.topbar .bell:hover { background: var(--gray-bg); color: var(--text); }
.topbar .bell .b-badge {
  position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px;
  text-align: center; padding: 0 4px;
}
.topbar .today { font-size: 13px; color: var(--muted); }
.content { flex: 1; overflow-y: auto; --content-pad-t: 22px; padding: var(--content-pad-t) 24px 40px; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.card-title .right { margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--gray-bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-link { border: none; background: none; color: var(--primary); padding: 4px 6px; }
.btn-link:hover { background: var(--primary-light); text-decoration: none; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field textarea { resize: vertical; min-height: 72px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px;
  background: #f8fafc;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: default; transition: background .12s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: #f8fafc; }
.tbl .num { font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-gray { background: var(--gray-bg); color: #475569; }
.chip-blue { background: var(--blue-bg); color: #1d4ed8; }
.chip-orange { background: var(--orange-bg); color: var(--orange); }
.chip-cyan { background: var(--cyan-bg); color: var(--cyan); }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-violet { background: var(--violet-bg); color: var(--violet); }
/* 金额待审核标识：样式同"已结算"徽章，文字红色 */
.chip-need { background: var(--red-bg); color: var(--red); font-weight: 700; border: 1px solid #fecaca; }
.chip-need::before { content: "￥"; width: auto; height: auto; border-radius: 0; background: none; font-size: 10px; line-height: 1; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; background: var(--gray-bg); color: var(--muted); }
.tag-warn { background: var(--red-bg); color: var(--red); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--primary-light);
  display: inline-flex; align-items: center; justify-content: center; color: var(--primary-dark);
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.avatar-lg { width: 96px; height: 96px; font-size: 34px; border-radius: 24px; border: 3px solid rgba(255,255,255,.85); }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }

.empty { text-align: center; padding: 36px 0; color: var(--muted); font-size: 13px; }
.empty .e-icon { font-size: 30px; opacity: .4; margin-bottom: 8px; display:block; }

/* 30 天内待定单：标红闪烁 */
@keyframes rowPulse { 0%, 100% { background: #fff5f5; } 50% { background: #fecaca; } }
@keyframes textBlink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
tr.urgent-row td { background: #fff5f5; }
tr.urgent-row { animation: rowPulse 1.8s ease-in-out infinite; }
tr.urgent-row .urg {
  color: var(--red); font-weight: 700; animation: textBlink 1.2s infinite; white-space: nowrap;
}
.urgent-bar {
  background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.urgent-bar .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--red);
  animation: textBlink 1s infinite;
}

/* ---------- 工作台 ---------- */
.hero {
  background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 60%, #4f46e5 100%);
  border-radius: 16px; color: #fff; padding: 26px 30px; margin-bottom: 20px; position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,.09);
}
.hero .h-hi { font-size: 13px; opacity: .85; }
.hero .h-slogan { font-size: 22px; font-weight: 700; margin: 8px 0 6px; line-height: 1.5; }
.hero .h-sub { font-size: 12px; opacity: .75; }
.hero .h-btn {
  position: absolute; right: 24px; bottom: 22px; z-index: 2;
}
/* KPI 六卡：固定 6 列等宽一排（避免 auto-fill 造成的 5+1 参差与末行留白）；窄屏两段式降级 */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-foot { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi.acc-green .k-value { color: var(--green); }
.kpi.acc-red .k-value { color: var(--red); }
.kpi.acc-blue .k-value { color: var(--primary); }
.kpi.acc-orange .k-value { color: var(--orange); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
/* 列内各面板纵向留白分隔（与外层 20px 节奏一致），避免多张白卡贴成一整块 */
.panel-grid .card { margin-bottom: 20px; }
.panel-grid .card:last-child { margin-bottom: 0; }
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--border); margin-bottom: 8px; font-size: 13px; cursor: pointer;
  transition: all .12s; background: #fff;
}
.todo-item:hover { border-color: var(--primary); background: #f8faff; }
.todo-item .t-main { flex: 1; min-width: 0; }
.todo-item .t-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item .t-sub { font-size: 11px; color: var(--muted); }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px dashed var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 24px; height: 24px; border-radius: 7px; background: var(--gray-bg); color: var(--muted);
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-no.r1 { background: #fde68a; color: #92400e; }
.rank-no.r2 { background: #e2e8f0; color: #475569; }
.rank-no.r3 { background: #fed7aa; color: #9a3412; }
.rank-row .r-info { flex: 1; min-width: 0; }
.rank-row .r-name { font-size: 13px; font-weight: 600; }
.rank-row .r-group { font-size: 11px; color: var(--muted); }
.rank-row .r-val { font-weight: 700; font-variant-numeric: tabular-nums; }

.progress { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, #2563eb, #4f46e5); border-radius: 99px; transition: width .4s; }
.progress .bar.over { background: linear-gradient(90deg, #16a34a, #22c55e); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .p-num { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 订单详情 ---------- */
.order-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.order-head .o-no { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 20px; }
.kv { font-size: 13px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 600; margin-top: 2px; word-break: break-all; }
.kv .v.money { color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.kv .v.masked { color: var(--muted); font-style: italic; }
.kv .v a { word-break: break-all; }
.itin-day {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: flex-start; background: #fff;
}
.itin-day .d-no {
  width: 46px; height: 46px; border-radius: 12px; background: var(--blue-bg); color: var(--primary-dark);
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; letter-spacing: .5px;
}
.itin-day .d-body { flex: 1; min-width: 0; }
.itin-day .d-content { font-weight: 600; }
.itin-day .d-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.itin-day .d-ops { flex-shrink: 0; }
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-item .tl-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--border); flex-shrink: 0; margin-top: 4px; z-index: 1;
}
.tl-item .tl-body { flex: 1; font-size: 13px; }
.tl-item .tl-time { font-size: 11px; color: var(--muted); }
.tl-item .tl-user { font-weight: 600; margin-right: 6px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 14px; width: 520px; max-width: 96vw; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp .18s;
}
.modal.wide { width: 760px; }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .m-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  font-size: 16px; font-weight: 700;
}
.modal .m-head .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; padding: 0 4px; }
.modal .m-head .x:hover { color: var(--text); }
.modal .m-body { padding: 18px 20px; overflow-y: auto; }
.modal .m-foot {
  padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px;
}
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: slideLeft .2s; max-width: 360px; display: flex; gap: 8px; align-items: center;
}
@keyframes slideLeft { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; font-size: 13px; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tab:hover { color: var(--text); background: #f8fafc; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input[type="text"], .filter-bar select,
.wb-filter-row select, .wb-filter-row input[type="text"] {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; outline: none;
  background: #fff; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.filter-bar input[type="text"]:hover, .filter-bar select:hover,
.wb-filter-row select:hover, .wb-filter-row input[type="text"]:hover { border-color: #94a3b8; }
.filter-bar input[type="text"]:focus, .filter-bar select:focus,
.wb-filter-row select:focus, .wb-filter-row input[type="text"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.filter-bar .grow { flex: 1; min-width: 180px; }

/* ---------- 吸顶筛选（线索管理 / 线索公海 / 订单管理 / 统计报表） ----------
   下滚时筛选条件固定在内容区顶端，始终可见可操作；
   .content 为滚动容器，吸顶元素在其内随所属卡片整体出视口后自然离开。
   注意：sticky 的吸附基准是内容盒顶（比可视顶低一个 padding-top），
   故用负偏移拉平到可视顶端，避免滚动内容从吸顶条上方漏出条带 */
/* 用法一：列表卡片内的筛选条 —— 负左右外边距撑满卡片宽度，吸顶时呈整条白色工具栏 */
.filter-bar.sticky-filter {
  position: sticky; top: calc(-1 * var(--content-pad-t, 22px)); z-index: 30;
  background: #fff;
  margin: 0 -20px 14px; padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
/* 用法二：独立筛选卡片（统计报表）—— 整卡吸附，浮层阴影与滚动内容拉开层次 */
.card.sticky-filter {
  position: sticky; top: calc(-1 * var(--content-pad-t, 22px)); z-index: 30;
  box-shadow: 0 8px 22px rgba(15,23,42,.12);
}

/* ---------- 固定表头（线索管理 / 线索公海 / 订单管理 / 统计报表） ----------
   顶部工具栏已吸顶的基础上，表头也吸附在其正下方：滚动浏览长列表时
   列含义始终可见，行数据与栏目一一对应。
   实现要点：
   1. .table-wrap 默认 overflow-x:auto 会创建滚动容器，使 thead 的
      sticky 基准变成 wrap 自身（页面滚动时表头跟着滚走），故吸头模式
      改为 overflow:visible —— 横向溢出交由外层 .content（本就是双向
      滚动容器）处理，thead 的 sticky 基准即 .content；
   2. 吸附偏移 --thead-top 由 JS 实测吸顶工具栏底边写入，随筛选条
      换行 / 窗口缩放自动重算（见 ui.js stickyThead）；
   3. border-collapse 下 sticky th 的边框不渲染，用 box-shadow 补底线。 */
.table-wrap.thead-sticky { overflow: visible; }
.table-wrap.thead-sticky .tbl thead th {
  position: sticky;
  top: var(--thead-top, 0px);
  z-index: 20;
  box-shadow: 0 1px 0 var(--border);
}

.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-cards .kpi .k-value { font-size: 20px; }
canvas.chart { width: 100%; height: 260px; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; justify-content: center; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.section-gap { margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.cursor-hand { cursor: pointer; }
.nowrap { white-space: nowrap; }

@media (max-width: 1100px) {
  .panel-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .sidebar { width: 64px; }
  .sidebar .brand b, .sidebar .brand span, .nav-item span, .sidebar .user-card .u-info { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
}

/* 待财务审核行高亮（列表明显标识） */
tr.review-row td { background: #f5f3ff; }
tr.review-row td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }
tr.review-row:hover td { background: #ede9fe; }

/* ---------- 订单列表：汇总行 / 分页 ---------- */
.tbl tfoot.sum-row td {
  border-top: 2px solid var(--border); background: #f8fafc; padding: 12px;
  font-size: 13px; color: var(--primary-dark);
}
.tbl tfoot.sum-row { border-bottom: none; }
.pager {
  display: flex; align-items: center; gap: 8px; padding-top: 14px; flex-wrap: wrap;
  border-top: 1px dashed var(--border); margin-top: 4px;
}
.pager select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px;
  background: #fff; cursor: pointer; outline: none;
}
.pager select:hover { border-color: #94a3b8; }
.pager select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }

/* ---------- 收退款弹窗：联动重算预览 ---------- */
.calc-box { min-height: 20px; }
.calc-line {
  background: var(--blue-bg); border: 1px dashed #93c5fd; color: var(--primary-dark);
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.7;
}
.calc-line b { font-variant-numeric: tabular-nums; }

/* ---------- 顶栏用户区 / 退出 ---------- */
.top-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.top-user:hover { background: var(--gray-bg); }

/* ---------- 时间筛选统一组件：预设胶囊 + 日期区间胶囊 ---------- */
.wb-filter { display: flex; flex-direction: column; gap: 12px; }
.wb-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fb-label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.preset-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.preset-chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit; line-height: 1.5;
  transition: all .15s;
}
.preset-chip:hover {
  border-color: var(--primary); color: var(--primary); background: #f8faff;
  transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15,23,42,.06);
}
.preset-chip.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5); border-color: transparent; color: #fff;
  font-weight: 600; box-shadow: 0 2px 10px rgba(37,99,235,.3); transform: translateY(-1px);
}

.range-box {
  display: inline-flex; align-items: center; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 0 4px;
  transition: border-color .15s, box-shadow .15s;
}
.range-box:hover { border-color: #94a3b8; }
.range-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }
.range-box input[type="date"], .range-box input[type="month"] {
  border: none; outline: none; background: transparent; padding: 8px 4px;
  font-size: 13px; font-family: inherit; color: var(--text); width: 126px; cursor: pointer;
}
.range-box input[type="month"] { width: 112px; }
.range-box input[type="date"]:hover, .range-box input[type="month"]:hover { color: var(--primary-dark); }
.range-box .r-sep { color: var(--muted); font-size: 12px; padding: 0 4px; user-select: none; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .5; transition: opacity .15s; }
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="month"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* 权限范围徽章（销售侧团队筛选） */
.scope-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--gray-bg); color: #475569; font-size: 12.5px; font-weight: 600;
  border: 1px dashed #cbd5e1; white-space: nowrap;
}
.scope-pill svg { width: 14px; height: 14px; color: var(--primary); }

/* ---------- 支付截图内嵌预览 ---------- */
.link-proof { color: var(--primary); cursor: pointer; }
.link-proof:hover { text-decoration: underline; }

/* ---------- 全局页脚版权（第九轮） ---------- */
.app-footer {
  font-size: 12px; color: #94a3b8; text-align: center;
  padding: 10px 16px; letter-spacing: .5px; flex-shrink: 0;
}
.sidebar .side-footer {
  margin-top: auto; padding: 12px 14px; border-top: 1px solid rgba(148,163,184,.14);
  font-size: 11px; color: #64748b; text-align: center; line-height: 1.6;
}
.main .main-footer { border-top: 1px solid var(--border); background: #fff; }

/* ---------- 品牌与外观设置（第九轮） ---------- */
.brand-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.brand-preview { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--gray-bg); border-radius: 12px; }
.brand-preview .logo-img {
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
  background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: var(--primary);
}
.brand-preview .logo-img.placeholder { background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border: none; }
.brand-preview .bg-thumb {
  margin-left: auto; width: 120px; height: 68px; border-radius: 8px; flex-shrink: 0;
  background-size: cover; background-position: center; border: 1px solid var(--border); display: flex;
  align-items: center; justify-content: center; font-size: 11px; color: var(--muted);
}
.brand-preview .bg-thumb.none { background: var(--gray-bg); }

/* ---------- 工作台：来源排行条形（第九轮） ---------- */
.src-bar { width: 100%; max-width: 220px; height: 8px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; margin-top: 5px; }
.src-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #0ea5e9, #2563eb); }

/* ---------- 统计：回款进度条 + 合计行（第九轮） ---------- */
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-line .progress-track { flex: 1; max-width: 420px; height: 14px; border-radius: 7px; background: var(--gray-bg); overflow: hidden; }
.progress-line .progress-track i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, #22c55e, #16a34a); }
.tbl tr.sum-row td { background: #f8fafc; border-top: 2px solid var(--border); font-weight: 700; }

/* ---------- 导出复选框列 ---------- */
.chk-col { width: 30px; text-align: center; }
.chk-col input { cursor: pointer; }

/* ---------- 工作台：英雄区 + 筛选 ---------- */
.hero { display: flex; align-items: center; gap: 24px; }
.hero .h-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.hero .hero-avatar {
  box-shadow: 0 0 0 5px rgba(255,255,255,.25), 0 14px 34px rgba(2,8,40,.35); flex-shrink: 0;
}
.hero .hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero .h-btn { position: static; margin-left: auto; flex-shrink: 0; }
.hero .h-role {
  margin-left: 10px; font-size: 12px; font-weight: 500; opacity: .85;
  background: rgba(255,255,255,.14); border-radius: 999px; padding: 2px 10px;
}
.filter-bar select { cursor: pointer; }
.filter-bar input[type="date"], .filter-bar input[type="month"] { cursor: pointer; }
