/* =========================
  ScanWin — analytics.css
========================= */

/* =========================
  1. Mobile Page Header Start
========================= */
.sw-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.sw-page-head__title {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.44px;
  color: #0f1020;
  margin: 0 0 6px;
}
.sw-page-head__subtitle {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #6b7280;
  margin: 0;
}
/* =========================
  1. Mobile Page Header End
========================= */

/* =========================
  2. Campaign Filter Card + Toolbar Start
========================= */
.sw-camp-filter {
  background: #ffffff;
  border: 1px solid #ece9e0;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.sw-analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sw-analytics-toolbar__caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
}
.sw-analytics-toolbar__caption strong {
  color: #0f1020;
}

.sw-date-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  text-decoration: none;
}
.sw-date-pick:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-date-pick svg {
  width: 16px;
  height: 16px;
}
/* =========================
  2. Campaign Filter Card + Toolbar End
========================= */

/* =========================
  3. Campaign Filter Chips Start
========================= */
.sw-camp-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sw-camp-chips::-webkit-scrollbar {
  display: none;
}

.sw-camp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 43px;
  padding: 0 14px;
  background: #f7f4ee;
  border: 1px solid #ece9e0;
  border-radius: 999px;
  color: #0f1020;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.sw-camp-chip:hover {
  background: #f9fafb;
  color: #0f1020;
}
.sw-camp-chip__logo {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}
.sw-camp-chip.is-active {
  background: #0f0f21;
  border-color: #0f0f21;
  color: #fff;
}
.sw-camp-chip.is-active:hover {
  background: #1a1a2e;
  color: #fff;
}
.sw-camp-chip.is-active .sw-camp-chip__count {
  color: rgba(255, 255, 255, 0.7);
}
.sw-camp-chip.is-active.sw-camp-chip--all .sw-camp-chip__logo {
  display: none;
}

.sw-camp-chip__menu {
  /* display: none; */
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* color: #fff; */
}

.sw-camp-chip__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.sw-camp-chip__name {
  font-size: 13px;
  font-weight: 600;
}
.sw-camp-chip__count {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}
.sw-camp-chip.is-active .sw-camp-chip__count {
  color: rgba(255, 255, 255, 0.65);
}

.sw-camp-chip--more {
  height: 31px;
  padding: 0 14px;
  background: #f3f0ff;
  border-color: #e9e3ff;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet);
}
.sw-camp-chip--more:hover {
  background: #ede5ff;
  color: var(--sw-violet-600);
}
/* =========================
  3. Campaign Filter Chips End
========================= */

