/* 恒马CRM - 现代看板风样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: #f1f5f9; color: #1e293b; font-size: 14px; }
a { cursor: pointer; }
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s; }
.sidebar.collapsed { width: 64px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #eef2f7; }
.brand-icon { display: none; width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-size: 18px; font-weight: 700; align-items: center; justify-content: center; }
.sidebar.collapsed .brand-icon { display: flex; }
.sidebar.collapsed .brand-text { display: none; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
/* logo 用 img 时去掉 flex 居中文字的样式，改为图片适配 */
.logo-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
/* 侧边栏品牌区强制 34×34，避免被 .logo-img 的 width:100% 覆盖后撑大 */
.brand .logo, .brand .brand-icon { width: 34px; height: 34px; }
.brand-name { font-size: 16px; font-weight: 700; color: #1e293b; }
.brand small { color: #94a3b8; font-size: 11px; }
.nav { padding: 6px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 2px; }
.nav-group-title { display: flex; align-items: center; justify-content: flex-start; gap: 9px; font-size: 13px; color: #475569; padding: 9px 12px; border-radius: 8px; cursor: pointer; transition: .15s; user-select: none; font-weight: 600; white-space: nowrap; }
.nav-group-title:hover { background: #f1f5f9; color: #1e293b; }
.nav-group-title span:first-child { font-size: 15px; flex-shrink: 0; }
/* 用伪元素做箭头，避免在 flex 里产生额外 item 撑开文字 */
.nav-group-title::after { content: '▶'; margin-left: auto; font-size: 10px; color: #94a3b8; transition: transform .2s; flex-shrink: 0; }
.nav-group.expanded .nav-group-title::after { transform: rotate(90deg); }
.nav-group-items { display: none; padding-left: 6px; padding-bottom: 4px; }
.nav-group.expanded .nav-group-items { display: block; }
.nav-group-title.on { background: #eff6ff; color: #2563eb; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 7px; color: #475569; cursor: pointer; margin-bottom: 2px; transition: .15s; font-size: 13px; white-space: nowrap; }
.nav-item:hover { background: #f1f5f9; color: #1e293b; }
.nav-item.active, .nav-item.on { background: #2563eb; color: #fff; }
.nav-item span { font-size: 15px; flex-shrink: 0; }
.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.top-title { font-size: 16px; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 12px; }
#user-switch { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 7px; background: #f8fafc; font-size: 13px; }
.top-user { font-size: 13px; color: #64748b; display: flex; align-items: center; gap: 8px; }
.top-user .link { font-size: 12px; color: #2563eb; cursor: pointer; }
.top-user .link:hover { text-decoration: underline; }
.content { padding: 22px; flex: 1; }

/* 登录层 */
.app-locked { display: none !important; }
.login-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%); }
.login-card { width: 360px; max-width: 90vw; background: #fff; border-radius: 16px; padding: 36px 38px; box-shadow: 0 24px 60px rgba(2, 6, 23, .35); text-align: center; }
.login-logo { display: block; width: auto; height: auto; max-width: 180px; max-height: 72px; margin: 0 auto 14px; border-radius: 0; background: none; }
.login-title { font-size: 22px; font-weight: 700; color: #1e293b; }
.login-sub { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.login-form { margin-top: 22px; text-align: left; }
.login-label { display: block; font-size: 13px; color: #475569; margin: 12px 0 6px; font-weight: 600; }
.login-input { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #f8fafc; transition: .15s; }
.login-input:focus { outline: none; border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-err { color: #ef4444; font-size: 13px; margin: 10px 0 0; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; letter-spacing: 2px; margin-top: 18px; }
.login-hint { margin-top: 16px; font-size: 12px; color: #94a3b8; }
.login-hint .link { color: #2563eb; cursor: pointer; }
.login-footer { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.78); letter-spacing: .5px; }
.login-footer a { color: rgba(255,255,255,.92); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
#btn-logout { margin-left: 4px; }

/* 通用 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.muted { color: #94a3b8; font-size: 12.5px; }
.link { color: #2563eb; }
.link:hover { text-decoration: underline; }
.link.danger { color: #ef4444; }
.link.primary { color: #2563eb; font-weight: 600; }
.link.ok { color: #10b981; font-weight: 600; }

.btn { padding: 7px 14px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: #334155; transition: .15s; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: #ef4444; border-color: #fecaca; }
.btn.ok { color: #10b981; border-color: #a7f3d0; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-bar.advanced { margin-top: -8px; }
.filter-bar input, .filter-bar select { padding: 7px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; background: #fff; }
.col-setting { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.col-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; cursor: pointer; }
.col-check input { width: 15px; height: 15px; }

/* 卡片 */
.card { background: #fff; border: 1px solid #eef2f7; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #334155; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12px; font-weight: 400; }
.card.clickable { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.08); border-color: #dbeafe; }
.card-link { font-size: 12px; font-weight: 400; color: #2563eb; }
.card-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; font-size: 12px; color: #64748b; }
.card-footer .link { color: #2563eb; margin-right: 10px; cursor: pointer; }
.card-footer .link:hover { text-decoration: underline; }
.span2 { grid-column: 1 / -1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* KPI */
.kpi { background: #fff; border: 1px solid #eef2f7; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.kpi-label { color: #94a3b8; font-size: 12.5px; margin-bottom: 6px; }
.kpi-val { font-size: 22px; font-weight: 700; color: #1e293b; }
.kpi-sub { color: #94a3b8; font-size: 12px; margin-top: 5px; }
.kpi.danger .kpi-val { color: #ef4444; }
.kpi.ok .kpi-val { color: #10b981; }
.kpi.clickable, .funnel-row.clickable { cursor: pointer; }
.kpi.clickable:hover { background: #f8fafc; }
.funnel-row.clickable:hover .funnel-bar-box { background: #eef2f7; }

/* 首页仪表盘 richer */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-funnel { display: block; width: 100%; }
.dash-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px; }
.mini-stat .n { font-size: 17px; font-weight: 700; color: #1e293b; }
.mini-stat .l { font-size: 12px; color: #64748b; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-actions .btn { padding: 8px 14px; font-size: 13px; }
.list-sm { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.list-sm li { font-size: 12.5px; padding: 6px 8px; background: #f8fafc; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; }
.list-sm .meta { font-size: 11.5px; color: #94a3b8; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; background: #f8fafc; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .empty { text-align: center; color: #94a3b8; padding: 28px; }
.empty { text-align: center; color: #94a3b8; padding: 40px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #e2e8f0; color: #475569; }
.tag.ok { background: #dcfce7; color: #15803d; }
.tag.warn { background: #fef3c7; color: #b45309; }
.tag.info { background: #dbeafe; color: #1d4ed8; }
.tag.danger { background: #fee2e2; color: #b91c1c; }

/* 键值 */
.kv { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #eef2f7; padding-bottom: 7px; font-size: 13px; }
.kv-row .k { color: #94a3b8; }
.kv-row .v { color: #334155; font-weight: 500; text-align: right; max-width: 65%; }

/* 关联网格 */
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rel-box { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 9px; padding: 12px; text-align: center; cursor: pointer; transition: .15s; }
.rel-box:hover { background: #eff6ff; border-color: #bfdbfe; }
.rel-n { font-size: 20px; font-weight: 700; color: #2563eb; }
.rel-l { font-size: 12px; color: #64748b; margin-top: 3px; }
.rel-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rel-list li { font-size: 13px; padding: 6px 8px; background: #f8fafc; border-radius: 7px; }

/* 图表 */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut { width: 180px; flex-shrink: 0; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.lg-item { font-size: 13px; color: #475569; display: flex; align-items: center; gap: 7px; }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.prog { background: #e2e8f0; border-radius: 6px; height: 18px; position: relative; overflow: hidden; min-width: 90px; }
.prog-bar { height: 100%; border-radius: 6px; }
.prog-txt { position: absolute; right: 8px; top: 0; line-height: 18px; font-size: 11px; color: #fff; font-weight: 600; }

/* 漏斗紧凑样式 */
.funnel-wrap { padding: 4px 0; }
.funnel-sum { font-size: 13px; color: #64748b; margin-bottom: 12px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; }
.funnel-sum b { color: #1e293b; font-weight: 700; }
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.funnel-name { width: 84px; font-size: 12.5px; color: #475569; text-align: right; white-space: nowrap; flex-shrink: 0; }
.funnel-bar-box { flex: 1; min-width: 120px; background: #f1f5f9; border-radius: 6px; height: 30px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 6px; transition: width .4s ease; min-width: 4px; }
.funnel-num { font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; min-width: 120px; text-align: right; }

/* 模态框 */
.modal-root { display: none; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 520px; max-width: 96vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
.modal.wide { width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eef2f7; font-size: 16px; font-weight: 600; }
.modal-x { border: none; background: none; font-size: 22px; cursor: pointer; color: #94a3b8; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #eef2f7; display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12.5px; color: #64748b; }
.form input, .form select, .form textarea { padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-family: inherit; width: 100%; }
.form textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-inline input[type="date"], .form-inline input[type="time"] { width: auto; min-width: 130px; }
.form-inline label { font-size: 12.5px; color: #64748b; display: flex; align-items: center; gap: 4px; }
.input-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.file-box { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 8px; font-size: 12px; color: #334155; }

/* 折叠更多信息 */
.fold-section { border-top: 1px dashed #e2e8f0; margin-top: 14px; }
.fold-title { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #2563eb; cursor: pointer; padding: 10px 0; user-select: none; font-weight: 500; }
.fold-title:hover { color: #1d4ed8; }
.fold-body { padding-bottom: 4px; }

/* 产品子表（表格样式：序号/*产品名称/产品编号/*发货数量/*金额/*单价/备注/操作） */
.q-items { display: contents; }
.qi-tbl { width: 100%; border-collapse: collapse; }
.qi-tbl th, .qi-tbl td { padding: 8px 6px; border-bottom: 1px solid #eef2f7; font-size: 12.5px; }
.qi-tbl thead th { background: #f8fafc; color: #475569; font-weight: 600; text-align: left; }
.qi-tbl tbody tr:hover { background: #f8fafc; }
.qi-tbl tfoot td { background: #f1f5f9; color: #1e293b; font-weight: 600; border-top: 2px solid #cbd5e1; }
.qi-tbl .qi-total-label { color: #f97316; font-size: 14px; text-align: left; }
.qi-tbl .qi-no { display: inline-block; min-width: 24px; text-align: center; font-weight: 600; color: #64748b; }
.qi-tbl input[type="number"], .qi-tbl input[type="text"], .qi-tbl input[placeholder] { padding: 6px 8px; border: 1px solid #d8e0ea; border-radius: 6px; font-size: 12.5px; width: 100%; box-sizing: border-box; }
.qi-tbl input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.qi-tbl input[readonly] { background: #f8fafc; color: #64748b; }
.qi-tbl .btn.sm.danger { padding: 4px 10px; font-size: 12px; }
.total-row { margin-top: 10px; text-align: right; color: #475569; font-size: 14px; }
.total-row b { color: #1e293b; font-size: 18px; }
.big-amount { font-size: 30px; font-weight: 700; color: #2563eb; }
.clause-box { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 12px; font-size: 13px; color: #475569; line-height: 1.7; white-space: pre-wrap; }

/* Toast */
.toast-root { position: fixed; top: 70px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #1e293b; color: #fff; padding: 11px 18px; border-radius: 9px; font-size: 13px; opacity: 0; transform: translateY(-8px); transition: .3s; box-shadow: 0 8px 24px rgba(15,23,42,.2); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #10b981; }
.toast.warn { background: #f59e0b; }
.toast.danger { background: #ef4444; }

/* 系统设置 */
.set-nav { display: flex; flex-direction: column; gap: 4px; }
.set-nav-item { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: #475569; }
.set-nav-item:hover { background: #f1f5f9; }
.set-nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.dict-row { padding: 9px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.dict-row b { display: inline-block; width: 130px; color: #64748b; }
.chip { display: inline-block; background: #f1f5f9; border-radius: 14px; padding: 2px 10px; margin: 0 4px 4px 0; font-size: 12.5px; }
.perm-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed #eef2f7; }
.perm-row select { padding: 5px 9px; border: 1px solid #cbd5e1; border-radius: 7px; }
.perm-matrix-wrap { max-height: 60vh; overflow: auto; border: 1px solid #eef2f7; border-radius: 10px; }
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-matrix thead th { position: sticky; top: 0; background: #f8fafc; color: #475569; font-weight: 600; padding: 9px 6px; border-bottom: 2px solid #e2e8f0; text-align: center; }
.perm-matrix thead th.perm-mod { text-align: left; }
.perm-matrix tbody td { padding: 8px 6px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.perm-matrix tbody td.perm-mod { text-align: left; font-weight: 500; color: #334155; }
.perm-matrix tbody tr:hover { background: #f8fafc; }
.perm-matrix input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* 新增客户：两列布局 + 分段 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-col { display: flex; flex-direction: column; gap: 5px; }
.form-col label { font-size: 13px; color: #64748b; font-weight: 500; }
.req { color: #ef4444; margin-left: 3px; }
.form-col label .req { color: #ef4444; margin-left: 3px; }
.form-col input, .form-col select, .form-col textarea { padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-family: inherit; width: 100%; background: #fff; }
.form-col input:focus, .form-col select:focus, .form-col textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.form-col.full { grid-column: 1 / -1; }

.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; color: #1e293b; margin: 18px 0 10px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.section-title .add { font-size: 20px; color: #2563eb; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.section-title .add:hover { background: #eff6ff; }

.subtable { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.subtable th { background: #f8fafc; padding: 8px 10px; color: #64748b; font-weight: 600; text-align: left; border-bottom: 1px solid #e2e8f0; }
.subtable td { padding: 6px 10px; border-bottom: 1px solid #f1f5f9; }
.subtable td input, .subtable td select { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12.5px; width: 100%; }
.subtable .empty-cell { text-align: center; color: #94a3b8; padding: 18px; }
.subtable .link { font-size: 12px; }

.upload-zone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 24px; text-align: center; background: #f8fafc; color: #64748b; cursor: pointer; transition: .15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: #2563eb; background: #eff6ff; }
.upload-zone .icon { font-size: 26px; color: #94a3b8; margin-bottom: 6px; }
.upload-zone .tip { font-size: 12.5px; color: #94a3b8; }
.upload-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-item { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.upload-item .name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .del { color: #ef4444; cursor: pointer; font-size: 14px; }

/* 模态框头部按钮 */
.modal-head-actions { display: flex; gap: 10px; align-items: center; }

/* 关联选择弹窗 */
.rel-pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rel-pick-item { padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; }
.rel-pick-item:hover, .rel-pick-item.on { border-color: #2563eb; background: #eff6ff; }

/* 响应式 */
@media (max-width: 1280px) { .dash-grid { grid-template-columns: 1.5fr 1fr; } .dash-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) { .cards-4 { grid-template-columns: 1fr 1fr; } }

/* 侧边栏：图标与文字始终同行显示，仅在极窄屏才进入图标模式 */

@media (max-width: 900px) {
  .cards-4, .cards-3, .cards-2, .two-col, .dash-grid, .dash-row, .form-grid { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}

/* 客户导入 / 导出 */
.import-box { padding: 4px 0; }
.import-steps { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.import-steps p { margin: 4px 0; font-size: 13px; color: #475569; }
.import-steps p.muted { color: #94a3b8; }
.import-file { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.import-file input[type=file] { font-size: 13px; max-width: 360px; }
.import-summary { font-size: 14px; margin: 6px 0 10px; }
.import-summary b.ok { color: #15803d; }
.import-summary b.warn { color: #b45309; }

/* ---------- BI 大屏客户分析（放大版） ---------- */
.bi-screen { background: linear-gradient(135deg, #050d1a 0%, #0a1326 100%); min-height: calc(100vh - 60px); padding: 24px 28px 32px; color: #c7e6ff; }
.bi-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; position: relative; padding-bottom: 16px; border-bottom: 1px solid rgba(0, 180, 255, 0.15); }
.bi-header-deco { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -70%); width: 520px; height: 56px; background: radial-gradient(ellipse at center, rgba(0,212,255,0.22) 0%, transparent 72%); pointer-events: none; }
.bi-header h1 { font-size: 28px; font-weight: 700; letter-spacing: 4px; color: #fff; text-shadow: 0 0 16px rgba(0,212,255,0.65); margin: 0 auto; }
.bi-time { font-size: 15px; color: #7a9cc6; font-family: 'Microsoft YaHei', sans-serif; }

.bi-row { display: grid; gap: 20px; margin-bottom: 20px; }
.bi-row-1 { grid-template-columns: 1fr; }
.bi-row-4 { grid-template-columns: repeat(4, 1fr); }
.bi-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.bi-row-2 { grid-template-columns: 1fr 1fr; }
.bi-span-2 { grid-column: span 2; }

.bi-card { background: rgba(16, 38, 76, 0.55); border: 1px solid rgba(0, 180, 255, 0.18); border-radius: 14px; padding: 18px 20px 22px; box-shadow: 0 0 22px rgba(0, 100, 200, 0.1) inset; position: relative; overflow: hidden; }
.bi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: linear-gradient(90deg, transparent, rgba(0,212,255,0.65), transparent); }
.bi-card-title { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.5px; }
.bi-card-title::before { content: ''; display: inline-block; width: 5px; height: 16px; background: #00d4ff; border-radius: 2px; box-shadow: 0 0 10px #00d4ff; }

/* KPI 横向卡片 */
.bi-kpi-card { padding: 18px 20px; }
.bi-kpi-main { display: flex; align-items: center; gap: 16px; }
.bi-kpi-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 0 18px var(--kpi-color); flex-shrink: 0; }
.bi-kpi-info { flex: 1; }
.bi-num { font-size: 34px; font-weight: 700; text-shadow: 0 0 12px rgba(0,212,255,0.5); line-height: 1; }
.bi-label { font-size: 13px; color: #7a9cc6; margin-top: 10px; }

.bi-tabs { gap: 0; }
.bi-tabs::before { display: none; }
.bi-tab { padding: 6px 18px; border-radius: 16px; font-size: 14px; color: #7a9cc6; cursor: pointer; transition: .2s; margin-left: auto; border: 1px solid transparent; }
.bi-tab.on { background: rgba(0,212,255,0.18); color: #00d4ff; border-color: rgba(0,212,255,0.4); }
.bi-tab:not(.on):hover { color: #a8d6ff; border-color: rgba(0,212,255,0.2); }

.bi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bi-table th { color: #7a9cc6; font-weight: 500; padding: 10px 6px; border-bottom: 1px solid rgba(0,180,255,0.15); text-align: left; }
.bi-table td { color: #c7e6ff; padding: 11px 6px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.bi-table tr:hover td { background: rgba(0,212,255,0.06); }
.bi-rank { display: inline-flex; width: 22px; height: 22px; line-height: 22px; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0,212,255,0.2); color: #00d4ff; font-size: 12px; font-weight: 600; }

.bi-map-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; align-items: center; }
.bi-city-list { display: flex; flex-direction: column; gap: 12px; }
.bi-city-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #c7e6ff; }
.bi-city-item b { margin-left: auto; color: #00d4ff; font-weight: 600; font-size: 15px; }
.bi-city-rank { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; color: #fff; }

.bi-sub-legend { display: flex; gap: 18px; align-items: center; font-size: 13px; color: #7a9cc6; margin-bottom: 8px; }
.bi-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.bi-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #c7e6ff; }
.bi-lg-item { display: flex; align-items: center; gap: 8px; }
.bi-lg-item b { margin-left: auto; color: #fff; font-weight: 500; }
.bi-donut-wrap { display: flex; align-items: center; gap: 18px; justify-content: center; }
.bi-donut { flex: 0 0 160px; }

.bi-gauge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 1400px) {
  .bi-row-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1280px) {
  .bi-row-3 { grid-template-columns: 1fr 1fr; }
  .bi-span-2 { grid-column: span 2; }
  .bi-map-wrap { grid-template-columns: 1fr; }
  .bi-gauge-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .bi-screen { padding: 16px; }
  .bi-row-4, .bi-row-3, .bi-row-2 { grid-template-columns: 1fr; }
  .bi-span-2 { grid-column: span 1; }
  .bi-header h1 { font-size: 18px; }
  .bi-header-deco { width: 300px; height: 40px; }
  .bi-num { font-size: 26px; }
  .bi-kpi-icon { width: 44px; height: 44px; font-size: 13px; }
}

/* 日程拜访 */
.schedule-layout { display: flex; gap: 16px; height: calc(100vh - 100px); }
.schedule-sidebar { width: 200px; flex-shrink: 0; background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.schedule-sidebar .btn.full { width: 100%; margin-bottom: 14px; }
.sch-nav { display: flex; flex-direction: column; gap: 4px; }
.sch-nav-item { padding: 9px 12px; border-radius: 8px; cursor: pointer; color: #475569; font-size: 13px; transition: .15s; }
.sch-nav-item:hover { background: #f1f5f9; color: #1e293b; }
.sch-nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.schedule-main { flex: 1; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); display: flex; flex-direction: column; min-width: 0; }
.sch-toolbar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #eef2f7; flex-wrap: wrap; }
.sch-view-tabs { display: flex; gap: 6px; }
.sch-view-tabs .btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.sch-nav-arrows { display: flex; align-items: center; gap: 8px; }
.sch-cur-date { font-weight: 600; font-size: 15px; min-width: 140px; text-align: center; }
.sch-stats { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #64748b; margin-left: auto; }
.sch-stats b { color: #1e293b; }
.sch-stats .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.sch-stats .dot.ok { background: #10b981; }
.sch-stats .dot.warn { background: #f59e0b; }
.sch-stats .dot.danger { background: #ef4444; }
.sch-search { display: flex; gap: 6px; margin-left: auto; }
.sch-search input { padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 13px; width: 180px; }
.sch-cust-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1e293b; background: #eff6ff; border: 1px solid #bfdbfe; padding: 5px 10px; border-radius: 7px; }
.sch-cust-filter .link { color: #2563eb; cursor: pointer; }
.sch-body { flex: 1; overflow: auto; padding: 14px; }
.sch-day { display: flex; flex-direction: column; min-height: 100%; }
.sch-hour { display: flex; border-bottom: 1px solid #f1f5f9; min-height: 56px; }
.sch-hour-label { width: 56px; flex-shrink: 0; color: #94a3b8; font-size: 12px; padding: 6px; text-align: right; }
.sch-hour-slot { flex: 1; padding: 4px; cursor: pointer; }
.sch-hour-slot:hover { background: #f8fafc; }
.sch-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; min-height: 100%; }
.sch-week-col { border: 1px solid #e2e8f0; border-radius: 8px; display: flex; flex-direction: column; min-height: 420px; }
.sch-week-head { padding: 8px; text-align: center; border-bottom: 1px solid #f1f5f9; }
.sch-week-day { font-size: 12px; color: #64748b; }
.sch-week-date { font-weight: 600; font-size: 14px; }
.sch-week-date.today { color: #2563eb; }
.sch-week-body { flex: 1; padding: 6px; cursor: pointer; }
.sch-week-body:hover { background: #f8fafc; }
.sch-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e2e8f0; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.sch-month-head { background: #f8fafc; padding: 8px; text-align: center; font-size: 12px; color: #64748b; }
.sch-month-cell { background: #fff; min-height: 100px; padding: 6px; cursor: pointer; }
.sch-month-cell.muted { background: #f8fafc; color: #94a3b8; }
.sch-month-cell.today { background: #eff6ff; }
.sch-month-cell:hover { background: #f8fafc; }
.sch-month-date { font-weight: 600; margin-bottom: 4px; }
.sch-month-task { font-size: 11px; background: #dbeafe; color: #1e40af; padding: 2px 5px; border-radius: 4px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-more { font-size: 11px; color: #64748b; }
.sch-task-card { background: #eff6ff; border-left: 3px solid #2563eb; border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; }
.sch-task-card.done { opacity: .65; border-left-color: #94a3b8; background: #f1f5f9; }
.sch-task-time { font-size: 11px; color: #2563eb; font-weight: 600; }
.sch-task-title { font-size: 12px; font-weight: 600; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-task-meta { font-size: 11px; color: #64748b; }
.sch-task-list { padding: 10px; }
.sch-track { display: flex; flex-direction: column; gap: 14px; padding: 10px; }
.sch-track-item { display: flex; gap: 16px; }
.sch-track-time { width: 120px; flex-shrink: 0; color: #64748b; font-size: 13px; }
.sch-track-card { flex: 1; background: #f8fafc; border-radius: 8px; padding: 12px; }
.sch-track-user { font-weight: 600; margin-bottom: 4px; }
.sch-track-addr { color: #64748b; font-size: 12px; }
.datetime-row { display: flex; align-items: center; gap: 8px; }
.datetime-row input[type="date"] { width: 130px; }
.datetime-row input[type="time"] { width: 90px; }
.inline-check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #475569; cursor: pointer; }

/* 销售跟单详情页 */
.opp-detail-header { margin-bottom: 14px; }
.opp-detail-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.opp-type-tag { display: inline-block; padding: 3px 10px; border-radius: 6px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 600; border: 1px solid #dbeafe; }
.opp-title-txt { font-size: 18px; font-weight: 700; color: #1e293b; }
.opp-desc { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #475569; margin-bottom: 14px; line-height: 1.6; }
.opp-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.opp-meta-item { display: flex; flex-direction: column; gap: 4px; }
.opp-meta-k { font-size: 12px; color: #94a3b8; }
.opp-meta-v { font-size: 13px; color: #334155; font-weight: 500; }

/* Tab 导航 */
.tabs-bar { display: flex; gap: 0; border-bottom: 1px solid #e2e8f0; background: #fff; border-radius: 12px 12px 0 0; padding: 0 16px; }
.tab { padding: 12px 18px; font-size: 13px; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; transition: .15s; }
.tab:hover { color: #2563eb; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.tab-body { background: #fff; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 12px 12px; padding: 16px; min-height: 200px; }

/* 跟进时间线 */
.follow-timeline { display: flex; flex-direction: column; gap: 16px; }
.follow-item { display: flex; gap: 12px; }
.follow-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.follow-main { flex: 1; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 12px 14px; }
.follow-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.follow-user { font-weight: 600; color: #1e293b; }
.follow-type { font-size: 12px; color: #64748b; background: #e2e8f0; padding: 2px 8px; border-radius: 12px; }
.follow-time { font-size: 12px; color: #94a3b8; margin-left: auto; }
.follow-content { font-size: 13px; color: #334155; line-height: 1.6; }
.follow-next, .follow-extra { margin-top: 6px; font-size: 12px; color: #475569; }

@media (max-width: 900px) {
  .opp-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs-bar { overflow-x: auto; }
}

/* 可搜索下拉（input + datalist） */
.combo-wrap { display: block; position: relative; }
.combo-input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #d8e0ea; border-radius: 6px; background: #fff; font-size: 13px; color: #1e293b; transition: border-color .15s, box-shadow .15s; }
.combo-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.combo-input::placeholder { color: #94a3b8; }
