/* ═══════════════════════════════════════════
   铭家会员运营管理系统
   Enterprise SaaS 风格
   ═══════════════════════════════════════════ */

:root {
  --bg: oklch(0.976 0.003 250);
  --bg-soft: oklch(0.97 0.003 250);
  --surface: oklch(1 0 0);
  --surface-soft: oklch(0.992 0.002 250);
  --surface-hv: oklch(0.966 0.005 250);

  --sb-bg: oklch(0.16 0.008 258);
  --sb-bg-2: oklch(0.20 0.008 258);
  --sb-text: oklch(0.98 0.003 96);
  --sb-muted: oklch(0.72 0.012 252);
  --sb-hover: oklch(0.26 0.012 258);
  --sb-active: oklch(0.42 0.10 175);

  --text: oklch(0.20 0.016 252);
  --text-sub: oklch(0.33 0.014 252);
  --text-muted: oklch(0.48 0.012 252);
  --text-inv: oklch(0.99 0.003 96);
  --money-color: var(--text);
  --money-symbol-color: var(--text-muted);

  --accent: oklch(0.44 0.11 175);
  --accent-2: oklch(0.48 0.10 210);
  --accent-bg: oklch(0.93 0.04 172);
  --accent-bg-2: oklch(0.93 0.03 210);
  --accent-hv: oklch(0.40 0.10 175);

  --ok: oklch(0.48 0.1 145);
  --ok-bg: oklch(0.94 0.04 145);
  --warn: oklch(0.63 0.1 68);
  --warn-bg: oklch(0.95 0.04 74);
  --err: oklch(0.53 0.13 28);
  --err-bg: oklch(0.95 0.03 28);
  --negative: var(--err);

  --ch-blue: oklch(0.54 0.12 250);
  --ch-teal: oklch(0.49 0.1 185);
  --ch-amber: oklch(0.68 0.11 76);
  --ch-pink: oklch(0.6 0.12 348);

  --border: oklch(0.92 0.006 248);
  --border-strong: oklch(0.87 0.008 248);
  --border-sb: oklch(1 0 0 / 0.08);

  --shadow-sm: 0 1px 2px oklch(0.16 0.02 245 / 0.03), 0 4px 12px oklch(0.16 0.02 245 / 0.03);
  --shadow-md: 0 6px 20px oklch(0.16 0.02 245 / 0.05);
  --shadow-lg: 0 12px 36px oklch(0.16 0.02 245 / 0.07);

  --sb-w: 238px;
  --tb-h: 66px;
  --r: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --font: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  --font-display: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;

  --fs-page-title: 18px;
  --fs-module-title: 16px;
  --fs-nav-primary: 14px;
  --fs-nav-secondary: 13px;
  --fs-body: 13px;
  --fs-table-head: 13px;
  --fs-caption: 12px;
  --fs-badge: 12px;
  --fw-title: 800;
  --fw-strong: 700;
  --fw-body: 600;
  --fw-caption: 500;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
}

html,
body,
.app,
.main,
.page,
.activity-coupon-workspace {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

input,
button,
select,
textarea {
  font: inherit;
  font-variant-numeric: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

::-webkit-scrollbar-track {
  display: none !important;
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  display: none !important;
  background: transparent !important;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: transparent !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.app::-webkit-scrollbar,
.main::-webkit-scrollbar,
.page::-webkit-scrollbar,
.activity-coupon-workspace::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.app {
  display: grid;
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  grid-template-rows: var(--tb-h) minmax(0, 1fr);
  grid-template-areas:
    "sb tb"
    "sb mn";
  width: 100vw;
  height: 100vh;
}

.sidebar {
  grid-area: sb;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  user-select: none;
  color: var(--sb-text);
  background: linear-gradient(180deg, var(--sb-bg), var(--sb-bg-2));
  border-right: 1px solid var(--border-sb);
}
.sidebar::-webkit-scrollbar { display: none }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border-sb);
}

.sidebar-logo-img {
  flex-shrink: 0;
  display: block;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  opacity: 0.96;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--sb-muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.sidebar-nav a:hover {
  background: var(--sb-hover);
  color: var(--sb-text);
  transform: translateX(1px);
}

.sidebar-nav a.active {
  color: var(--text-inv);
  background: var(--sb-active);
  box-shadow: 0 8px 20px oklch(0.15 0.02 258 / 0.25);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-group-title {
  justify-content: space-between;
}

.group-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.52;
  transition: transform 160ms ease;
}

.sidebar-group.open .group-chevron {
  transform: rotate(90deg);
}

.sidebar-group.open .sidebar-group-title {
  background: var(--sb-hover);
  color: var(--sb-text);
}

.sidebar-subnav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0 8px 14px;
}

.sidebar-group.open .sidebar-subnav {
  display: flex;
}

.sidebar-subnav a {
  position: relative;
  padding: 8px 14px 8px 28px;
  border-radius: 999px;
  color: var(--sb-muted);
  font-size: 13px;
  font-weight: 500;
}

.sidebar-subnav a::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  transform: translateY(-50%);
}

.sidebar-subnav a:hover {
  background: var(--sb-hover);
  color: var(--sb-text);
}

.sidebar-subnav a.active {
  color: var(--text-inv);
  background: var(--sb-active);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border-sb);
  color: var(--sb-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer span {
  line-height: 1.8;
}

.topbar {
  grid-area: tb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-select {
  height: 36px;
  min-width: 120px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: oklch(0.997 0.003 245);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.55);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 15px,
    calc(100% - 9px) 15px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.customer-text-input {
  padding-right: 14px;
  cursor: text;
  background-image: none;
  appearance: none;
  -webkit-appearance: none;
}

.customer-date-input {
  padding-right: 14px;
  background-image: none;
  appearance: auto;
}

.topbar-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-inv);
  background: var(--accent);
}

/* Sync status button */
.topbar-sync-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text-muted) 8%, transparent);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  box-shadow: none;
}
.topbar-sync-btn:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sync-dot.ok { background: var(--ok); }
.sync-dot.err { background: var(--err); animation: sync-dot-pulse 2s infinite; }
.sync-dot.muted { background: var(--text-muted); }
@keyframes sync-dot-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.topbar-text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.topbar-text-btn:hover {
  color: var(--accent);
}

.main {
  grid-area: mn;
  overflow-y: auto;
  padding: 28px 32px 34px;
  scrollbar-width: none;
}

.main::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body::-webkit-scrollbar,
.page::-webkit-scrollbar,
.activity-coupon-workspace::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page.active > * {
  animation: rise 220ms ease both;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, oklch(1 0 0), oklch(0.996 0.003 245));
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid var(--accent);
  pointer-events: none;
}

.kpi-card:nth-child(2n)::before {
  border-top-color: var(--accent-2);
}

.kpi-card:nth-child(3n)::before {
  border-top-color: var(--ch-blue);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi-value {
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.metric-empty {
  color: var(--text-muted);
  font-size: 30px;
  font-weight: 800;
}

.metric-status {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.metric-inline-pending {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 900;
}

.trend-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trend-block {
  position: relative;
  overflow: visible;
  padding: 20px 22px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, oklch(1 0 0), oklch(0.996 0.003 245));
  box-shadow: var(--shadow-sm);
}

.trend-block h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}

.trend-block .sub {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trend-block svg {
  width: 100%;
  aspect-ratio: 4 / 1;
  height: auto;
  overflow: visible;
}

.trend-grid {
  stroke: oklch(0.88 0.008 248);
  stroke-width: 0.45;
}

.trend-axis {
  stroke: oklch(0.80 0.008 248);
  stroke-width: 0.55;
}

.trend-tick {
  fill: var(--text-muted);
  font-size: 8px;
  font-weight: 600;
  font-family: var(--font);
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.trend-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.trend-stat-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.trend-stat strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.trend-tooltip {
  position: absolute;
  display: none;
  width: max-content;
  max-width: none;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
  display: none;
  align-items: center;
  gap: 6px;
}

.trend-tooltip-day {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 0;
}

.trend-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}

.trend-tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.trend-tooltip-value {
  margin-top: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.trend-tooltip-divider {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-filter-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin: 6px 0 18px;
  padding: 2px 0;
}

.dashboard-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-filter-label {
  width: 34px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dashboard-filter-pill {
  min-width: 62px;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid oklch(0.84 0.01 248);
  color: var(--text-sub);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 1px 0 oklch(0.15 0.02 245 / 0.03);
}

.dashboard-filter-pill[data-active="1"] {
  color: var(--text-inv);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 20px oklch(0.44 0.1 175 / 0.14);
}

.dashboard-source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: -4px 0 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-sync-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-live-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--accent);
  background: oklch(0.94 0.026 174);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-kpi-card {
  min-height: 158px;
  display: flex;
  flex-direction: column;
}

.dashboard-kpi-card .kpi-label {
  min-height: 34px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.dashboard-brand-split {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding-top: 14px;
}

.dashboard-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 12px;
  background: oklch(0.97 0.006 245);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-brand-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-unmatched-note {
  padding: 5px 9px;
  border-radius: 999px;
  background: oklch(0.95 0.004 245);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-unmatched-note strong {
  color: var(--text-sub);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-panel {
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, oklch(1 0 0), oklch(0.995 0.004 245));
  box-shadow: var(--shadow-sm);
}

.dashboard-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-panel-head h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.dashboard-panel-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-store-list,
.dashboard-alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-store-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.dashboard-store-row:last-child {
  border-bottom: 0;
}

.dashboard-store-row:hover strong {
  color: var(--accent);
}

.dashboard-rank {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 900;
}

.dashboard-store-main,
.dashboard-store-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.dashboard-store-main strong,
.dashboard-store-metric strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-store-main em,
.dashboard-store-metric em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-store-metric {
  align-items: flex-end;
  text-align: right;
}

.dashboard-alert {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-alert:last-child {
  border-bottom: 0;
}

.dashboard-alert-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--text-muted);
}

.dashboard-alert.ok .dashboard-alert-dot {
  background: var(--ok);
}

.dashboard-alert.warn .dashboard-alert-dot {
  background: var(--warn);
}

.dashboard-alert.info .dashboard-alert-dot {
  background: var(--accent);
}

.dashboard-alert strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.dashboard-alert em {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .dashboard-kpi-grid,
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-store-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .dashboard-store-metric {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.panel {
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.panel-header p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.panel-body {
  padding: 16px 20px 18px;
}

.panel-body.no-pad {
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  text-align: left;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: oklch(0.996 0.004 245);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: oklch(0.98 0.006 245);
}

tbody td:first-child {
  color: var(--text);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-brand {
  color: var(--accent);
  background: var(--accent-bg);
}

.pill-ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.pill-warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.pill-err {
  color: var(--err);
  background: var(--err-bg);
}

.pill-muted {
  color: var(--text-muted);
  background: var(--surface-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--text-inv);
  background: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hv);
}

.btn-ghost {
  color: var(--text-sub);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.btn-sm {
  min-height: 30px;
  padding: 6px 12px;
  font-size: 12px;
}

.alert-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  line-height: 1.65;
}

/* Activity operations surfaces */
.ops-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  box-shadow: 0 1px 2px oklch(0.16 0.02 245 / 0.03);
}

.activity-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  min-height: 74px;
  padding: 14px 16px 13px;
  background: var(--surface);
}

.activity-metric span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-metric strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--text);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.activity-metric em {
  align-self: end;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

/* Business analytics */
.analytics-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-scope-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.analytics-scope-note strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 950;
}

.orders-scope-note,
.member-order-scope-note {
  margin: 0 0 12px;
}

.analytics-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 0 8px;
}

.analytics-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 18px;
  width: 100%;
}

.analytics-filter-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.analytics-filter-line > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.analytics-filter-note {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-month-input {
  height: 34px;
  min-width: 148px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.analytics-time-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.analytics-coupon-detail-row td {
  padding-top: 0;
  background: oklch(0.985 0.005 245);
}

.analytics-coupon-detail {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--divider);
}

.analytics-coupon-detail-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.analytics-coupon-detail-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.analytics-coupon-detail-head span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.analytics-coupon-detail-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  border-collapse: separate;
  border-spacing: 0;
}

.analytics-coupon-detail-table th,
.analytics-coupon-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.analytics-coupon-detail-table th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.analytics-coupon-detail-table tr:last-child td {
  border-bottom: 0;
}

.analytics-coupon-detail-table td:first-child {
  min-width: 180px;
}

.analytics-coupon-detail-table td:first-child strong,
.analytics-coupon-detail-table td:first-child span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-coupon-detail-table td:first-child span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.analytics-activity-list {
  display: grid;
  gap: 12px;
}

.analytics-activity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.analytics-activity-tabs button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  max-width: min(420px, 100%);
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
  text-align: left;
}

.analytics-activity-tabs button.active {
  border-color: color-mix(in oklch, var(--accent) 55%, var(--border));
  background: oklch(0.97 0.018 175);
  color: var(--accent);
}

.analytics-activity-tabs strong,
.analytics-activity-tabs span,
.analytics-activity-tabs em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-tabs strong {
  font-size: 12px;
  font-weight: 950;
}

.analytics-activity-tabs span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.analytics-activity-tabs em {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.analytics-activity-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: oklch(0.985 0.005 245);
  box-shadow: var(--shadow-sm);
}

.analytics-activity-card.unified {
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
}

.analytics-activity-table-head {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  background: oklch(0.985 0.006 245);
}

.analytics-activity-table-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.analytics-activity-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.analytics-activity-title-line strong {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-title-line > span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.analytics-activity-head-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.analytics-activity-head-meta span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.analytics-activity-head-meta .context {
  color: var(--accent);
  font-weight: 650;
}

.analytics-activity-effect-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(72px, 0.38fr) minmax(78px, 0.42fr) minmax(78px, 0.42fr) minmax(116px, 0.62fr) minmax(78px, 0.42fr) minmax(104px, 0.56fr) minmax(104px, 0.56fr) minmax(104px, 0.56fr) minmax(76px, 0.4fr);
  gap: 8px;
  align-items: center;
  min-width: 1180px;
}

.analytics-activity-card.no-object .analytics-activity-effect-grid {
  grid-template-columns: minmax(72px, 0.52fr) minmax(78px, 0.56fr) minmax(78px, 0.56fr) minmax(116px, 0.82fr) minmax(78px, 0.56fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(76px, 0.56fr);
  min-width: 860px;
  padding-right: 22px;
  padding-left: 22px;
}

.analytics-activity-card.no-object .analytics-activity-effect-grid > :first-child {
  display: none;
}

.analytics-activity-card.no-object .analytics-activity-effect-head span,
.analytics-activity-card.no-object .analytics-activity-effect-row > strong {
  text-align: center;
}

.analytics-activity-effect-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  background: oklch(0.955 0.008 245);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.analytics-activity-effect-head span:not(:first-child),
.analytics-activity-effect-row > strong {
  text-align: right;
}

.analytics-activity-effect-row {
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}

.analytics-activity-effect-row.summary {
  border-bottom-color: color-mix(in oklch, var(--accent) 18%, var(--divider));
  background: oklch(0.97 0.018 175);
}

.analytics-activity-effect-row.coupon {
  background: var(--surface);
}

.analytics-activity-effect-row > strong {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.analytics-activity-effect-row.summary > strong {
  color: var(--text);
  font-size: 16px;
}

.analytics-activity-effect-row > strong.roi {
  color: var(--accent);
}

.analytics-activity-effect-row .money-value {
  color: inherit;
  font: inherit;
}

.analytics-activity-effect-row .money-symbol {
  font-size: 0.68em;
}

.analytics-profit-rate {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 0.72em;
  font-weight: 850;
  white-space: nowrap;
}

.analytics-metric strong .analytics-profit-rate {
  font-size: 0.58em;
}

.analytics-activity-effect-identity {
  min-width: 0;
}

.analytics-activity-effect-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.analytics-activity-effect-title strong,
.analytics-activity-effect-title a {
  min-width: 0;
  flex: 0 1 auto;
  overflow: visible;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  text-overflow: clip;
  white-space: normal;
}

.analytics-activity-effect-title a {
  color: var(--accent);
}

.analytics-activity-kind {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.analytics-activity-effect-row.coupon .analytics-activity-kind {
  color: var(--text-muted);
}

.analytics-activity-effect-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.analytics-activity-observe-line {
  flex-basis: 100% !important;
}

.analytics-activity-effect-meta span,
.analytics-activity-effect-meta button {
  flex: 0 0 auto;
}

.analytics-activity-effect-meta .analytics-daily-trigger {
  margin: -4px 0;
  padding: 4px 9px;
}

.analytics-activity-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 0.65fr) minmax(0, 4fr);
  gap: 22px;
  align-items: center;
  padding: 22px 34px 22px 28px;
  background: oklch(0.968 0.018 180);
}

.analytics-activity-main::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
}

.analytics-activity-title {
  display: none;
}

.analytics-activity-title strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.35;
}