/* =========================
  4. Stat Card Start (with trend pill + sparkline)
========================= */
.sw-stat {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.sw-stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sw-stat__head-l {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-stat__iconbox {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-stat__iconbox--violet {
  background: #eeedfe;
  color: var(--sw-violet);
}
.sw-stat__iconbox--green {
  background: #d1fae5;
  color: #065f46;
}
.sw-stat__iconbox--yellow {
  background: #fef3c7;
  color: #b45309;
}
.sw-stat__iconbox--sky {
  background: #eeedfe;
  color: #6d5ef7;
}

.sw-stat__label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: #6b7280;
}
.sw-stat__more {
  width: 18px;
  height: 18px;
  background: none;
  border: 0;
  padding: 0;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sw-stat__more:hover {
  color: var(--sw-text);
}

.sw-stat__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sw-stat__num-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sw-stat__value {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.64px;
  color: #0f1020;
  margin: 0;
}

.sw-stat__trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-stat__trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
}
.sw-stat__trend-pill--up {
  background: #d1fae5;
  color: #065f46;
}
.sw-stat__trend-pill--down {
  background: #fef2f2;
  color: #dc2626;
}
.sw-stat__trend-cap {
  font-size: 11px;
  line-height: 14px;
  color: #9ca3af;
}

.sw-stat__spark {
  height: 40px !important;
  width: 80px !important;
  max-width: 80px;
  flex-shrink: 0;
  display: block;
}

/* Responsive value/sparkline scaling (matches dashboard stat cards) */
@media (max-width: 991px) {
  .sw-stat__value {
    font-size: 28px;
    line-height: 100%;
  }
}
@media (min-width: 1200px) {
  .sw-stat__value {
    font-size: 26px;
    line-height: 34px;
    white-space: nowrap;
  }
  .sw-stat__spark {
    width: 52px !important;
    max-width: 52px;
  }
}
@media (min-width: 1440px) {
  .sw-stat__value {
    font-size: 32px;
    line-height: 40px;
    white-space: nowrap;
  }
}
/* =========================
  4. Stat Card End
========================= */

/* =========================
  5. Conversion Funnel Card Start
========================= */
.sw-funnel-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.sw-funnel-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sw-funnel-card__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;  
  color: #0f1020;
  margin: 0 0 4px;
}
.sw-funnel-card__subtitle {
  font-size: 13px;
  line-height: 18px;
  color: #6b7280;
  margin: 0;
}

.sw-funnel-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.sw-funnel-stat__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 4px;
}
.sw-funnel-stat__value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f1020;
}
.sw-funnel-stat__value--sm {
  font-size: 18px;
}
.sw-funnel-stat__delta {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.sw-funnel-stat__delta--up {
  background: #d1fae5;
  color: #065f46;
}
.sw-funnel-stat__delta--down {
  background: #fef2f2;
  color: #dc2626;
}

.sw-funnel-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: #f5f3ff;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 0;
}
.sw-funnel-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.sw-funnel-keep {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  gap: 8px;
  margin-top: 16px;
}
.sw-funnel-keep__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

/* =========================
  5. Conversion Funnel Card End
========================= */

/* =========================
  6. Analytics Two-up Panels (Donut + Heatmap) Start
========================= */
.sw-analytics-row {
  margin-bottom: 20px;
}

.sw-analytics-panel {
  background: #fff;
  border: 1px solid #ECE9E0;
  border-radius: 16px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sw-analytics-panel__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  color: #0f1020;
  margin: 0 0 4px;
}
.sw-analytics-panel__subtitle {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 18px;
}

.sw-donut-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: center;
}
.sw-donut-wrap {
  position: relative;
  aspect-ratio: 1;
  max-width: 210px;
  width: 100%;
  margin: 0 auto;
}
.sw-analytics-panel .sw-donut-row {
  flex: 1;
  align-items: center;
}
.sw-analytics-panel .sw-demo-foot {
  margin-top: auto;
}

.sw-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.sw-donut-center__num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f1020;
}
.sw-donut-center__cap {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

.sw-demo-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sw-demo-legend__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sw-demo-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sw-demo-legend__dot--y {
  background: #fbbf24;
}
.sw-demo-legend__dot--g {
  background: #34d399;
}
.sw-demo-legend__dot--v {
  background: #6e5ef7;
}
.sw-demo-legend__dot--b {
  background: #60a5fa;
}
.sw-demo-legend__main {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}
.sw-demo-legend__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
}
.sw-demo-legend__count {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}
.sw-demo-legend__pct {
  font-size: 14px;
  font-weight: 700;
  color: #0f1020;
}

.sw-demo-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  margin-top: 20px;
  border-top: 1px solid #f3f4f6;
}
.sw-demo-foot__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sw-demo-foot__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
}
.sw-demo-foot__value {
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
}

.sw-gender-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.sw-gender-bar__fill {
  height: 100%;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    ),
    linear-gradient(90deg, #6e5ef7 0%, #9c8ff7 100%);
}

