@charset "UTF-8";

/* Shared visual language for the sales workspace and its detail drawers. */
:root {
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --ink: #18243e;
  --muted: #7c8aa0;
  --border: #e3eaf3;
}
html { scrollbar-gutter: stable; }
body { -webkit-font-smoothing: antialiased; }
.overlay-open { overflow: hidden; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #91b3ff; outline-offset: 3px; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.45px; }
h2 { font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; line-height: 1.5; }
.page-head p, .page-subtitle { font-size: 13px; line-height: 1.75; }
.breadcrumb { font-size: 12px; margin-bottom: 19px; }
.content { max-width: 1680px; }
.nav-main { font-weight: 500; }
.nav-child { line-height: 1.5; }
.nav-child.active { box-shadow: inset 3px 0 0 #3370ff; }
.brand strong { font-weight: 700; }
.top-right { font-size: 12px; }
.profile select { font-size: 12px; }
.global-search input { font-size: 13px; }
.wechat-icon { display: inline-block; aspect-ratio: 1; object-fit: contain; border-radius: 22%; vertical-align: middle; flex-shrink: 0; }
.wechat-inline { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.device-card-body p .wechat-inline { display: inline-flex; width: auto; color: inherit; }
.device-card-body p .wechat-inline > span { width: auto; color: inherit; }
.communication-type { display: inline-flex; align-items: center; gap: 7px; }
.communication-type > svg { color: #6d8cc0; }
.btn, .text-link, .btn-link { font-size: 13px; }
.btn { min-height: 36px; padding: 8px 13px; border-radius: 6px; font-weight: 500; }
.btn > span { min-width: 0; }
.btn svg, .text-link svg { flex: 0 0 auto; }
.text-link { display: inline-flex; align-items: center; gap: 5px; line-height: 1.5; }
.text-link:hover { text-decoration: none; color: #164fd3; }
.text-link:hover > span { text-decoration: underline; text-underline-offset: 3px; }
input, select, textarea, .field { font-size: 13px; }
.toolbar { gap: 10px; padding: 17px 21px; }
.toolbar select { min-height: 36px; }
.tab { font-size: 13px; }
.tab span { font-size: 11px; }
.badge { font-size: 11px; padding: 4px 8px; border-radius: 5px; }
.panel, .card { border-radius: 9px; box-shadow: 0 2px 8px #28436903; }
.panel-heading { min-height: 60px; padding: 18px 21px 14px; }
.panel-heading h3 { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-heading h3 > svg { color: #465e87; }
.panel-heading h3 > span { min-width: 0; }
.panel-heading > .text-link { flex-shrink: 0; }
.panel-body { padding: 0 21px 21px; }
.stats { gap: 16px; margin-bottom: 22px; }
.stat { container-type: inline-size; min-height: 142px; padding: 20px 21px 18px; border-radius: 9px; box-shadow: 0 2px 8px #28436903; }
.stat-label { display: block; margin-bottom: 12px; color: #7c89a0; font-size: 13px; line-height: 1.5; }
.stat-main { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.stat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: #edf3ff; color: #3370ff; }
.stat-icon.green { color: #19a982; background: #eaf8f2; }
.stat-icon.orange { color: #e8a02a; background: #fff5e5; }
.stat-icon.purple { color: #8764d9; background: #f1edfc; }
.stat-icon.red { color: #df7180; background: #fff0f1; }
.stat-value { min-width: 0; font-size: 32px; font-size: clamp(24px, 12.8cqi, 34px); line-height: 1.2; font-weight: 650; letter-spacing: -.9px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.compact-value { font-size: 21px; font-size: clamp(18px, 9cqi, 23px); letter-spacing: -.3px; }
.stat-value small { font-size: 12px; color: #8d9bb0; margin-left: 5px; font-weight: 400; letter-spacing: 0; }
.analysis-goal-number { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.analysis-goal-number strong { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-note { color: #8c99ad; font-size: 11px; margin-top: 12px; min-height: 18px; line-height: 1.6; }
.stat.clickable { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; transition: border-color .16s, box-shadow .16s, transform .16s; }
.stat.clickable:hover { border-color: #a8c3ff; box-shadow: 0 5px 18px #2956990b; transform: translateY(-1px); }
table { font-size: 13px; }
th { font-size: 12px; font-weight: 500; color: #8090a8; background: #f7f9fc; padding: 13px 18px; }
td { padding: 16px 18px; color: #516078; line-height: 1.6; }
td strong { color: #273953; font-weight: 550; }
td .muted { font-size: 11px; margin-top: 3px; }
td .btn { font-size: 12px; min-height: 30px; padding: 5px 9px; }
.table-footer { font-size: 11px; padding: 15px 21px; }
.person-cell .muted { font-size: 11px; line-height: 1.5; }
.person-cell .avatar { width: 33px; height: 33px; font-size: 13px; }
.task-row .task-title { font-size: 13px; }
.task-row .task-meta { font-size: 11px; }
.task-row .task-icon { width: 34px; height: 34px; }
.quick-item { font-size: 12px; }
.quick-item .quick-icon { background: #f6f9ff; }
.today-item { min-height: 54px; border: 1px solid #e8edf5; border-radius: 7px; padding: 8px 11px; margin-bottom: 7px; }
.today-item:last-child { margin-bottom: 0; }
.today-item strong { font-size: 19px; }
.today-item:hover { border-color: #c5d8fb; background: #fbfdff; }
.today-item:nth-child(2) .today-icon, .today-icon.tone-green { color: #16a67a; background: #e9f8f1; }
.today-item:nth-child(3) .today-icon, .today-icon.tone-orange { color: #ef941c; background: #fff3e2; }
.today-item:nth-child(4) .today-icon { color: #e5757a; background: #fff0f1; }
.goal-mini { margin-top: 12px; }
.timeline small { font-size: 12px; }
.detail-item small { font-size: 12px; }
.detail-item strong { font-size: 14px; line-height: 1.6; }
.notice, .info-box { font-size: 13px; }
.preview-grid dt, .preview-follow p, .preview-follow small { font-size: 11px; }
.preview-grid dd, .preview-follow strong { font-size: 13px; }
.customer-preview-head p { font-size: 12px; }
.preview-actions .btn, .preview-actions .text-link { font-size: 12px; gap: 5px; }
.preview-business span { font-size: 11px; }
.preview-section h4 { display: flex; align-items: center; gap: 7px; }
.preview-section h4 svg { color: #6982ac; }
.preview-business strong { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; }
.preview-business strong svg { color: #3370ff; }
.wechat-account-grid { gap: 16px; margin-bottom: 20px; }
.wechat-account-card { padding: 0; border-radius: 9px; box-shadow: 0 2px 8px #28436903; transition: border-color .16s, box-shadow .16s; }
.wechat-account-card.selected { border-color: #3370ff; background: linear-gradient(130deg, #fff 30%, #f7faff); box-shadow: 0 5px 18px #285eab0c; }
.wechat-account-select { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px 8px 0 0; background: transparent; text-align: left; color: inherit; }
.wechat-account-select:hover { background: #f6f9ff80; }
.wechat-account-select:focus-visible { outline-offset: -4px; }
.wechat-account-head { padding: 22px 21px; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
.wechat-logo { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 11px; background: transparent; flex-shrink: 0; }
.wechat-logo .wechat-icon { width: 100%; height: 100%; }
.wechat-account-name { min-width: 0; font-size: 17px; font-weight: 650; display: block; line-height: 1.45; color: #23324e; overflow-wrap: anywhere; }
.wechat-account-device { display: block; font-size: 12px; color: #8a97ad; margin-top: 6px; line-height: 1.5; }
.wechat-account-metrics { padding: 0 21px 21px; }
.wechat-account-metrics > .account-metric { display: flex; align-items: center; gap: 9px; min-width: 0; border-right: 1px solid #e8edf4; padding: 0 14px 0 0; }
.wechat-account-metrics > .account-metric + .account-metric { border-right: 0; padding: 0 0 0 14px; }
.account-metric-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; color: #3777e5; background: #edf4ff; }
.account-metric + .account-metric .account-metric-icon { color: #18a783; background: #eaf8f2; }
.wechat-account-metrics strong { font-size: 28px; line-height: 1.2; letter-spacing: -.6px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wechat-account-metrics small { font-size: 11px; line-height: 1.5; margin-top: 5px; white-space: nowrap; }
.wechat-account-card .preview-actions { padding: 0 21px 21px; gap: 8px; }
.wechat-account-card .preview-actions > * { font-size: 12px; min-width: 0; padding: 8px 5px; }
.wechat-account-card .preview-actions svg { width: 14px; height: 14px; }
.wechat-account-card .preview-actions > :first-child { background: #3370ff; color: white; border-color: #3370ff; }
.wechat-detail-grid small { font-size: 12px; }
.wechat-detail-grid strong { font-size: 14px; }
.wechat-detail-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.wechat-detail-identity h3, .wechat-detail-identity strong { font-size: 18px; }
.wechat-detail-identity p { margin: 5px 0 0; color: #8291a8; font-size: 13px; }
.communication-summary { line-height: 1.65; }
.drawer { width: 620px; max-width: 96vw; color: var(--ink); border-left: 1px solid var(--border); box-shadow: -10px 0 45px #20385720; }
.drawer::backdrop, .detail-drawer::backdrop { background: #14213c42; backdrop-filter: blur(1px); }
.drawer > header, .detail-drawer > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; background: #fff; }
.drawer h2, .detail-drawer > header h2 { font-size: 19px; font-weight: 650; margin: 0; line-height: 1.4; }
.drawer #drawer-body { padding: 24px; }
.drawer .panel-heading { padding-left: 17px; padding-right: 17px; }
.drawer .stats { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawer .stat { padding: 17px; min-height: 128px; }
.drawer .stat-value { font-size: 27px; }
.drawer .stat-value.compact-value { font-size: 20px; }
.drawer .form-actions { padding: 20px 0 0; margin-top: 20px; }
.drawer.compact-dialog { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 480px; max-width: calc(100vw - 32px); height: auto; max-height: calc(100dvh - 48px); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 80px #21345330; }
.drawer.compact-dialog::backdrop { backdrop-filter: blur(2px); }
.drawer.compact-dialog > header { padding: 20px 24px 16px; }
.drawer.compact-dialog #drawer-body > :first-child { margin-top: 0; }
.detail-drawer { position: fixed; inset: 0 0 0 auto; width: min(1080px, 94vw); max-width: 94vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--border); background: #f6f9fd; color: var(--ink); overflow-y: auto; box-shadow: -16px 0 64px #20385726; }
.detail-drawer-body, #detail-drawer-body { padding: 24px; }
.detail-drawer .page-head { margin-bottom: 20px; align-items: flex-start; }
.detail-drawer .page-head h1 { font-size: 24px; }
.detail-drawer .page-head .actions { max-width: 52%; justify-content: flex-end; }
.detail-drawer .stats { gap: 12px; }
.detail-drawer .stat { min-height: 136px; padding: 17px 18px; }
.detail-drawer .stat-main { gap: 10px; }
.detail-drawer .stat-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
.detail-drawer .stat-icon svg { width: 21px; height: 21px; }
.detail-drawer .two-col { grid-template-columns: minmax(0, 1.45fr) minmax(270px, 1fr); gap: 16px; }
.detail-drawer .two-col > *, .detail-drawer .panel { min-width: 0; }
.detail-drawer .two-col.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-drawer .tabs { padding: 0 18px; gap: 24px; }
.detail-drawer .panel-heading { padding: 17px 18px 13px; }
.detail-drawer .detail-grid { padding: 19px; gap: 19px 14px; }
.detail-drawer .detail-row { overflow-wrap: anywhere; }
.detail-drawer .table-wrap { max-width: 100%; }
.detail-drawer .sales-module .timeline { margin-left: 20px; margin-right: 18px; }
.detail-drawer .sales-module .detail-row { padding-left: 18px; padding-right: 18px; }
.detail-drawer .breadcrumb { display: none; }
.detail-drawer .page-head { display: flex; }
.detail-drawer .page-head .actions { margin-top: 0; }
.detail-drawer .panel > .form-grid { padding: 20px; }
.detail-drawer .panel > .timeline { margin: 20px 22px; }
@media (min-width: 1100px) {
  .detail-drawer .stats { grid-template-columns: repeat(var(--stat-count, 4), minmax(0, 1fr)); }
  .detail-drawer .stat { min-height: 120px; padding: 15px 16px; }
  .detail-drawer .stat-label { margin-bottom: 9px; }
  .detail-drawer .stat-main { min-height: 36px; gap: 9px; }
  .detail-drawer .stat-value { font-size: 27px; font-size: clamp(23px, 13cqi, 28px); }
  .detail-drawer .stat-value.compact-value { font-size: 19px; }
  .detail-drawer .stat-note { margin-top: 9px; line-height: 1.5; }
}
@media (max-width: 1450px) and (min-width: 1081px) {
  .customer-master-detail { grid-template-columns: minmax(0, 1fr) 330px; }
  .customer-list-panel { overflow: hidden; }
}
@media (min-width: 1580px) {
  .stat { min-height: 149px; padding: 22px 24px 20px; }
  .stat-label { font-size: 14px; }
  .stat-note { font-size: 12px; }
}
@media (max-width: 1280px) {
  .stat { padding: 18px; }
  .stat-main { gap: 10px; }
  .stat-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
  .stat-icon svg { width: 21px; height: 21px; }
}
@media (max-width: 1080px) {
  .nav-child.active { box-shadow: none; }
  .detail-drawer .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-drawer .two-col, .detail-drawer .two-col.equal { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  h1, .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 12px; }
  .panel-heading { padding: 16px; }
  .panel-heading h3 { font-size: 15px; gap: 7px; }
  .panel-heading > .text-link { font-size: 12px; }
  .stat { padding: 17px; min-height: 132px; }
  .stat-value { font-size: 28px; }
  .stat-value.compact-value { font-size: 20px; }
  .detail-drawer { width: 100%; max-width: 100%; }
  .detail-drawer-body, #detail-drawer-body { padding: 16px; }
  .detail-drawer > header, .drawer > header { padding: 17px 18px; }
  .detail-drawer .page-head { display: block; }
  .detail-drawer .page-head .actions { max-width: none; justify-content: flex-start; margin-top: 14px; }
  .detail-drawer .stat { padding: 15px; }
  .detail-drawer .stat-value { font-size: 26px; }
  .detail-drawer .stat-value.compact-value { font-size: 18px; }
  .detail-drawer .stat-main { gap: 8px; }
  .detail-drawer .stat-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .drawer { max-width: 100%; }
  .drawer #drawer-body { padding: 20px; }
  .wechat-account-card .preview-actions { gap: 8px; }
}
.detail-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
#detail-back[hidden] { display: none; }
.module-tabs { display: none; }
@media (max-width: 720px) {
  .module-tabs { display: flex; gap: 7px; overflow-x: auto; max-width: 100%; margin: 0 0 18px; padding: 2px 1px 7px; scrollbar-width: thin; }
  .module-tabs a { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid #e2e9f3; border-radius: 7px; background: #fff; color: #667791; font-size: 12px; }
  .module-tabs a.active { color: #2468f2; border-color: #c4d7fb; background: #eaf2ff; font-weight: 600; }
}
@media (max-width: 460px) {
  .panel-heading { flex-wrap: wrap; gap: 10px; }
  .wechat-account-head { padding: 20px; }
  .detail-drawer .stats { grid-template-columns: 1fr !important; }
  .drawer .stats { grid-template-columns: 1fr; }
  .detail-drawer .stat { min-height: 128px; }
  .detail-drawer .stat-value { font-size: 30px; }
  .detail-drawer .stat-value.compact-value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .stat.clickable, .wechat-account-card { transition: none; }
  .stat.clickable:hover { transform: none; }
}

/* The overview keeps its daily work and first five tasks in one compact scan. */
@media (min-width: 1081px) {
  .page-home .dashboard-title { min-height: 42px; padding-top: 0; margin-bottom: 16px; }
  .page-home .dashboard-title > div:first-child { display: flex; align-items: baseline; gap: 16px; }
  .page-home .dashboard-title h1 { margin: 0; }
  .page-home .dashboard-title p { font-size: 12px; }
  .page-home > .stats { margin-bottom: 18px; }
  .page-home > .stats .stat { min-height: 132px; padding: 17px 21px; }
  .page-home > .stats .stat-label { margin-bottom: 8px; font-size: 13px; }
  .page-home > .stats .stat-note { margin-top: 8px; font-size: 11px; }
  .page-home .dashboard-grid { gap: 18px; margin-bottom: 18px; }
  .page-home .dashboard-grid > .panel { min-height: 320px; margin-bottom: 0; }
  .page-home .dashboard-grid .panel-heading { min-height: 48px; padding: 12px 18px 10px; }
  .page-home .dashboard-grid .panel-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 11px; }
  .page-home .dashboard-grid .panel-caption { margin: 0 !important; font-size: 11px !important; line-height: 1.5; }
  .page-home .trend-panel .panel-body { padding: 7px 18px 15px; }
  .page-home .trend-panel .legend { justify-content: flex-end; font-size: 11px; margin-bottom: 8px; }
  .page-home .trend-panel .line-chart { height: 220px; max-height: 220px; }
  .page-home .today-list { padding: 0 18px; }
  .page-home .today-item { min-height: 40px; padding: 5px 10px; margin-bottom: 6px; grid-template-columns: 28px 1fr auto 9px; gap: 10px; }
  .page-home .today-item:last-child { margin-bottom: 0; }
  .page-home .today-icon { width: 28px; height: 28px; border-radius: 6px; }
  .page-home .today-icon svg { width: 17px; height: 17px; }
  .page-home .today-item strong { font-size: 17px; }
  .page-home .goal-mini { margin: 8px 18px 12px; padding: 9px 12px; line-height: 1.35; }
  .page-home .goal-mini .progress { height: 5px; margin: 6px 0; }
  .page-home .goal-mini small { font-size: 11px; }
  .page-home .dashboard-grid + .panel { position: relative; }
  .page-home .dashboard-grid + .panel > .panel-heading { min-height: 54px; padding: 14px 19px; border-bottom: 1px solid var(--border); }
  .page-home .dashboard-grid + .panel > .tabs { position: absolute; top: 0; left: 146px; min-height: 54px; border: 0; padding: 0 16px; gap: 24px; }
  .page-home .dashboard-grid + .panel > .tabs .tab { padding: 15px 0; }
  .page-home .dashboard-grid + .panel th { padding: 10px 19px; }
  .page-home .dashboard-grid + .panel td { padding: 11px 19px; }
  .page-home .dashboard-grid + .panel .table-footer { padding: 11px 19px; }
}
@media (min-width: 1081px) and (max-width: 1320px) {
  .page-home .dashboard-title > div:first-child { gap: 10px; }
  .page-home .dashboard-title p { font-size: 11px; }
  .page-home .dashboard-grid .panel-heading { gap: 8px; }
  .page-home .today-panel .panel-caption { display: none; }
}