.analytics-activity-title span,
.analytics-activity-periods span,
.analytics-activity-coupons-head span,
.analytics-activity-coupon-name span,
.analytics-activity-metric > span,
.analytics-activity-coupon-stat > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
}

.analytics-activity-title span {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-periods {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.analytics-activity-periods span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(76px, 1fr));
  gap: 16px;
}

.analytics-activity-metric,
.analytics-activity-coupon-stat {
  min-width: 0;
}

.analytics-activity-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.analytics-activity-metric strong .money-value,
.analytics-activity-coupon-stat strong .money-value {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.analytics-activity-metric strong .money-symbol,
.analytics-activity-coupon-stat strong .money-symbol {
  font-size: 0.68em;
}

.analytics-activity-metric.highlight strong,
.analytics-activity-coupon-stat .analytics-inline-link {
  color: oklch(0.48 0.13 220);
}

.analytics-activity-coupons {
  padding: 0;
  border-top: 1px solid var(--divider);
  background: oklch(0.976 0.007 245);
}

.analytics-activity-stores {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--divider);
  background: oklch(0.989 0.004 245);
}

.analytics-activity-daily {
  border-top: 1px solid var(--divider);
  background: var(--surface);
}

.analytics-activity-daily summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 22px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.analytics-activity-daily summary::-webkit-details-marker {
  display: none;
}

.analytics-activity-daily summary::after {
  content: "展开";
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
}

.analytics-activity-daily[open] summary::after {
  content: "收起";
}

.analytics-activity-daily summary em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.analytics-activity-coupons-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.analytics-activity-coupons-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.analytics-activity-coupons-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.analytics-activity-coupon-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.analytics-activity-coupon-group {
  display: grid;
  background: oklch(0.976 0.007 245);
}