.sw-heatmap-chart {
  width: 100%;
  margin-bottom: 16px;
  min-height: 280px;
}
.sw-heatmap__col-label,
.sw-heatmap__row-label {
  font-size: 10px;
  font-weight: 500;
  color: #9ca3af;
  display: flex;
  align-items: center;
}
.sw-heatmap__col-label {
  justify-content: center;
}
.sw-heatmap__row-label {
  justify-content: flex-start;
  padding-right: 4px;
}
.sw-heatmap__cell {
  border-radius: 6px;
  background: #ede9fe;
  min-height: 36px;
}
.sw-heatmap__cell[data-intensity="0"] {
  background: #f5f3ff;
}
.sw-heatmap__cell[data-intensity="1"] {
  background: #e9e5fe;
}
.sw-heatmap__cell[data-intensity="2"] {
  background: #d6cefa;
}
.sw-heatmap__cell[data-intensity="3"] {
  background: #b9aff5;
}
.sw-heatmap__cell[data-intensity="4"] {
  background: #8a78f0;
}
.sw-heatmap__cell[data-intensity="5"] {
  background: #6e5ef7;
}

.sw-heatmap-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fef3c7;
  border-radius: 10px;
  font-size: 12px;
  color: #92400e;
}
.sw-heatmap-tip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
/* =========================
  6. Donut + Heatmap End
========================= */

/* =========================
  7. Performance Over Time Chart Card Start
========================= */
.sw-perf-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.sw-perf-head {
  margin-bottom: 20px;
}
.sw-perf-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.sw-perf-stat__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.sw-perf-stat__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.sw-perf-stat__dot--violet {
  background: #6e5ef7;
}
.sw-perf-stat__dot--cyan {
  background: #06b6d4;
}
.sw-perf-stat__dot--lime {
  background: #84cc16;
}
.sw-perf-stat__value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #0f1020;
  letter-spacing: -0.4px;
}
.sw-perf-chart-wrap {
  position: relative;
  height: 180px;
  width: 100%;
}
/* =========================
  7. Performance Over Time End
========================= */

/* =========================
  8. Top Performing Content Table Start
========================= */
.sw-perf-table {
  background: #ffffff;
  border: 1px solid #ece9e0;
  border-radius: 16px;
  padding: 24px 28px;
  overflow: hidden;
  height: 100%;
}
.sw-perf-table__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sw-perf-table__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  color: #0f1020;
  margin: 0 0 4px;
}
.sw-perf-table__subtitle {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #9ca3af;
  margin: 0;
}

.sw-view-all {
  font-size: 12px;
  font-weight: 500;
  color: var(--sw-violet);
  text-decoration: none;
}
.sw-view-all:hover {
  color: var(--sw-violet-600);
}

.sw-perf-row-head {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) 80px 80px 80px 60px;
  gap: 12px;
  padding: 10px 12px;
  background: #f7f4ee;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
}

.sw-perf-table ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  margin-top: 16px;
}

.sw-perf-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) 80px 80px 80px 60px;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.sw-perf-row:last-child {
  border-bottom: 0;
}
.sw-perf-row:hover,
.sw-perf-row:focus-visible {
  background: #fafafb;
}

.sw-perf-row:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--sw-violet-500);
}
.sw-perf-row__post {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sw-perf-row__logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}
.sw-perf-row__title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-perf-row__meta {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}
.sw-perf-row__plat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  width: fit-content;
}
.sw-perf-row__plat::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.sw-perf-row.is-top {
  background: #f0ebff;
}
.sw-perf-row.is-top:hover {
  background: #ede9fe;
}
.sw-perf-row__num {
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
}
.sw-perf-row__num--earned {
  color: #6b2bff;
}
/* =========================
  8. Top Performing Content End
========================= */

/* =========================
  9. Platform Breakdown Start
========================= */
.sw-platforms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.sw-platform-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: #F0EBFF;
  border-radius: 14px;
}
.sw-platform-top__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sw-platform-top__kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--sw-violet);
}
.sw-platform-top__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  font-weight: 500;
}
.sw-platform-top__delta svg {
  width: 12px;
  height: 12px;
}

.sw-platform-top__body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-platform-top__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sw-platform-top__icon svg {
  width: 36px;
  height: 36px;
  display: block;
}
.sw-platform-top__text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.sw-platform-top__name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #0f1020;
}
.sw-platform-top__meta {
  display: block;
  font-size: 11px;
  color: #6B6F7B;
}

.sw-platform-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}
.sw-platform-row__bar {
  grid-column: 1 / -1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
.sw-platform-row__bar-fill {
  height: 100%;
  border-radius: 999px;
}
.sw-platform-row__bar-fill--tt {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    ),
    linear-gradient(90deg, #18181b, #3f3f46);
}
.sw-platform-row__bar-fill--yt {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    ),
    linear-gradient(90deg, #ef4444, #f87171);
}
.sw-platform-row__bar-fill--x {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    ),
    linear-gradient(90deg, #18181b, #3f3f46);
}
.sw-platform-row__bar-fill--fb {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22) 0 5px,
      rgba(255, 255, 255, 0) 5px 10px
    ),
    linear-gradient(90deg, #1877f2, #60a5fa);
}

.sw-platform-row__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-platform-row__main {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.sw-platform-row__name {
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
}
.sw-platform-row__count {
  font-size: 11px;
  color: #9ca3af;
}
.sw-platform-row__pct {
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
}
/* =========================
  9. Platform Breakdown End
========================= */

/* =========================
  10. Responsive Start
========================= */

/* Tablet (≤991.98px) */
@media (max-width: 991.98px) {
  .sw-camp-filter {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 40px;
  }
  .sw-analytics-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  .sw-analytics-toolbar .sw-date-pick {
    width: 100%;
    justify-content: space-between;
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
  }
  .sw-analytics-toolbar .sw-date-pick svg {
    width: 18px;
    height: 18px;
  }

  .sw-funnel-stats {
    gap: 20px;
  }
  .sw-donut-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sw-perf-row-head {
    display: none;
  }
  .sw-perf-row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 16px;
  }
  .sw-perf-row__post {
    grid-column: 1 / -1;
  }
  .sw-perf-row__plat,
  .sw-perf-row__num {
    font-size: 12px;
  }
  .sw-perf-table__head {
    padding: 16px 16px 8px;
  }
}