.analytics-activity-store-list {
  display: grid;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.analytics-activity-daily-list {
  display: grid;
  gap: 1px;
  margin: 0 22px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.analytics-activity-coupon-item,
.analytics-activity-store-item,
.analytics-activity-daily-item {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(6, minmax(76px, 1fr));
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  background: var(--surface);
}

.analytics-activity-coupon-item {
  border-bottom: 1px solid var(--divider);
}

.analytics-activity-store-item {
  grid-template-columns: minmax(72px, 0.52fr) minmax(78px, 0.56fr) minmax(78px, 0.56fr) minmax(116px, 0.82fr) minmax(78px, 0.56fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(76px, 0.56fr);
  min-width: 860px;
}

.analytics-activity-store-head {
  display: grid;
  grid-template-columns: minmax(72px, 0.52fr) minmax(78px, 0.56fr) minmax(78px, 0.56fr) minmax(116px, 0.82fr) minmax(78px, 0.56fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(76px, 0.56fr);
  gap: 8px;
  align-items: center;
  min-width: 860px;
  padding: 10px 22px;
  background: oklch(0.955 0.008 245);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 950;
}

.analytics-activity-store-head span:not(:first-child),
.analytics-activity-store-item > strong {
  text-align: center;
}

.analytics-activity-store-item > strong {
  min-width: 0;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.analytics-activity-store-item .analytics-activity-coupon-name {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 6px;
  align-items: baseline;
}

.analytics-activity-store-item .analytics-activity-coupon-name > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.analytics-activity-coupon-store {
  padding: 0 0 14px;
  background: oklch(0.976 0.007 245);
}

.analytics-activity-coupon-store .analytics-activity-coupons-head {
  margin: 0;
  padding: 12px 22px 8px;
  border-top: 0;
}

.analytics-activity-coupon-store .analytics-activity-coupons-head strong {
  font-size: 12px;
}

.analytics-activity-coupon-store .analytics-daily-trigger {
  min-height: 24px;
  margin-top: 0;
  padding: 0 9px;
  background: var(--surface);
  font-size: 11px;
}

.analytics-activity-coupon-store .analytics-activity-store-list {
  border-radius: 0;
}

.analytics-activity-coupon-store .analytics-activity-store-item {
  grid-template-columns: minmax(72px, 0.52fr) minmax(78px, 0.56fr) minmax(78px, 0.56fr) minmax(116px, 0.82fr) minmax(78px, 0.56fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(76px, 0.56fr);
  gap: 8px;
  min-width: 860px;
  padding: 10px 22px;
  border-top: 1px solid var(--divider);
}

.analytics-activity-coupon-store .analytics-activity-store-head {
  grid-template-columns: minmax(72px, 0.52fr) minmax(78px, 0.56fr) minmax(78px, 0.56fr) minmax(116px, 0.82fr) minmax(78px, 0.56fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(104px, 0.72fr) minmax(76px, 0.56fr);
  min-width: 860px;
  padding: 9px 22px;
}

.analytics-activity-daily-item {
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(86px, 1fr));
}

.analytics-activity-coupon-name {
  min-width: 0;
}

.analytics-activity-coupon-name strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-coupon-name span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-activity-coupon-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.analytics-activity-coupon-meta span {
  display: inline;
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
  color: inherit;
  font: inherit;
}

.analytics-activity-coupon-meta span + span::before {
  content: "·";
  margin-right: 7px;
  color: var(--text-muted);
}

.analytics-activity-coupon-meta .analytics-activity-coupon-id {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-daily-trigger {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: fit-content;
  min-height: 26px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.analytics-activity-coupon-meta .analytics-daily-trigger {
  min-height: 24px;
  margin-top: 0;
  padding: 0 9px;
  font-size: 11px;
}

.analytics-daily-trigger:hover:not(:disabled) {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--border));
  color: var(--accent);
}

.analytics-daily-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.modal-overlay.analytics-daily-modal {
  z-index: 1200;
}

.modal-box.analytics-daily-modal-box {
  width: min(920px, calc(100vw - 80px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 24px 28px;
  border-radius: 14px;
}

.analytics-daily-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.analytics-daily-modal-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 950;
}

.analytics-daily-modal-head p {
  margin: 0;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 850;
}

.analytics-daily-modal-list {
  margin: 0;
  overflow-x: auto;
}

.analytics-activity-daily-head,
.analytics-daily-modal-list .analytics-activity-daily-item {
  grid-template-columns: minmax(150px, 1.05fr) minmax(76px, 0.52fr) minmax(76px, 0.52fr) minmax(90px, 0.62fr) minmax(112px, 0.78fr) minmax(96px, 0.66fr) minmax(72px, 0.48fr);
  min-width: 820px;
}

.analytics-activity-daily-head {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 950;
}

.analytics-daily-modal-list .analytics-activity-daily-item {
  gap: 14px;
  padding: 10px 16px;
}

.analytics-daily-modal-list .analytics-activity-daily-item > strong {
  min-width: 0;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.analytics-daily-modal-list .analytics-activity-coupon-name strong {
  font-size: 13px;
}

.analytics-daily-modal-list .analytics-activity-coupon-name span {
  margin-top: 2px;
}

.analytics-daily-modal-box [data-action="close-activity-daily"] {
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 8px;
}

.analytics-activity-coupon-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.analytics-grain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.analytics-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.analytics-field-picker {
  position: relative;
}

.analytics-field-picker summary {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.analytics-field-picker summary::-webkit-details-marker {
  display: none;
}

.analytics-field-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 360px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 36px oklch(0.16 0.02 245 / 0.14);
}

.analytics-field-note {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.analytics-field-menu label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-field-menu label.locked {
  color: var(--text-muted);
}

.analytics-field-menu input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.analytics-filter-line select {
  min-width: 116px;
  min-height: 28px;
  padding: 4px 28px 4px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-sub);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
}

.analytics-filter-line select:hover,
.analytics-filter-line select:focus {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

.analytics-brand-combo {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-soft) 100%);
  color: var(--accent);
  box-shadow: 0 1px 3px oklch(0.16 0.02 245 / 0.12);
  overflow: hidden;
}

.analytics-brand-combo button {
  min-height: 28px;
  padding: 5px 10px 5px 12px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.analytics-brand-combo.active button {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px oklch(0.16 0.02 245 / 0.12);
}

.analytics-brand-combo select {
  min-width: 104px;
  min-height: 24px;
  padding: 3px 24px 3px 9px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  background-color: transparent;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
}

.analytics-brand-combo select:hover,
.analytics-brand-combo select:focus {
  border-color: var(--border);
  background: transparent;
}

.analytics-clear-link {
  min-height: 28px;
  padding: 4px 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.analytics-clear-link:hover {
  color: var(--accent-hv);
}

.analytics-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.analytics-segment button {
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.analytics-segment button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px oklch(0.16 0.02 245 / 0.12);
}

.analytics-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--border);
}

.analytics-tabs button,
.analytics-tabs a {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 10px;
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.analytics-tabs button::after,
.analytics-tabs a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.analytics-tabs button.active,
.analytics-tabs a.active {
  color: var(--accent);
}

.analytics-tabs button.active::after,
.analytics-tabs a.active::after {
  background: var(--accent);
}

.activity-coupon-tabs {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-coupon-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-tab-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.analytics-section-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.analytics-section-tabs button {
  min-height: 32px;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.analytics-section-tabs button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px oklch(0.16 0.02 245 / 0.12);
}

.analytics-tab-note {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analytics-overview-module {
  min-height: 254px;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), oklch(0.99 0.004 245));
  box-shadow: 0 12px 26px oklch(0.16 0.02 245 / 0.04);
}

.analytics-overview-module.featured {
  border-color: oklch(0.84 0.045 174);
  background:
    radial-gradient(circle at 86% 8%, oklch(0.92 0.045 174), transparent 36%),
    linear-gradient(145deg, oklch(0.995 0.006 174), oklch(0.955 0.018 174));
}

.analytics-overview-module-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.analytics-overview-module-head strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.analytics-overview-module-head span {
  max-width: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  text-align: left;
  word-break: keep-all;
}

.analytics-overview-module.up .analytics-overview-module-head span {
  color: var(--ok);
}

.analytics-overview-module.down .analytics-overview-module-head span {
  color: var(--warn);
}

.analytics-overview-module-body {
  display: grid;
  flex: 1;
  align-content: stretch;
  gap: 10px;
  margin-top: 16px;
}

.analytics-overview-module-body div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
}

.analytics-overview-module-body em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.analytics-overview-module-body b {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.02em;
  text-align: right;
}

.analytics-overview-module-body small {
  flex: 0 0 100%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.money-symbol {
  display: inline-block;
  margin-right: 0;
  color: var(--money-symbol-color);
  font-size: 0.68em;
  font-weight: 900;
  line-height: 1;
  vertical-align: 0.12em;
}

.money-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--money-color);
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: inherit;
  white-space: nowrap;
  word-break: keep-all;
}

.analytics-overview-module.featured .analytics-overview-module-body b {
  color: var(--accent);
  font-size: 20px;
}

.analytics-business-board {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.6fr);
  gap: 14px;
}

.analytics-primary-card {
  min-height: 238px;
  padding: 24px 26px;
  border: 1px solid oklch(0.86 0.025 174);
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 14%, oklch(0.92 0.045 174), transparent 34%),
    linear-gradient(145deg, oklch(0.99 0.006 174), oklch(0.95 0.018 174));
  box-shadow: 0 18px 36px oklch(0.44 0.1 175 / 0.1);
}

.analytics-primary-card span,
.analytics-overview-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 900;
}

.analytics-primary-card strong {
  display: block;
  margin-top: 22px;
  color: var(--accent);
  font-size: 40px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.analytics-primary-card em,
.analytics-overview-metric em {
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.analytics-primary-card.up em,
.analytics-overview-metric.up em {
  color: var(--ok);
}

.analytics-primary-card.down em,
.analytics-overview-metric.down em {
  color: var(--warn);
}

.analytics-primary-sub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.analytics-primary-sub b {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: oklch(1 0 0 / 0.7);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.analytics-secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.analytics-overview-metric {
  min-height: 114px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.analytics-overview-metric strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.analytics-overview-metric.up strong {
  color: var(--ok);
}

.analytics-overview-metric.down strong {
  color: var(--warn);
}

.analytics-trend-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
}

.analytics-trend-card {
  padding: 18px 20px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, oklch(1 0 0), oklch(0.985 0.004 245));
  box-shadow: 0 12px 28px oklch(0.16 0.02 245 / 0.05);
}

.analytics-trend-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.analytics-trend-card-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.analytics-trend-card-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.analytics-trend-card-head em {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-metric-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.analytics-metric-switch button {
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
}

.analytics-metric-switch button.active {
  border-color: oklch(0.72 0.09 174);
  background: var(--accent-bg);
  color: var(--accent);
}

.analytics-trend-bars {
  display: grid;
  grid-template-columns: repeat(var(--trend-count, 7), minmax(0, 1fr));
  align-items: end;
  gap: clamp(2px, 0.42vw, 8px);
  min-height: 166px;
  overflow: visible;
  padding: 8px 2px 0;
}

.analytics-trend-bar {
  position: relative;
  display: grid;
  grid-template-rows: 128px auto;
  align-items: end;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.analytics-trend-bar i {
  display: block;
  width: 20px;
  max-width: 100%;
  min-height: 4px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, var(--accent), oklch(0.58 0.11 174));
  box-shadow: 0 8px 16px oklch(0.44 0.1 175 / 0.16);
}

.analytics-trend-bar:hover i {
  background: linear-gradient(180deg, oklch(0.56 0.13 174), var(--accent));
  box-shadow: 0 10px 20px oklch(0.44 0.1 175 / 0.22);
}

.analytics-trend-bar span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-trend-tip {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 5;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 24px oklch(0.16 0.02 245 / 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -92%);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.analytics-trend-tip strong,
.analytics-trend-tip span {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
  word-break: keep-all;
}

.analytics-trend-tip span {
  margin-top: 3px;
  color: var(--text-muted);
  font-weight: 800;
}

.analytics-trend-bar:hover .analytics-trend-tip {
  opacity: 1;
  transform: translate(-50%, -104%);
}

.analytics-decision-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-trend-table table th,
.analytics-trend-table table td,
.analytics-daily-table table th,
.analytics-daily-table table td {
  text-align: center;
}

.analytics-trend-table table th:first-child,
.analytics-trend-table table td:first-child,
.analytics-daily-table table th:first-child,
.analytics-daily-table table td:first-child {
  text-align: left;
}

.analytics-daily-table th button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.analytics-daily-table th:first-child button {
  justify-content: flex-start;
}

.sort-mark {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.analytics-conclusion-list,
.analytics-issue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analytics-conclusion,
.analytics-issue {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.analytics-conclusion b,
.analytics-issue strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.analytics-conclusion em,
.analytics-issue p {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
}

.analytics-issue span {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.analytics-conclusion.warn,
.analytics-issue.warn {
  border-color: oklch(0.86 0.05 76);
  background: var(--warn-bg);
}

.analytics-conclusion.ok,
.analytics-issue.ok {
  border-color: oklch(0.84 0.04 155);
  background: oklch(0.96 0.018 155);
}

.analytics-change-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-change.up strong {
  color: var(--ok);
}

.analytics-change.down strong {
  color: var(--warn);
}

.analytics-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

.analytics-section-head .segment-action-link {
  flex: 0 0 auto;
}

.analytics-section-head strong,
.analytics-block-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.analytics-section-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-block-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-block-title span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-block-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.analytics-block-actions em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.analytics-kpi-grid.compact.recovery.continuous-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-inline-link {
  color: oklch(0.48 0.13 220);
  font-weight: 900;
  text-decoration: none;
  transition: color 140ms ease;
}

.analytics-inline-link:hover {
  color: oklch(0.38 0.15 225);
}

.analytics-inline-link:visited {
  color: oklch(0.48 0.13 220);
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.analytics-kpi-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-kpi-grid.compact.recovery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-kpi-grid.compact.recovery.coupon-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.analytics-kpi-grid.compact.recovery.activity-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analytics-kpi-grid.compact.recovery.activity-kpis .analytics-metric {
  min-height: 92px;
  padding: 15px 14px;
}

.analytics-kpi-grid.compact.recovery.activity-kpis .analytics-metric > span {
  font-size: 11px;
}

.analytics-kpi-grid.compact.recovery.activity-kpis .analytics-metric strong {
  margin-top: 6px;
  font-size: 24px;
}

.analytics-kpi-grid.compact.recovery.activity-kpis .analytics-metric em {
  display: block;
  max-width: 100%;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-metric {
  min-height: 92px;
  padding: 16px 18px;
  background: var(--surface);
}

.analytics-metric-link {
  display: block;
  width: 100%;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.analytics-metric-link strong {
  color: oklch(0.48 0.13 220);
  text-decoration: none;
  transition: color 140ms ease;
}

.analytics-metric-link:hover strong,
.analytics-metric-link:focus-visible strong {
  color: oklch(0.38 0.15 225);
}

.analytics-metric > span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

.analytics-metric strong .money-value {
  font: inherit;
  letter-spacing: 0;
}

.analytics-metric em {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.analytics-metric.pending strong {
  color: var(--text-muted);
  font-size: 20px;
}

.analytics-kpi-grid.pending .analytics-metric {
  background: rgba(255, 255, 255, 0.68);
}

.analytics-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 18px;
}

.analytics-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.analytics-table-note {
  padding: 10px 14px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-alert-list,
.analytics-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-alert,
.analytics-report-card {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.analytics-alert strong,
.analytics-report-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.analytics-alert span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-alert p,
.analytics-report-card p {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
}

.analytics-alert.warning,
.analytics-alert.warn {
  border-color: oklch(0.86 0.05 76);
  background: var(--warn-bg);
}

.analytics-alert.error,
.analytics-alert.err {
  border-color: oklch(0.84 0.06 28);
  background: var(--err-bg);
}

.analytics-report-card .segment-action-link {
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .analytics-filter-row,
  .analytics-filter-line {
    flex-wrap: wrap;
  }

  .analytics-split,
  .analytics-business-board,
  .analytics-module-grid,
  .analytics-alert-list,
  .analytics-download-grid,
  .analytics-overview-head,
  .analytics-conclusion-list,
  .analytics-issue-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-grid,
  .analytics-kpi-grid.compact,
  .analytics-kpi-grid.coupon-kpis,
  .analytics-kpi-grid.activity-kpis,
  .analytics-kpi-grid.continuous-kpis,
  .analytics-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-coupon-detail {
    grid-template-columns: 1fr;
  }

  .analytics-coupon-detail-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .analytics-activity-main,
  .analytics-activity-coupon-item,
  .analytics-activity-store-item,
  .analytics-activity-daily-item {
    grid-template-columns: 1fr;
  }

  .analytics-activity-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ops-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.activity-filter-bar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  align-items: stretch;
}

.ops-toolbar-fields {
  display: grid;
  flex: 1;
  gap: 10px;
  min-width: 0;
}

.activity-filter-row,
.activity-search-row,
.activity-create-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 158px)) minmax(280px, 1fr) auto;
  column-gap: 22px;
  width: 100%;
}

.activity-search-row {
  justify-content: space-between;
}

.activity-create-row {
  justify-content: flex-end;
  min-height: 30px;
}

.ops-toolbar .activity-filter-row select,
.ops-toolbar .activity-filter-row input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.ops-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.activity-register-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 2px 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.activity-register-link::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 1280px) {
  .activity-filter-row {
    grid-template-columns: repeat(4, minmax(118px, 1fr)) minmax(220px, 1.35fr) auto;
    column-gap: 14px;
  }
}

.ops-toolbar select,
.ops-toolbar input,
.modal-box select {
  height: 36px;
  min-width: 150px;
  padding: 0 34px 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  outline: none;
  color: var(--text-sub);
  background-color: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.modal-box select {
  width: 100%;
  margin-bottom: 12px;
}

.modal-box select[multiple] {
  height: auto;
  min-height: 156px;
  padding: 8px 10px;
  background-image: none;
}

.ops-toolbar input {
  min-width: 260px;
  padding-right: 12px;
  font-weight: 600;
}

.ops-toolbar select,
.modal-box select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 14px,
    calc(100% - 9px) 14px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.ops-toolbar select:focus,
.ops-toolbar input:focus,
.modal-box select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.ops-table-panel,
.ops-trend-panel {
  border-radius: 8px;
  box-shadow: none;
}

.ops-panel-header {
  min-height: 56px;
  padding: 13px 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}

.ops-panel-header span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-table thead th {
  padding: 10px 12px;
  background: var(--surface-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.ops-table tbody td {
  padding: 11px 12px;
  font-size: 13px;
}

.ops-table tbody td:nth-child(6) {
  color: var(--text-muted);
  white-space: nowrap;
}

.ops-table tbody td:last-child {
  white-space: nowrap;
}

.ops-table .btn-sm {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 7px;
}

.activity-list-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-table-wrap {
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.activity-store-name {
  color: var(--text-muted);
  font-weight: 700;
}

.activity-coupon-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-coupon-line {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.activity-coupon-line span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-cost-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-cost-stack span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-form-page {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.activity-form-card {
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.activity-form-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.activity-form-note {
  max-width: 920px;
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.activity-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(160px, 0.85fr) minmax(160px, 0.85fr);
  gap: 14px;
  margin-top: 12px;
}

.activity-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.activity-field-span-2 {
  grid-column: span 2;
}

.activity-field-coupon {
  grid-column: span 2;
}

.activity-field > span,
.activity-section-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.activity-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-form-card .segment-text-input {
  height: 40px;
}

.activity-form-card select.segment-text-input {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 10px) 17px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.activity-audience-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.activity-audience-note strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.activity-audience-note span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-audience-note div {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.activity-coupon-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.activity-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-coupon-select {
  width: 100%;
  min-height: 40px;
}

.coupon-page {
  gap: 18px;
}

.coupon-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.coupon-filter-bar .ops-toolbar-fields {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(140px, 180px) minmax(280px, 1fr);
  align-items: center;
  gap: 12px;
}

.coupon-filter-bar select,
.coupon-filter-bar input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.coupon-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coupon-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.coupon-section-head strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.coupon-section-head span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.coupon-table-wrap {
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.coupon-price-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 104px;
  white-space: nowrap;
}

.coupon-price-cell .coupon-cost-value,
.coupon-price-cell .coupon-cost-missing {
  display: inline-flex;
  align-items: baseline;
  min-width: 62px;
}

.coupon-price-cell .coupon-cost-btn {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.coupon-store-name {
  color: var(--text-muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .coupon-filter-bar {
    grid-template-columns: 1fr;
  }

  .coupon-filter-bar .ops-toolbar-fields {
    grid-template-columns: 1fr;
  }

  .coupon-filter-bar .ops-toolbar-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 1200px) {
  .activity-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-field-span-2,
  .activity-field-coupon {
    grid-column: span 2;
  }
}

.ops-trend-panel {
  max-width: 520px;
}

.ops-trend-table tbody td:last-child {
  color: var(--text);
  font-weight: 800;
}

.alert-item.warn {
  border-left: 4px solid var(--warn);
}

.alert-item.info {
  border-left: 4px solid var(--accent);
}

.customer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.customer-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.customer-list-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.customer-list-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.customer-list-total {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(0, 111, 92, 0.16);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.customer-list-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Page control modules: date filter, search filter, pagination. */
.page-filter-bar {
  width: 100%;
}

.page-pagination {
  width: 100%;
}

.customer-search {
  width: 100%;
  min-width: 0;
}

.customer-search-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.orders-filter {
  margin-bottom: 12px;
  align-items: stretch;
}

.orders-time-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.orders-time-row > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.orders-filter-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.72fr) minmax(132px, 0.86fr) minmax(124px, 0.78fr) minmax(124px, 0.78fr) minmax(120px, 0.76fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.orders-filter-row .btn {
  min-width: 68px;
  padding-inline: 16px;
}

.products-page .product-filter-row {
  display: grid;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.products-page .product-items-filter-row {
  grid-template-columns:
    minmax(96px, 0.7fr)
    minmax(104px, 0.76fr)
    minmax(96px, 0.68fr)
    minmax(96px, 0.66fr)
    minmax(112px, 0.72fr)
    minmax(180px, 1.08fr)
    auto
    auto;
}

.products-page .product-order-items-filter-row {
  grid-template-columns:
    minmax(128px, 0.8fr)
    minmax(128px, 0.8fr)
    minmax(104px, 0.7fr)
    minmax(118px, 0.78fr)
    minmax(104px, 0.7fr)
    minmax(112px, 0.72fr)
    minmax(128px, 0.82fr)
    minmax(112px, 0.72fr)
    minmax(220px, 1.3fr)
    auto
    auto;
}

.products-page .product-filter-row select,
.products-page .product-filter-row input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.products-page .product-filter-row .btn {
  min-width: 62px;
  padding-inline: 14px;
  white-space: nowrap;
}

.orders-time-segment {
  flex-wrap: wrap;
}

.orders-custom-range {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.orders-custom-range.is-active {
  display: inline-flex;
}

.orders-custom-range input {
  width: 136px;
  min-height: 34px;
}

.orders-custom-range span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.orders-filter input,
.orders-filter select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

.orders-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.orders-status-chip {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.orders-status-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text-inv);
}

.orders-table table {
  min-width: 940px;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
  text-align: right;
}

.orders-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.order-main {
  color: var(--text);
  font-weight: 800;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-member-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  min-width: 0;
  white-space: nowrap;
}

.order-member-chip {
  min-width: 74px;
}

.order-member-phone {
  margin-top: 0;
}

.order-phone-cell {
  color: var(--text-sub);
  font-weight: 800;
  white-space: nowrap;
}

.order-id {
  max-width: 172px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-time-cell {
  color: var(--text-sub);
  font-weight: 800;
  white-space: nowrap;
}

.orders-amount-cell strong {
  color: var(--text);
  font-size: 15px;
}

.orders-match-pill {
  margin-left: 6px;
}

.orders-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.orders-source-c7 {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
}

.orders-source-member {
  background: var(--surface-soft);
}

.order-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.order-detail-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.order-detail-head span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.order-detail-amount {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, auto) minmax(96px, auto);
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.order-detail-amount span,
.order-detail-amount em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.order-detail-amount strong {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.order-detail-amount em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.11);
  color: var(--ok);
  line-height: 1;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-detail-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.order-detail-section h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.order-detail-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}

.order-detail-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.order-detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 900px) {
  .order-detail-grid,
  .order-detail-amount {
    grid-template-columns: 1fr;
  }
}

.orders-pagination {
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .orders-filter {
    align-items: stretch;
  }

  .orders-filter-row {
    grid-template-columns: minmax(104px, 0.7fr) minmax(124px, 0.84fr) minmax(116px, 0.76fr) minmax(116px, 0.76fr) minmax(112px, 0.72fr) auto auto;
  }

}

.customer-name {
  font-weight: 700;
  color: var(--text);
}

.customer-sub {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.customer-inline-cell,
.customer-id-cell,
.customer-time-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-inline-cell {
  align-items: flex-start;
}

.customer-store-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.customer-store-line.stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  white-space: normal;
}

.customer-store-sep {
  color: var(--text-muted);
  font-weight: 700;
  flex: 0 0 auto;
}

.customer-inline-main {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  word-break: break-word;
}

.customer-inline-brand {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.customer-inline-brand.muted {
  color: var(--warn);
}

.customer-source-chip,
.customer-phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 2px 8px 2px 3px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.customer-source-chip.is-wecom {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: oklch(0.74 0.09 171 / 0.25);
}

.customer-source-chip.is-shanglong {
  color: #8a5b15;
  background: oklch(0.96 0.03 84 / 0.8);
  border-color: oklch(0.8 0.08 84 / 0.26);
}

.customer-phone-chip.is-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: oklch(0.75 0.08 152 / 0.26);
}

.customer-phone-chip.is-muted {
  color: var(--text-muted);
  background: var(--surface-soft);
  border-color: var(--border);
}

.customer-source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border-radius: 999px;
  line-height: 1;
  background: oklch(1 0 0 / 0.55);
  color: currentColor;
}

.customer-source-icon svg {
  width: 11px;
  height: 11px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-id-cell {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  cursor: default;
}

.customer-id-text {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  cursor: default;
}

.customer-member-id-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.customer-member-id-link {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ch-blue);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: color 140ms ease;
}

.customer-member-id-link:hover {
  color: var(--accent-2);
}

.customer-member-source-id {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.customer-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.customer-status-stack .pill {
  min-width: 92px;
  justify-content: center;
}

.customer-identity-chips {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
}

.identity-chip-wecom-ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.identity-chip-wecom-missing {
  color: #5b6470;
  background: rgba(100, 116, 139, 0.16);
}

.identity-chip-shanglong-ok {
  color: #1f5fa8;
  background: rgba(37, 99, 235, 0.11);
}

.identity-chip-shanglong-order {
  color: #9a5b00;
  background: rgba(217, 153, 23, 0.14);
}

.identity-chip-shanglong-missing {
  color: #5b6470;
  background: rgba(100, 116, 139, 0.16);
}

.customer-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 18px;
  margin-left: 0;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 5px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.customer-copy-btn:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.customer-copy-btn.copied {
  color: var(--ok);
  border-color: var(--ok);
}

.customer-name {
  display: inline-block;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-customer thead th {
  text-align: center;
}

#page-customer tbody td {
  text-align: center;
}

#page-customer .customer-inline-cell,
#page-customer .customer-id-cell,
#page-customer .customer-member-id-cell,
#page-customer .customer-time-stack {
  align-items: center;
}

#page-customer .customer-store-line,
#page-customer .customer-id-cell,
#page-customer .customer-inline-cell,
#page-customer .customer-member-id-cell,
#page-customer .customer-time-line {
  justify-content: center;
}

#page-customer .customer-name {
  margin: 0 auto;
}

.customer-toolbar-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-toolbar-row {
  display: grid;
  gap: 10px;
  align-items: center;
  justify-content: stretch;
}

.customer-toolbar-row-main {
  grid-template-columns: minmax(220px, 1.35fr) minmax(126px, 0.7fr) minmax(145px, 0.82fr) minmax(132px, 0.72fr) minmax(160px, 0.82fr) auto;
  gap: 12px;
}

.customer-toolbar-row-primary {
  grid-template-columns: minmax(280px, 1.4fr) minmax(170px, 0.7fr) minmax(190px, 0.8fr);
  gap: 12px;
}

.customer-toolbar-row-secondary {
  grid-template-columns: minmax(170px, 0.7fr) minmax(210px, 0.85fr) auto;
  justify-content: start;
  gap: 12px;
}

.customer-toolbar-row-single {
  grid-template-columns: minmax(240px, 1.45fr) minmax(128px, 0.7fr) minmax(150px, 0.8fr) minmax(128px, 0.72fr) minmax(150px, 0.82fr) auto;
  gap: 10px;
}

.customer-toolbar-compact {
  margin-bottom: 12px;
}

.customer-toolbar-compact .customer-filter-field {
  gap: 0;
}

.customer-toolbar-compact .customer-filter-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.customer-toolbar-compact .customer-toolbar-actions {
  padding-top: 0;
}

.customer-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.customer-filter-field > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.customer-filter-keyword {
  min-width: 0;
}

.customer-toolbar-row-sub {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  padding-left: 18px;
}

.customer-time-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.customer-time-group-single {
  flex: 1 1 auto;
}

.customer-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-left: 0;
  padding-top: 17px;
  white-space: nowrap;
}

.customer-time-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.customer-time-dates {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.customer-time-group .customer-search {
  width: auto;
  min-width: 120px;
  flex: 0 0 auto;
}

.customer-time-group-single .customer-time-type {
  min-width: 136px;
}

.customer-time-group-single .customer-time-preset {
  min-width: 136px;
}

.customer-time-group .customer-date-input {
  width: 118px;
}

.customer-time-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
  text-align: left;
  flex: 0 0 auto;
}

.customer-time-dash {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-toolbar-grid .customer-search,
.customer-toolbar-grid .btn {
  min-width: 0;
}

.customer-toolbar-row-main .customer-search {
  width: 100%;
}

.customer-toolbar-grid .btn {
  white-space: nowrap;
}

.customer-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px 16px;
  border-top: 1px solid color-mix(in oklab, var(--border) 68%, transparent);
}

.customer-pagination-summary {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  padding-left: 0;
}

.customer-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

.customer-page-gap {
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 2px;
}

.customer-time-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.customer-time-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.customer-time-value {
  text-align: left;
}

.customer-time-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-row.selected {
  background: oklch(0.97 0.01 174 / 0.7);
}

.row-disabled {
  opacity: 0.58;
}

.perm-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.perm-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font-size: 13px;
  transition: all 140ms ease;
}

.perm-checkbox-item.checked {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.perm-checkbox-item input {
  accent-color: var(--accent);
}

.empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, oklch(0.96 0.03 174 / 0.16), transparent 35%),
    radial-gradient(circle at 80% 0%, oklch(0.95 0.03 245 / 0.14), transparent 30%),
    var(--bg);
}

.login-box {
  width: min(460px, calc(100vw - 32px));
  padding: 42px 40px 36px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-logo {
  margin-bottom: 22px;
  text-align: center;
}

.login-box h1 {
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.04em;
}

.login-form {
  margin-top: 28px;
}

.login-box label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-box input,
.modal-box input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  outline: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.login-box input:focus,
.modal-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.login-box input {
  margin-bottom: 18px;
}

.login-box .btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 15px;
}

.login-error {
  display: none;
  margin-bottom: 12px;
  color: var(--err);
  font-size: 12.5px;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.18 0.01 84 / 0.38);
  backdrop-filter: blur(6px);
}

.modal-box {
  width: min(420px, calc(100vw - 32px));
  padding: 30px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.modal-box h3 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.modal-box label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-box input {
  margin-bottom: 12px;
}

.modal-error {
  margin-bottom: 10px;
  color: var(--err);
  font-size: 12px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.store-modal-box {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  margin: auto;
}

.store-modal-box .filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.store-modal-box label {
  margin-bottom: 0;
}

.store-modal-box input,
.store-modal-box select {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 0;
}

.store-modal-box button[type="submit"] {
  justify-self: end;
  grid-column: 1 / -1;
}

.member-target-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-report-page {
  gap: 14px;
}

.member-report-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.member-report-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 8px;
}

.member-report-filters {
  flex: 1;
  padding: 0;
}

.member-report-segment {
  flex-wrap: wrap;
  max-width: 100%;
}

.member-report-filter-row-inline {
  width: auto;
}

.member-report-segment button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.member-report-brand-combo select {
  min-width: 150px;
}

.member-report-block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.member-report-block-title strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.member-report-block-title span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.member-report-row-active {
  background: var(--accent-bg);
}

.member-report-date-line {
  min-height: 34px;
}

.member-report-date-input {
  width: 150px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.member-report-date-input:focus {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.member-report-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.member-report-head p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.member-report-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-report-actions label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.member-report-actions input {
  width: 150px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.member-report-actions input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.57 0.12 165 / 0.12);
}

.member-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
  gap: 1px;
}

.member-report-summary-cell {
  min-height: 86px;
  padding: 15px 18px;
  background: var(--surface);
}

.member-report-summary-cell span,
.member-report-summary-cell em {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.member-report-summary-cell strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.member-report-summary-cell.warn strong {
  color: var(--warn);
}

.member-report-summary-cell.err strong {
  color: var(--err);
}

.member-report-summary-cell.ok strong {
  color: var(--ok);
}

.member-report-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--surface), oklch(0.995 0.004 245));
  box-shadow: 0 14px 30px oklch(0.32 0.02 250 / 0.06);
}

.member-report-board-unified {
  gap: 16px;
  padding: 18px 20px 18px;
}

.member-report-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.member-report-board-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.member-report-board-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.member-report-progress-line {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: stretch;
}

.member-report-unified-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.56fr) minmax(0, 1.44fr);
  gap: 10px;
  align-items: stretch;
}

.member-report-progress-main {
  min-height: 104px;
  padding: 15px 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, oklch(0.9 0.06 165 / 0.34), transparent 36%),
    linear-gradient(145deg, oklch(0.99 0.006 165), oklch(0.955 0.018 165));
}

.member-report-progress-main.warn {
  background:
    radial-gradient(circle at 90% 10%, oklch(0.9 0.07 80 / 0.3), transparent 36%),
    linear-gradient(145deg, oklch(0.99 0.004 80), oklch(0.97 0.018 80));
}

.member-report-progress-main span,
.member-report-progress-main em {
  display: block;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 850;
}

.member-report-progress-main strong {
  display: block;
  margin: 9px 0 8px;
  color: var(--accent);
  font-size: 36px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.member-report-progress-main.warn strong {
  color: var(--warn);
}

.member-report-progress-metrics,
.member-report-daily-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.member-report-progress-metrics .member-report-summary-cell,
.member-report-daily-summary .member-report-summary-cell {
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.member-report-progress-metrics .member-report-summary-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
}

.member-report-progress-metrics .member-report-summary-cell strong {
  margin: 2px 0;
  font-size: 24px;
}

.member-report-daily-panel {
  display: block;
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.member-report-daily-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 0.56fr) minmax(0, 1.44fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, oklch(0.985 0.004 245), oklch(0.972 0.006 245));
}

.member-report-daily-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-report-daily-panel-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.member-report-daily-panel-head strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.member-report-daily-panel .member-report-date-switch {
  justify-content: flex-start;
  max-width: none;
}

.member-report-daily-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.member-report-daily-kpis > div {
  min-height: 48px;
  padding: 6px 10px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.member-report-daily-kpis span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
}

.member-report-daily-kpis strong {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

.member-report-daily-kpis .ok strong {
  color: var(--ok);
}

.member-report-daily-kpis .err strong {
  color: var(--err);
}

.member-report-daily-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.member-report-daily-strip .member-report-summary-cell {
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.member-report-compact-table {
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: var(--surface);
}

.member-report-compact-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.member-report-compact-table-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.member-report-compact-table-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.member-report-compact-table table {
  width: 100%;
  border-collapse: collapse;
}

.member-report-compact-table th,
.member-report-compact-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.member-report-compact-table tr:last-child td {
  border-bottom: 0;
}

.member-report-compact-table th:nth-child(n+3),
.member-report-compact-table td:nth-child(n+3) {
  text-align: right;
}

.member-report-sort {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 4px;
  max-width: 100%;
  color: inherit;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}

.member-report-sort span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.member-report-sort.active,
.member-report-sort.active span {
  color: var(--accent);
}

.member-report-table th:nth-child(n+3) .member-report-sort,
.member-report-compact-table th:nth-child(n+3) .member-report-sort {
  justify-content: flex-end;
}

.member-report-date-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 520px;
}

.member-report-date-switch button {
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-sub);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
}

.member-report-date-switch select {
  min-height: 28px;
  min-width: 112px;
  padding: 4px 28px 4px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-sub);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  outline: none;
}

.member-report-date-switch select:hover,
.member-report-date-switch select:focus {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.member-report-date-switch button.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 1px 2px oklch(0.16 0.02 245 / 0.12);
}

.member-report-snapshot-table {
  padding-top: 4px;
}

.member-report-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.member-report-hero-main {
  min-height: 178px;
  padding: 26px 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 14%, oklch(0.9 0.06 165 / 0.34), transparent 34%),
    linear-gradient(135deg, var(--surface), oklch(0.97 0.012 165));
  box-shadow: 0 18px 36px oklch(0.32 0.02 250 / 0.08);
}

.member-report-hero.err .member-report-hero-main {
  background:
    radial-gradient(circle at 92% 14%, oklch(0.9 0.08 80 / 0.28), transparent 34%),
    linear-gradient(135deg, var(--surface), oklch(0.98 0.012 85));
}

.member-report-hero-main span,
.member-report-hero-main em {
  display: block;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 850;
}

.member-report-hero-main span {
  font-size: 14px;
}

.member-report-hero-main strong {
  display: block;
  margin: 14px 0 12px;
  color: var(--accent);
  font-size: 56px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.member-report-hero.err .member-report-hero-main strong {
  color: var(--warn);
}

.member-report-hero-main em {
  font-size: 15px;
}

.member-report-hero-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.member-report-hero-side .member-report-summary-cell {
  min-height: auto;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.member-report-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.member-report-focus-card {
  min-height: 224px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 28px oklch(0.32 0.02 250 / 0.06);
}

.member-report-store-list,
.member-report-day-list {
  display: grid;
  gap: 8px;
}

.member-report-store-row,
.member-report-day-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.member-report-store-row {
  grid-template-columns: minmax(0, 1fr) 78px 92px;
}

.member-report-store-row strong,
.member-report-store-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-report-store-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.member-report-store-row span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.member-report-store-row b,
.member-report-store-row em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.member-report-store-row em {
  color: var(--warn);
  font-size: 12px;
}

.member-report-store-row.ok em {
  color: var(--ok);
}

.member-report-day-row {
  grid-template-columns: 52px minmax(80px, 1fr) 54px 88px;
  width: 100%;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.member-report-day-row:hover,
.member-report-day-row.active {
  border-color: oklch(0.78 0.07 165);
  background: var(--accent-bg);
}

.member-report-day-row span,
.member-report-day-row strong,
.member-report-day-row em {
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.member-report-day-row span {
  color: var(--text);
}

.member-report-day-row strong {
  color: var(--accent);
  text-align: right;
}

.member-report-day-row em {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.member-report-day-row i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: oklch(0.94 0.006 250);
}

.member-report-day-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.member-report-detail-drawer {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.member-report-detail-drawer summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.member-report-detail-drawer summary::-webkit-details-marker {
  display: none;
}

.member-report-detail-drawer summary::after {
  content: "展开";
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.member-report-detail-drawer[open] summary::after {
  content: "收起";
}

.member-report-detail-drawer .member-report-block {
  margin-top: 12px;
}

.member-report-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
}

.member-report-note span {
  color: var(--accent);
  font-weight: 900;
}

.member-report-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.member-report-section-title strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.member-report-section-title span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.member-report-table td,
.member-report-table th {
  white-space: nowrap;
}

.member-report-table td:nth-child(n+3),
.member-report-table th:nth-child(n+3) {
  text-align: right;
}

.member-report-table td:last-child,
.member-report-table th:last-child {
  text-align: center;
}

.member-report-brand {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: oklch(0.96 0.012 165);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.member-report-issues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-report-issue {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.member-report-issue strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.member-report-issue span {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.member-report-issue p {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.member-report-issue.warn {
  border-color: oklch(0.86 0.05 76);
  background: var(--warn-bg);
}

.member-report-issue.ok {
  border-color: oklch(0.84 0.04 155);
  background: oklch(0.96 0.018 155);
}

@media (max-width: 1180px) {
  .member-report-unified-grid {
    grid-template-columns: 1fr;
  }

  .member-report-daily-toolbar {
    grid-template-columns: 1fr;
  }

  .member-report-daily-panel .member-report-date-switch {
    justify-content: flex-start;
  }

  .member-report-daily-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .member-report-progress-line {
    grid-template-columns: 1fr;
  }

  .member-report-progress-metrics,
  .member-report-daily-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-report-hero,
  .member-report-focus-grid {
    grid-template-columns: 1fr;
  }

  .member-report-hero-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .member-report-board-head {
    flex-direction: column;
  }

  .member-report-date-switch {
    justify-content: flex-start;
  }

  .member-report-progress-metrics,
  .member-report-daily-summary,
  .member-report-daily-strip,
  .member-report-daily-kpis {
    grid-template-columns: 1fr;
  }

  .member-report-progress-main {
    min-height: auto;
    padding: 20px;
  }

  .member-report-progress-main strong {
    font-size: 40px;
  }

  .member-report-hero-main {
    min-height: auto;
    padding: 20px;
  }

  .member-report-hero-main strong {
    font-size: 42px;
  }

  .member-report-hero-side {
    grid-template-columns: 1fr;
  }

  .member-report-store-row,
  .member-report-day-row {
    grid-template-columns: 1fr;
  }

  .member-report-store-row b,
  .member-report-store-row em,
  .member-report-day-row strong,
  .member-report-day-row em {
    text-align: left;
  }
}

.member-target-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, oklch(0.99 0.004 158), var(--surface));
}

.member-target-head strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.member-target-head span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.member-target-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.member-target-actions label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.member-target-actions input,
.member-target-table input,
.member-target-table select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.member-target-actions input {
  width: 148px;
  padding: 0 10px;
}

.member-target-actions input:focus,
.member-target-table input:focus,
.member-target-table select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.57 0.12 165 / 0.12);
}

.member-target-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.member-target-summary > div {
  min-height: 104px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.member-target-summary span,
.member-target-summary em {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.member-target-summary strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.member-target-table th,
.member-target-table td {
  vertical-align: middle;
}

.member-target-table th:nth-child(3),
.member-target-table th:nth-child(4),
.member-target-table td:nth-child(3),
.member-target-table td:nth-child(4) {
  width: 170px;
}

.member-target-table input,
.member-target-table select {
  width: 100%;
  padding: 0 10px;
  border-color: oklch(0.87 0.01 220);
  background: oklch(0.985 0.003 158);
}

.member-target-table input[name="wecom_new_target"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: 150px;
}

.member-target-table select[name="enabled"] {
  color: var(--accent);
  max-width: 88px;
  font-weight: 900;
}

.member-target-brand {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: oklch(0.96 0.012 165);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .member-target-head {
    align-items: stretch;
    flex-direction: column;
  }

  .member-target-actions {
    justify-content: flex-start;
  }

  .member-target-summary {
    grid-template-columns: 1fr;
  }
}

.group-assignment-modal-box {
  width: min(560px, calc(100vw - 32px));
  margin: auto;
}

.group-assignment-modal-box input,
.group-assignment-modal-box select {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 12px;
}

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

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trend-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tb"
      "mn";
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 18px;
  }

  .main {
    padding: 18px;
  }

  .customer-toolbar {
    grid-template-columns: 1fr;
  }
}

/* ── 会员概况 ── */
.overview-section {
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.overview-section-standalone {
  margin-top: 18px;
  margin-bottom: 16px;
}

.overview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.overview-section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}
.overview-section-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.overview-section-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-scope-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 111, 92, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.overview-scope-chip.muted {
  background: var(--bg-soft);
  color: var(--text-muted);
}
.overview-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  padding: 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text-muted) 7%, transparent);
}
.overview-toolbar.is-hidden {
  visibility: hidden;
  pointer-events: none;
}
.overview-time-toolbar {
  margin-left: auto;
}
.overview-toolbar .btn {
  min-width: 64px;
}
.overview-health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
}
.placeholder-task-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
  line-height: 1.9;
  font-size: 14px;
}
.overview-health-card {
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
}

.overview-health-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 6px;
}
.overview-health-label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
  margin-bottom: 4px;
}

.overview-health-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── KPI 卡片 ── */
.overview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.overview-kpi-grid-split {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.overview-kpi-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}
.overview-kpi-card-wide {
  min-height: 176px;
}
.overview-kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.overview-kpi-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.overview-kpi-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.overview-kpi-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.overview-kpi-subitem {
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--bg-soft);
  text-align: center;
}
.overview-kpi-subitem span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 4px;
}
.overview-kpi-subitem strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

/* ── 会员详情 ── */
.customer-detail-page {
  display: grid;
  gap: 10px;
  width: min(calc(100% - 24px), 1120px);
  margin-top: -10px;
  margin-right: auto;
  padding-right: 0;
}
.member-profile-header,
.member-profile-card,
.member-hero-card,
.member-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 111, 92, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.76));
  box-shadow: var(--shadow-sm);
}
.member-profile-header {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 0.92fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  box-shadow: none;
}
.member-profile-title {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.member-profile-heading {
  min-width: 0;
}
.member-profile-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  border-left: 1px solid rgba(18, 28, 36, 0.08);
}
.member-profile-board {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 0;
  align-items: stretch;
}
.member-profile-card {
  min-width: 0;
  padding: 14px 18px;
}
.member-profile-card-primary {
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 111, 92, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,252,0.9));
}
.member-key-info-board {
  grid-template-columns: minmax(280px, 0.82fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
}
.member-profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.member-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  padding: 22px;
}
.member-identity-card {
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
}
.member-hero-summary {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
}
.member-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #006f5c, #0a3d34);
  box-shadow: 0 16px 30px rgba(0, 111, 92, 0.18);
  font-size: 22px;
  font-weight: 900;
}
.member-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.member-title-row h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.member-inline-id {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.member-id-line {
  margin-top: 5px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.member-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.member-title-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(18, 28, 36, 0.05);
}
.member-hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.member-core-facts {
  max-width: 460px;
}
.member-identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.member-identity-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(18, 28, 36, 0.08);
  border-radius: 18px;
  background: rgba(248, 250, 251, 0.78);
}
.member-identity-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}
.member-identity-panel .member-detail-line {
  grid-template-columns: 100px minmax(0, 1fr);
  padding: 8px 0;
}
.member-fact,
.member-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.member-fact {
  border-bottom: 1px solid rgba(18, 28, 36, 0.07);
}
.member-fact span,
.member-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.member-fact strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.member-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
  gap: 16px;
  align-items: start;
}
.member-detail-main,
.member-detail-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.member-detail-card {
  padding: 14px 18px;
}
.member-detail-card-wide {
  grid-column: 1 / -1;
}
.member-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}
.member-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.member-section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}
.member-section-head .member-section-title {
  margin-bottom: 4px;
}
.member-section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.member-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.member-metric strong {
  display: block;
  color: var(--text);
  overflow: hidden;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-detail-line {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(18, 28, 36, 0.07);
}
.member-detail-line:last-child {
  border-bottom: 0;
}
.member-detail-line span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}
.member-detail-line strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-list-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(18, 28, 36, 0.07);
}
.member-list-item:last-child {
  border-bottom: 0;
}
.member-list-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.member-list-item strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}
.member-list-item span,
.member-list-item small,
.member-list-item p {
  color: var(--text-muted);
  font-size: 12px;
}
.member-list-item p {
  margin: 6px 0 4px;
  line-height: 1.45;
}
.member-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.member-tag-list .pill {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}
.member-empty,
.member-timeline-empty {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(18, 28, 36, 0.14);
  border-radius: 16px;
  background: rgba(248, 250, 251, 0.72);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}
.member-timeline-empty {
  flex-direction: column;
  gap: 6px;
}
.member-timeline-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.member-segment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.member-segment-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.member-segment-item {
  display: block;
  padding: 13px 14px;
  border: 1px solid rgba(18, 28, 36, 0.08);
  border-radius: 16px;
  background: rgba(248, 250, 251, 0.78);
  text-decoration: none;
}
.member-segment-item strong,
.member-segment-item span {
  display: block;
}
.member-segment-item strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}
.member-segment-item span {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.member-detail-tabs {
  display: grid;
  gap: 8px;
}
.member-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}
.member-tab-list button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.member-tab-list button.active {
  border-color: rgba(0, 111, 92, 0.24);
  background: rgba(0, 111, 92, 0.1);
  color: var(--accent);
}
.member-tab-panel {
  display: none;
}
.member-tab-panel.active {
  display: block;
}
.customer-detail-page .member-profile-card,
.customer-detail-page .member-detail-card {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.customer-detail-page .member-key-info-board .member-profile-card + .member-profile-card {
  border-left: 1px solid rgba(18, 28, 36, 0.08);
}
.customer-detail-page .member-detail-card {
  border-radius: 10px;
}
.customer-detail-page [data-customer-detail-panel="orders"] .member-detail-card {
  padding: 0;
  border: 0;
  background: transparent;
}
.customer-detail-page [data-customer-detail-panel="orders"] .member-section-head {
  margin-bottom: 10px;
}
.member-order-range {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.member-order-table td {
  vertical-align: middle;
}
.customer-detail-page .member-order-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.customer-detail-page .member-order-table table {
  border-collapse: collapse;
}
.customer-detail-page .member-order-table th,
.customer-detail-page .member-order-table td {
  border-bottom: 1px solid rgba(18, 28, 36, 0.08);
}
.member-order-detail-row {
  display: none;
}
.member-order-detail-row.active {
  display: table-row;
}
.member-order-detail {
  padding: 14px;
  border: 1px solid rgba(18, 28, 36, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.72);
}
.member-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.member-order-items-title {
  margin-top: 4px;
}
.member-order-pagination {
  margin-top: 12px;
}

/* ── 会员分层 ── */
.segment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 111, 92, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.72));
  box-shadow: var(--shadow-sm);
}
.segment-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}
.segment-hero p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}
.segment-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.segment-stat-grid-compact {
  margin-bottom: 14px;
}
.segment-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(18, 28, 36, 0.08);
  border-radius: 16px;
  background: rgba(248, 250, 251, 0.82);
}
.segment-stat span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}
.segment-stat strong {
  margin-top: 6px;
  color: var(--accent);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.02em;
}
.segment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}
.segment-hero-compact {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
}
.segment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.segment-form-wide {
  grid-column: 1 / -1;
}
.segment-rule-group {
  padding: 0;
  margin-bottom: 14px;
  border-bottom: 0;
}
.segment-rule-group:last-of-type {
  margin-bottom: 0;
}
.segment-rule-group > span {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.segment-rule-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.segment-rule-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  max-width: 360px;
}
.segment-rule-brief {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.segment-rule-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
}
.segment-rule-details {
  position: relative;
}
.segment-rule-details summary {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.segment-rule-details summary::-webkit-details-marker {
  display: none;
}
.segment-rule-details summary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.segment-rule-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 360px;
  margin-top: 8px;
}
.segment-rule-table {
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 78%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 252, 0.94));
  box-shadow: 0 16px 36px rgba(13, 29, 37, 0.07);
}
.segment-rule-table table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.segment-rule-table thead th {
  background: rgba(247, 250, 250, 0.92);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 76%, transparent);
}
.segment-rule-table th,
.segment-rule-table td {
  text-align: left;
  vertical-align: middle;
}
.segment-rule-table th:nth-child(1),
.segment-rule-table td:nth-child(1) {
  width: 38%;
}
.segment-rule-table th:nth-child(2),
.segment-rule-table td:nth-child(2) {
  width: 14%;
}
.segment-rule-table th:nth-child(3),
.segment-rule-table td:nth-child(3) {
  width: 14%;
}
.segment-rule-table th:nth-child(4),
.segment-rule-table td:nth-child(4) {
  width: 34%;
}
#page-customer .segment-rule-table th,
#page-customer .segment-rule-table td {
  text-align: left;
}
.segment-rule-table tbody tr {
  transition: background 0.16s ease, transform 0.16s ease;
}
.segment-rule-table tbody tr:hover {
  background: rgba(230, 244, 239, 0.34);
}
.segment-rule-table tbody td {
  height: 56px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 56%, transparent);
}
.segment-rule-table tbody tr:last-child td {
  border-bottom: 0;
}
.segment-filter-toolbar {
  margin-bottom: 14px;
}
.segment-filter-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.segment-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}
.segment-filter-controls .customer-filter-keyword {
  flex: 1 1 220px;
}
.segment-filter-controls .customer-filter-field:not(.customer-filter-keyword) {
  flex: 0 1 132px;
  min-width: 118px;
}
.segment-filter-row .customer-toolbar-actions {
  flex: 0 0 auto;
  gap: 8px;
  padding-top: 0;
}
.segment-filter-row .customer-search,
.segment-filter-row .segment-text-input,
.segment-filter-row .btn {
  min-height: 34px;
}
.segment-filter-row .customer-search,
.segment-filter-row .segment-text-input {
  border: 1px solid color-mix(in oklab, var(--border) 86%, transparent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: var(--fw-body);
}
.segment-filter-row .customer-search {
  padding-left: 18px;
}
.segment-filter-row .customer-search:focus,
.segment-filter-row .segment-text-input:focus {
  border-color: color-mix(in oklab, var(--accent) 48%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent);
  outline: none;
}
.segment-group-section {
  margin-bottom: 18px;
}
.segment-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.segment-group-head strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}
.segment-group-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.segment-name-cell {
  display: grid;
  gap: 0;
  min-width: 0;
  align-content: center;
}
.segment-name-cell strong {
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: var(--fw-title);
}
.segment-name-cell span {
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  line-height: 1.45;
}
.segment-group-badge {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-sub);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  white-space: nowrap;
}
.segment-group-badge.is-custom {
  color: var(--text-sub);
}
.segment-stat-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.segment-stat-btn {
  min-height: 24px;
  padding: 3px 9px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: var(--fs-caption);
  font-weight: var(--fw-strong);
  box-shadow: none;
}
.segment-stat-btn:hover {
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent);
}
.segment-stat-btn:disabled {
  color: var(--text-muted);
  cursor: wait;
  opacity: .72;
}
.segment-stat-count {
  color: var(--text-sub);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.55;
  white-space: nowrap;
}
.segment-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--line) 45%, transparent);
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-strong);
  line-height: 1;
  white-space: nowrap;
}
.segment-status-chip.is-live,
.segment-status-chip.is-ready {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
}
.segment-status-chip.is-running {
  background: color-mix(in oklab, #2d6cdf 12%, transparent);
  color: #2d6cdf;
}
.segment-status-chip.is-stale {
  background: color-mix(in oklab, #b67a2d 14%, transparent);
  color: #9a6424;
}
.segment-status-chip.is-failed {
  background: color-mix(in oklab, var(--err) 10%, transparent);
  color: var(--err);
}
.segment-stat-updated {
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
  white-space: nowrap;
}
.segment-rule-modal-box {
  width: min(560px, calc(100vw - 32px));
}
.segment-rule-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 16px;
}
.segment-rule-modal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}
.segment-rule-modal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  padding: 2px;
}
.segment-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.segment-list-toolbar > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.segment-list-toolbar strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}
.segment-breadcrumb {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.segment-list-toolbar span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}
.segment-create-simple {
  display: grid;
  gap: 18px;
}
.segment-builder-page {
  gap: 0;
}
.segment-builder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.segment-builder-main {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.segment-builder-section {
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 82%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.segment-rule-section {
  padding-bottom: 14px;
}
.segment-builder-section:last-of-type {
  border-bottom: 0;
}
.segment-builder-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  list-style: none;
  cursor: default;
}
.segment-builder-section-head::-webkit-details-marker {
  display: none;
}
.segment-rule-section[open] > .segment-builder-section-head {
  margin-bottom: 14px;
}
.segment-rule-section > .segment-builder-section-head {
  cursor: pointer;
}
.segment-rule-section > .segment-builder-section-head::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}
.segment-rule-section[open] > .segment-builder-section-head::after {
  transform: rotate(225deg);
}
.segment-builder-section-head strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}
.segment-builder-section-head span {
  max-width: 620px;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
  text-align: right;
}
.segment-builder-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 14px 0 0;
  border-top: 1px solid color-mix(in oklab, var(--border) 82%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.segment-preview-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
}
.segment-preview-card div {
  min-width: 118px;
  padding: 0 16px;
  border-right: 1px solid color-mix(in oklab, var(--border) 76%, transparent);
  border-radius: 0;
  background: transparent;
}
.segment-preview-card div:first-child {
  padding-left: 0;
}
.segment-preview-card div:last-child {
  border-right: 0;
}
.segment-preview-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}
.segment-preview-card strong {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 950;
}
.segment-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.segment-preview-meta div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}
.segment-preview-meta b,
.segment-preview-meta small {
  display: block;
}
.segment-preview-meta b {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}
.segment-preview-meta small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
}
.segment-preview-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid oklch(0.82 0.025 165 / 0.7);
}
.segment-builder-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 10px;
}
.segment-create-section {
  padding: 0;
  border-bottom: 0;
}
.segment-create-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.segment-form-compact {
  grid-template-columns: minmax(260px, 0.6fr) minmax(0, 1fr);
  gap: 12px;
}
.segment-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}
.segment-range-field {
  grid-column: span 1;
}
.segment-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.segment-range-inputs em {
  display: block;
  width: 10px;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.6;
}
.segment-range-inputs .segment-text-input {
  padding: 0 10px;
}
.segment-tags-field {
  grid-column: span 2;
}
.segment-tags-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.segment-tags-field > span em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.segment-tag-search {
  margin-bottom: 8px;
}
.segment-tag-options {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface-soft) 72%, white);
}
.segment-tag-group {
  min-width: 0;
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
}
.segment-tag-group.is-hidden {
  display: none;
}
.segment-tag-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}
.segment-tag-group summary::-webkit-details-marker {
  display: none;
}
.segment-tag-group summary span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.segment-tag-group-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}
.segment-tag-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.segment-tag-option:hover {
  background: var(--surface);
}
.segment-tag-option.is-hidden {
  display: none;
}
.segment-tag-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}
.segment-tag-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment-tag-option em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}
.segment-tag-empty {
  grid-column: 1 / -1;
  padding: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.segment-input-field {
  gap: 7px;
}
.segment-name-field {
  grid-column: span 1;
}
.segment-input-disabled {
  opacity: 0.72;
}
.segment-input-disabled > span::after {
  content: "不可用";
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
}
.segment-text-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}
.segment-text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.segment-text-input:disabled {
  border-color: var(--border);
  background: color-mix(in oklab, var(--surface-soft) 86%, white);
  color: var(--text-muted);
  cursor: not-allowed;
}
.segment-member-search {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(132px, 0.7fr)) auto auto;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}
.segment-member-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(160px, 0.7fr);
  gap: 10px;
  margin: 0 0 12px;
}
.segment-member-summary > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(18, 28, 36, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 251, 0.74);
}
.segment-member-summary span,
.segment-member-summary strong {
  display: block;
}
.segment-member-summary span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.segment-member-summary strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment-member-search .segment-text-input {
  height: 40px;
}
.segment-member-table {
  margin-top: 0;
}
.segment-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.segment-table-actions {
  white-space: normal;
}
.segment-table-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}
.segment-action-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.segment-action-link:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.segment-action-link.is-disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}
.segment-action-link.is-disabled:hover {
  text-decoration: none;
}
.segment-action-link.is-danger {
  color: var(--err);
}
.customer-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.segment-action-plan {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--accent-bg);
}
.segment-action-plan strong {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}
.segment-action-plan p {
  margin: 6px 0 0;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.55;
}