/* Phone (≤767.98px) */
@media (max-width: 767.98px) {
  .sw-funnel-card {
    padding: 16px 12px;
  }
  .sw-funnel-card__head {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 16px;
  }
  .sw-funnel-stats {
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .sw-funnel-stats > div {
    min-width: 0;
  }
  .sw-funnel-stat__label {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  .sw-funnel-stat__value {
    font-size: 14px;
    gap: 4px;
  }
  .sw-funnel-stat__value--sm {
    font-size: 13px;
  }
  .sw-funnel-stat__delta {
    font-size: 10px;
    padding: 1px 6px;
  }
  .sw-funnel-chart-wrap {
    height: 180px;
  }
  .sw-funnel-keep {
    gap: 4px;
  }
  .sw-funnel-keep__pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .sw-analytics-panel {
    padding: 16px;
  }
  .sw-heatmap {
    grid-template-columns: 28px repeat(6, 1fr);
    min-height: 220px;
  }
  .sw-heatmap__cell {
    min-height: 28px;
  }

  .sw-perf-card {
    padding: 16px;
  }
  .sw-perf-chart-wrap {
    height: 220px;
  }
  .sw-platform-top {
    padding: 12px;
  }
}

/* Phone (≤575.98px) */
@media (max-width: 575px) {
  .sw-stat {
    padding: 12px;
    gap: 12px;
  }
  .sw-stat__value {
    font-size: 22px;
    line-height: 28px;
  }
  .sw-stat__iconbox {
    width: 32px;
    height: 32px;
  }
  .sw-stat__iconbox svg {
    width: 18px;
    height: 18px;
  }
  .sw-stat__label {
    font-size: 12px;
  }
  .sw-stat__trend-pill {
    font-size: 10px;
    padding: 2px 6px 2px 4px;
  }
  .sw-stat__trend-cap {
    font-size: 10px;
  }
  /* Stacked card layout (matches dashboard) */
  .sw-stat__head {
    align-items: flex-start;
  }
  .sw-stat__head-l {
    flex-direction: column;
    align-items: flex-start;
  }
  .sw-stat__more {
    margin-top: 9px;
  }
  .sw-stat__num-wrap .d-flex {
    flex-direction: column;
    gap: 10px;
  }
  .sw-stat__spark {
    height: 32px !important;
    width: 100% !important;
    max-width: 232px;
  }

  .sw-analytics-toolbar .sw-date-pick {
    width: 100%;
  }

  .sw-funnel-card__head {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .sw-funnel-card__head > div {
    min-width: 0;
    flex: 1 1 auto;
  }
  .sw-funnel-card__title {
    font-size: 16px;
    line-height: 22px;
  }
  .sw-funnel-card__subtitle {
    font-size: 12px;
    line-height: 16px;
  }
  .sw-funnel-card .sw-date-pick, .sw-perf-card .sw-date-pick {
    width: 100%;
    flex-shrink: 0;
    height: 38px;
    padding: 0 8px;
    gap: 4px;
    font-size: 13px;
    justify-content: space-between;
    border-radius: 8px;
  }

  .sw-funnel-stats {
    display: grid;
    grid-template-columns: 85px 1fr 1fr;
    gap: 8px;
  }
  .sw-funnel-stats > div {
    min-width: 0;
  }
  .sw-funnel-stat__label {
    font-size: 9px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }
  .sw-funnel-stat__value {
    font-size: 13px;
    gap: 3px;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
  }
  .sw-funnel-stat__value--sm {
    font-size: 12px;
  }
  .sw-funnel-stat__delta {
    font-size: 9px;
    padding: 1px 5px;
  }

  .sw-perf-table {
    padding: 16px;
  }

  .sw-perf-table__head {
    padding: 0;
  }

  .sw-perf-table__head {
    flex-wrap: wrap;
    gap: 8px;
  }
}
/* =========================
  10. Responsive End
========================= */

/* =========================
  11. Advertiser Analytics Additions Start
========================= */

/* Page head actions (Export + Date Range) */
.sw-page-head--analytics {
  align-items: flex-start;
}
.sw-page-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sw-page-head__actions .sw-date-pick {
  height: 38px;
  padding: 0 14px;
}

/* Performance tabs */
.sw-perf-divider {
  height: 1px;
  background: #eceef2;
  margin: 16px 0 12px;
}
.sw-perf-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 12px;
  width: 100%;
}
.sw-perf-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.sw-perf-tab svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.sw-perf-tab.is-active {
  background: #fff;
  color: #0f1020;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Conversion funnel bar list */
.sw-cfunnel {
  display: flex;
  flex-direction: column;
  gap: 24px; /* min spacing; space-between fills the rest to match Performance card */
  margin-top: 4px;
  flex: 1;
  justify-content: space-between;
}
.sw-cfunnel-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.sw-cfunnel-row__id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sw-cfunnel-row__label {
  font-size: 14px;
  font-weight: 700;
  color: #0f1020;
}
.sw-cfunnel-row__sub {
  position: relative;
  font-size: 12.5px;
  font-weight: 500;
  color: #9ca3af;
  padding-left: 10px;
}
.sw-cfunnel-row__sub::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: #c7cad1;
}
.sw-cfunnel-row__val {
  font-size: 15px;
  font-weight: 700;
  color: #0f1020;
  white-space: nowrap;
}
.sw-cfunnel__track {
  height: 14px;
  border-radius: 999px;
  background: #f1f0f7;
  overflow: hidden;
}
.sw-cfunnel__bar {
  height: 100%;
  border-radius: 999px;
  /* diagonal hatch lines layered over a left-to-right color gradient */
  background-image: repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.28) 0,
      rgba(255, 255, 255, 0.28) 1.5px,
      rgba(255, 255, 255, 0) 1.5px,
      rgba(255, 255, 255, 0) 9px
    ),
    linear-gradient(90deg, var(--cf-from), var(--cf-to));
}
.sw-cfunnel__bar--violet {
  --cf-from: #a89bff;
  --cf-to: #6d5ef7;
}
.sw-cfunnel__bar--red {
  --cf-from: #ff6a6a;
  --cf-to: #ef2d2d;
}
.sw-cfunnel__bar--dark {
  --cf-from: #3a3a46;
  --cf-to: #0f1117;
}
.sw-cfunnel__bar--blue {
  --cf-from: #5fb0ff;
  --cf-to: #1f86ef;
}