/* ── 会员标签 ── */
.tag-list-toolbar {
  margin-top: 2px;
}
.tag-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin: 8px 0 22px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
}
.tag-source-tab {
  position: relative;
  min-width: 0;
  padding: 0 2px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.tag-source-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
}
.tag-source-tab strong {
  display: inline-block;
  margin-right: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}
.tag-source-tab.active strong {
  color: var(--accent);
}
.tag-source-tab span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.tag-source-section {
  margin-top: 22px;
}
.tag-source-section:first-of-type {
  margin-top: 0;
}
.tag-source-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* ── 企微客户群 ── */
.wecom-group-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 111, 92, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.72));
  box-shadow: var(--shadow-sm);
}
.wecom-group-hero h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}
.wecom-group-hero p {
  max-width: 740px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.wecom-group-entry {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: stretch;
}

.wecom-group-primary {
  min-height: 132px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 10%, white), rgba(255,255,255,0.9));
}

.wecom-group-primary-label {
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 900;
}

.wecom-group-primary-value {
  margin-top: 10px;
  color: var(--accent);
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
}

.wecom-group-primary-desc {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wecom-group-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wecom-group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.wecom-group-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.wecom-group-date-filter .topbar-select {
  width: 156px;
  height: 34px;
  padding: 0 34px 0 12px;
  font-size: 12px;
}

.wecom-group-date-filter.is-empty .topbar-select {
  color: var(--text-muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.wecom-group-toolbar {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.wecom-tab-layout {
  min-width: 0;
  padding: 2px 0 18px;
}

.wecom-tab-nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 14px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--border);
}

.wecom-tab-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 2px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 900;
}

.wecom-tab-nav a:hover {
  color: var(--text);
}

.wecom-tab-nav a.active {
  color: var(--accent);
}

.wecom-tab-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.wecom-tab-content {
  min-width: 0;
}

.wecom-view {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.light-section-block {
  margin-top: 22px;
}

.light-section-head {
  display: block;
  margin-bottom: 12px;
}

.light-section-head.with-side {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.light-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.light-section-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.light-section-table {
  border: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
  border-radius: 16px;
  background: var(--surface);
}

.customer-list-view {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.customer-list-table {
  margin-top: 0;
  box-shadow: var(--shadow-sm);
}

.wecom-section-block {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.wecom-section-block-head {
  display: block;
  margin-bottom: 12px;
}

.wecom-section-block-head.with-side {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wecom-section-block-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.wecom-section-block-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.wecom-section-table {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.external-overview-panel,
.external-status-panel {
  display: grid;
  gap: 16px;
}

.external-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.external-overview-head h3,
.external-status-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.external-overview-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.external-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attribution-rerun-card .source-config-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.external-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.external-overview-card {
  display: flex;
  min-width: 0;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.external-overview-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.external-overview-card span,
.external-overview-card em {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.external-status-group {
  display: grid;
  gap: 10px;
}

.external-status-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.source-config-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.source-config-hero strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.source-config-hero span {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.source-config-stack {
  display: grid;
  gap: 18px;
}

.source-config-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.source-config-tabs button {
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.source-config-tabs button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.source-config-block {
  min-width: 0;
}

.source-config-block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.source-config-block-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.source-config-block-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.source-config-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.source-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.source-config-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-config-list {
  display: grid;
  gap: 12px;
}

.source-config-list-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.source-config-table td {
  vertical-align: middle;
}

.source-config-table .danger {
  color: var(--err);
}

.wework-config-table {
  width: 100%;
  table-layout: fixed;
}

.wework-config-table th,
.wework-config-table td {
  padding-left: 14px;
  padding-right: 14px;
  white-space: nowrap;
}

.wework-config-table th {
  text-align: center;
}

.wework-config-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wework-config-table td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wework-corp-col {
  width: 23%;
}

.wework-brand-col {
  width: 13%;
}

.wework-access-col {
  width: 14%;
}

.wework-status-col {
  width: 8%;
}

.wework-action-col {
  width: 17%;
}

.wework-access-pills,
.source-config-action-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.source-config-action-cell {
  justify-content: flex-end;
  width: 100%;
  text-align: right;
}

.source-config-action-cell .btn-sm {
  padding-left: 10px;
  padding-right: 10px;
}

.source-config-row-card,
.source-config-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.source-config-row-card {
  padding: 14px 16px 16px;
}

.source-config-row-card.is-new {
  background: color-mix(in oklab, var(--accent) 3%, var(--surface));
}

.source-config-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.source-config-row-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-config-sub {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.source-config-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 6%, var(--surface)), var(--surface));
  border-bottom: 1px solid var(--border);
}

.source-config-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.source-config-card h3 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.2;
}

.source-config-health {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.source-config-section {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.source-config-section:last-child {
  border-bottom: 0;
}

.source-config-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.source-config-section-title strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.source-config-section-title span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.source-config-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-config-fields label,
.source-config-row-card label,
.source-config-wework-row label {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.source-config-field-wide {
  grid-column: 1 / -1;
}

.source-config-card input,
.source-config-card select,
.source-config-card textarea,
.source-config-row-card input,
.source-config-row-card select {
  width: 100%;
  height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.source-config-card textarea {
  min-height: 76px;
  height: auto;
  padding-top: 8px;
  resize: vertical;
  line-height: 1.5;
}

.source-config-card input:focus,
.source-config-card select:focus,
.source-config-card textarea:focus,
.source-config-row-card input:focus,
.source-config-row-card select:focus {
  border-color: color-mix(in oklab, var(--accent) 52%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 12%, transparent);
}

.source-config-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.source-config-card .inline-check,
.source-config-row-card .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.source-config-card .inline-check input,
.source-config-row-card .inline-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.source-config-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.source-config-action-buttons .danger {
  color: var(--err);
}

.source-config-wework-list {
  display: grid;
  gap: 10px;
}

.source-config-wework-row {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.source-config-wework-row:last-child {
  border-bottom: 0;
}

.source-config-wework-row .inline-check {
  min-height: 36px;
  align-self: end;
}

.source-config-wework-row .btn {
  align-self: end;
}

.source-config-wework-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.source-config-empty {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.source-config-edit-page {
  display: grid;
  gap: 18px;
}

.source-config-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.source-config-page-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.source-config-page-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.source-config-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
}

.source-config-page-grid label {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.source-config-store-field {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.source-config-store-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  max-height: 156px;
  margin-top: 5px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.source-config-page-grid .source-config-store-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.source-config-page-grid .source-config-store-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.source-config-store-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-config-store-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.source-config-page-grid input,
.source-config-page-grid select {
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.source-config-page-grid select[multiple] {
  min-height: 118px;
  padding: 8px 10px;
}

.source-config-page-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.source-config-page-switch input {
  width: 15px;
  min-height: 15px;
  margin: 0;
}

.source-config-page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  max-width: 920px;
  padding-top: 4px;
}

.source-config-modal {
  width: min(780px, calc(100vw - 32px));
  padding: 24px;
}

.source-config-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.source-config-modal-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 950;
}

.source-config-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.source-config-modal-grid label {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.source-config-modal-grid input,
.source-config-modal-grid select {
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.source-config-modal-grid select[multiple] {
  min-height: 112px;
  padding: 8px 10px;
}

.source-config-modal-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.source-config-modal-switch input {
  width: 15px;
  min-height: 15px;
  margin: 0;
}

.wecom-detail-inline-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 5%, var(--surface));
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wecom-detail-inline-summary strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 950;
}

.wecom-detail-filter {
  margin-bottom: 14px;
}

.wecom-detail-filter-row {
  grid-template-columns: minmax(240px, 0.8fr) minmax(150px, 0.34fr) minmax(150px, 0.34fr) auto;
  justify-content: start;
  gap: 10px;
}

.wecom-detail-filter-row .customer-search {
  width: 100%;
}

.wecom-detail-table {
  margin-top: 0;
  box-shadow: var(--shadow-sm);
}

.wecom-group-name-link {
  color: var(--ch-blue);
  font-weight: 900;
  text-decoration: none;
  transition: color 140ms ease;
}

.wecom-group-name-link:hover {
  color: oklch(0.38 0.15 225);
}

.wecom-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wecom-config-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
  border-radius: 18px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
}

.wecom-config-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.wecom-config-card h3 {
  margin: 8px 0 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.wecom-config-card p {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.wecom-config-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wecom-group-date-hint {
  max-width: 820px;
  margin-top: 6px !important;
  color: var(--warn) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

.wecom-member-schema-table {
  min-width: 760px;
}

.wecom-member-schema-table th:first-child,
.wecom-member-schema-table td:first-child {
  width: 240px;
}

.wecom-member-schema-table th:last-child,
.wecom-member-schema-table td:last-child {
  width: 120px;
  text-align: center;
}

/* ── 时间选择器 ── */
.overview-range-presets {
  display: flex;
  gap: 6px;
  align-items: center;
}
.overview-mode-tabs {
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.overview-preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub);
  background: transparent;
  border: 0;
  transition: all 140ms ease;
  cursor: pointer;
}
.overview-preset-btn:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.overview-preset-btn.active {
  color: var(--text-inv);
  background: var(--accent);
  box-shadow: 0 6px 16px color-mix(in oklab, var(--accent) 20%, transparent);
}
.overview-custom-range {
  display: flex;
  gap: 8px;
  align-items: center;
}
.overview-date-input {
  padding: 6px 10px;
  border: 1px solid color-mix(in oklab, var(--border-strong) 70%, transparent);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 140ms ease;
}
.overview-date-input:focus {
  border-color: var(--accent);
}
.overview-date-sep {
  font-size: 13px;
  color: var(--text-muted);
}

.overview-brand-row td {
  border-top: 1px solid var(--border);
}
.overview-breakdown-table {
  min-width: 780px;
}
.overview-store-row td {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  font-size: 13px;
  color: var(--text-sub);
}
.overview-store-indent {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 112px;
  min-height: 22px;
  padding-left: 40px;
  margin: 0 auto;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: left;
}
.overview-tree-symbol {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 14px;
  height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}
.overview-tree-symbol::before,
.overview-tree-symbol::after {
  content: "";
  position: absolute;
  background: var(--text-muted);
}
.overview-tree-symbol::before {
  left: 0;
  top: 1px;
  width: 1px;
  height: 16px;
}
.overview-tree-symbol::after {
  left: 0;
  top: 9px;
  width: 10px;
  height: 1px;
}
.overview-store-name {
  min-width: 0;
  color: var(--text-sub);
}

/* Typography scale: black/Sans UI type for dense admin pages. */
.topbar-title {
  font-size: var(--fs-page-title);
  font-weight: var(--fw-title);
}

.sidebar-title {
  font-size: 15px;
  font-weight: var(--fw-title);
}

.sidebar-nav a {
  font-size: var(--fs-nav-primary);
  font-weight: var(--fw-strong);
}

.sidebar-subnav a {
  font-size: var(--fs-nav-secondary);
  font-weight: var(--fw-strong);
}

.panel-header h3,
.customer-list-head h3,
.overview-section-head h3,
.wecom-section-block-head h3,
.wecom-config-card h3,
.segment-list-toolbar strong {
  font-size: var(--fs-module-title);
  font-weight: var(--fw-title);
}

.panel-header p,
.wecom-section-block-head p,
.overview-section-head p,
.segment-list-toolbar span,
.segment-breadcrumb,
.customer-sub,
.muted,
.small {
  font-size: var(--fs-caption);
  font-weight: var(--fw-caption);
}

thead th,
.ops-table thead th,
#page-customer thead th {
  font-size: var(--fs-table-head);
  font-weight: var(--fw-title);
  letter-spacing: 0.02em;
  text-transform: none;
}

tbody td,
.ops-table tbody td,
#page-customer tbody td {
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.55;
}

.btn,
.topbar-text-btn,
.segment-action-link {
  font-size: var(--fs-body);
  font-weight: var(--fw-strong);
}

.btn-sm {
  font-size: var(--fs-caption);
  font-weight: var(--fw-strong);
}

.pill,
.customer-source-chip,
.customer-phone-chip,
.segment-rule-chip,
.segment-rule-brief {
  font-size: var(--fs-badge);
  font-weight: var(--fw-strong);
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 960px) {
  .overview-kpi-grid-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wecom-group-entry {
    grid-template-columns: 1fr;
  }

  .wecom-config-card,
  .wecom-config-stats,
  .source-config-grid,
  .external-kpi-grid,
  .external-overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-health-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .member-hero-card,
  .member-profile-header,
  .member-profile-board,
  .member-identity-card,
  .member-identity-grid,
  .member-detail-grid,
  .member-detail-layout,
  .member-profile-grid {
    grid-template-columns: 1fr;
  }

  .member-detail-card-wide {
    grid-column: auto;
  }

  .member-segment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment-member-summary,
  .segment-member-search {
    grid-template-columns: 1fr;
  }

  .segment-hero,
  .segment-layout,
  .segment-builder-form,
  .wecom-group-hero {
    grid-template-columns: 1fr;
  }

  .segment-builder-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-select {
    flex: 1 1 140px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-kpi-grid,
  .overview-kpi-grid-split {
    grid-template-columns: 1fr;
  }

  .member-hero-card,
  .member-profile-header {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .member-profile-kpis,
  .member-profile-fields,
  .member-hero-facts,
  .member-metric-grid,
  .member-segment-grid {
    grid-template-columns: 1fr;
  }

  .member-detail-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .customer-list-head,
  .segment-stat-grid {
    grid-template-columns: 1fr;
  }

  .segment-form-compact,
  .segment-rule-grid,
  .segment-tag-options,
  .segment-preview-card,
  .segment-preview-meta {
    grid-template-columns: 1fr;
  }

  .segment-builder-side {
    align-items: stretch;
    flex-direction: column;
  }

  .segment-builder-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .segment-builder-section-head span {
    text-align: left;
  }

  .wecom-group-metrics {
    grid-template-columns: 1fr;
  }

  .wecom-tab-nav {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
  }

  .wecom-detail-filter-row {
    grid-template-columns: 1fr;
  }

  .source-config-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-config-hero span {
    text-align: left;
  }

  .source-config-card-head,
  .source-config-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-config-fields,
  .attribution-rerun-card .source-config-fields,
  .source-config-wework-row,
  .source-config-wework-add,
  .source-config-page-grid,
  .source-config-modal-grid {
    grid-template-columns: 1fr;
  }

  .customer-list-head {
    flex-direction: column;
  }

  .customer-toolbar-row-main {
    grid-template-columns: 1fr;
  }

  .customer-toolbar-row-primary,
  .customer-toolbar-row-secondary,
  .customer-toolbar-row-single {
    grid-template-columns: 1fr;
  }

  .customer-toolbar-actions {
    padding-top: 0;
  }

  .customer-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-pagination-actions {
    justify-content: flex-start;
  }

}