/* Purchases by store bar list */
.sw-store-bars__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sw-store-bars__kicker {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}
.sw-store-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sw-store-bar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.sw-store-bar__label {
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
}
.sw-store-bar__val {
  font-size: 13px;
  font-weight: 700;
  color: #0f1020;
}
.sw-store-bar__track {
  height: 10px;
  border-radius: 999px;
  background: #eef0fb;
  overflow: hidden;
}
.sw-store-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d5ef7, #8b7df9);
}

/* Heatmap legend + note */
.sw-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sw-heatmap-legend__txt {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}
.sw-heatmap-legend__scale {
  display: inline-flex;
  gap: 3px;
}
.sw-heatmap-legend__scale i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.sw-heatmap-legend__pill {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6d5ef7;
  background: #efedfd;
  border-radius: 999px;
  padding: 4px 12px;
}
.sw-heatmap-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: #4b5563;
}
.sw-heatmap-note__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d5ef7;
  margin-top: 5px;
  flex-shrink: 0;
}

/* Top performing locations table */
.sw-loc-table__head,
.sw-loc-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1.2fr 1fr;
  align-items: center;
  gap: 12px;
}
.sw-loc-table__head {
  padding: 0 8px 12px;
  border-bottom: 1px solid #f0eee7;
}
.sw-loc-table__head span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9ca3af;
}
.sw-loc-table__sorted {
  color: #6d5ef7 !important;
}
.sw-loc-table ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sw-loc-row {
  padding: 14px 8px;
  border-bottom: 1px solid #f5f4ef;
}
.sw-loc-row:last-child {
  border-bottom: 0;
}
.sw-loc-row__store {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sw-loc-row__thumb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}
.sw-loc-row__name {
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-loc-row__num {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.sw-loc-row__num--sorted {
  color: #6d5ef7;
  font-weight: 700;
}
.sw-loc-row__status {
  text-align: right;
}
.sw-status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
}
.sw-status-pill--green {
  background: #d6f5e3;
  color: #057a55;
}
.sw-status-pill--amber {
  background: #fef3c7;
  color: #b45309;
}

/* Top performing content table */
.sw-cperf-head,
.sw-cperf-row {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 0.8fr 0.9fr 0.7fr 1.1fr 0.9fr;
  align-items: center;
  gap: 10px;
}
.sw-cperf-head {
  padding: 14px 8px 12px;
  border-bottom: 1px solid #f0eee7;
}
.sw-cperf-head span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9ca3af;
}
.sw-perf-table .sw-cperf-row {
  list-style: none;
}
.sw-cperf-row {
  padding: 14px 8px;
  border-bottom: 1px solid #f5f4ef;
}
.sw-cperf-row:last-child {
  border-bottom: 0;
}
.sw-cperf-row.is-top {
  background: #faf9ff;
  border-radius: 12px;
}
.sw-cperf-row__post {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sw-cperf-row__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}
.sw-cperf-row__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
}
.sw-cperf-row__meta {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
}
.sw-cperf-row__plat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.sw-cperf-row__pico {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}
.sw-cperf-row__pico--tt {
  background: #111111;
}
.sw-cperf-row__pico--ig {
  background: #e1306c;
}
.sw-cperf-row__pico--yt {
  background: #ff0000;
}
.sw-cperf-row__pico--fb {
  background: #1877f2;
}
.sw-cperf-row__num {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.sw-cperf-row__num--crt {
  color: #059669;
}
.sw-cperf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid #f0eee7;
}
.sw-cperf-foot__count {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
}

/* Platform donut (advertiser) */
.sw-donut-wrap--plat {
  max-width: 200px;
  margin: 4px auto 20px;
}
.sw-plat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-plat-list .sw-platform-row {
  grid-template-columns: 1fr auto;
}

/* Mobile: collapse location + content tables into stacked cards */
@media (max-width: 991px) {
  .sw-page-head--analytics {
    flex-direction: column;
    align-items: stretch;
  }
  .sw-page-head__actions {
    width: 100%;
  }
  .sw-page-head__actions .sw-date-pick {
    flex: 1;
    justify-content: center;
  }

  .sw-loc-table__head,
  .sw-cperf-head {
    display: none;
  }
  .sw-loc-row,
  .sw-cperf-row {
    display: block;
    border: 1px solid #f0eee7;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
  }
  .sw-loc-row__store,
  .sw-cperf-row__post {
    margin-bottom: 10px;
  }
  .sw-loc-row__num,
  .sw-loc-row__status,
  .sw-cperf-row__num,
  .sw-cperf-row__plat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 5px 0;
  }
  .sw-loc-row__num::before,
  .sw-loc-row__status::before,
  .sw-cperf-row__num::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
  }
  .sw-cperf-row__plat {
    justify-content: flex-start;
    gap: 7px;
  }
}
/* =========================
  11. Advertiser Analytics Additions End
========================= */

/* =========================
  12. Retail Heatmap (Leaflet map)
========================= */
/* heading → map content gap = 16px (Figma) */
.sw-heatmap-head {
  margin-bottom: 16px;
}
.sw-heatmap {
  position: relative;
  margin-top: 0;
}
.sw-heatmap__map {
  height: 360px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #eceef2;
  overflow: hidden;
  background: #eef1f5;
  z-index: 0; /* contain Leaflet's internal stacking below the topbar */
}
/* legend — top-right card with title (Figma) */
.sw-heatmap__legend {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #eceef2;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 16, 32, 0.1);
}
.sw-heatmap__legend-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f1020;
}
.sw-heatmap__legend-scale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-heatmap__legend-cap {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
}
.sw-heatmap__legend-bar {
  width: 78px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
}

/* Store marker = colored dot + white pill (Leaflet divIcon) */
.sw-hm-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sw-hm-pin__dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(15, 16, 32, 0.08);
  flex-shrink: 0;
}
.sw-hm-pin__dot--hot {
  background: #ef4444;
}
.sw-hm-pin__dot--warm {
  background: #f59e0b;
}
.sw-hm-pin__dot--cool {
  background: #22c55e;
}
.sw-hm-pin__pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f1020;
  box-shadow: 0 2px 6px rgba(15, 16, 32, 0.14);
}
.sw-heatmap__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sw-heatmap__hot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
}
.sw-heatmap__hot-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}
.sw-heatmap__count {
  font-size: 12.5px;
  color: #9ca3af;
  font-weight: 500;
}

/* =========================
  13. Date-range Dropdowns (Date Range, Funnel, Performance,
      Retail Heatmap, Top Locations)
========================= */
.sw-dropdown {
  position: relative;
  display: inline-flex;
}
.sw-dropdown__toggle {
  cursor: pointer;
}
.sw-dropdown__chev {
  transition: transform 0.18s ease;
}
.sw-dropdown.is-open .sw-dropdown__chev {
  transform: rotate(180deg);
}
.sw-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 600;
  min-width: 184px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 16, 32, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}
.sw-dropdown.is-open .sw-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sw-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  text-align: left;
  cursor: pointer;
}
.sw-dropdown__item:hover {
  background: #f5f3ff;
}
.sw-dropdown__item.is-selected {
  color: #6e5ef7;
  font-weight: 600;
}
.sw-dropdown__item-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #6e5ef7;
  opacity: 0;
}
.sw-dropdown__item.is-selected .sw-dropdown__item-check {
  opacity: 1;
}

/* Keep the panel-head dropdowns sized like the old static pickers */
.sw-funnel-card__head > .sw-dropdown {
  flex: 0 0 auto;
}

/* Mobile: match the full-width behaviour of the page-head action buttons */
@media (max-width: 991px) {
  .sw-page-head__actions .sw-dropdown {
    flex: 1;
  }
  .sw-page-head__actions .sw-dropdown .sw-date-pick {
    width: 100%;
    justify-content: space-between;
  }
}
