.fm-report-view {
  --report-blue: #2877c7;
  --report-green: #1f9d68;
  --report-gold: #b98516;
  --report-violet: #7356a5;
  --report-red: #c44d43;
  --report-surface: rgba(255, 255, 255, .92);
  --report-border: rgba(139, 101, 35, .2);
  padding-bottom: 24px;
}

.fm-report-view *,
.fm-report-view *::before,
.fm-report-view *::after {
  letter-spacing: 0;
}

.fm-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.fm-report-head h2 {
  margin: 0 0 5px;
  font-size: 26px;
  line-height: 1.2;
}

.fm-report-head p {
  color: var(--muted);
  line-height: 1.45;
}

.fm-report-range {
  display: block;
  margin-top: 5px;
  color: #8a6a42;
  font-size: 12px;
  font-weight: 700;
}

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

.fm-report-period,
.fm-report-icon-btn,
.fm-report-export {
  height: 42px;
  border: 1px solid var(--report-border);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.fm-report-period {
  padding: 0 14px;
  color: #5e4b39;
  background: rgba(255, 255, 255, .78);
}

.fm-report-period svg,
.fm-report-export svg,
.fm-report-icon-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.fm-report-icon-btn,
.fm-report-export {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.fm-report-icon-btn {
  width: 42px;
  color: #574334;
  background: #fff;
}

.fm-report-export {
  padding: 0 15px;
  color: #fff;
  border-color: #241912;
  background: #241912;
}

.fm-report-icon-btn:hover,
.fm-report-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(50, 35, 24, .13);
}

.fm-report-icon-btn:focus-visible,
.fm-report-export:focus-visible {
  outline: 3px solid rgba(201, 155, 46, .22);
  outline-offset: 2px;
}

.fm-report-notice {
  display: none;
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid #f1cc77;
  border-radius: 7px;
  color: #75510a;
  background: #fff8e8;
  font-size: 13px;
  line-height: 1.45;
}

.fm-report-notice.is-visible {
  display: block;
  animation: fmReportFade .28s ease both;
}

.fm-report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fm-report-kpi {
  min-height: 116px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--report-border);
  border-top: 3px solid var(--report-blue);
  border-radius: 8px;
  background: var(--report-surface);
  box-shadow: 0 12px 28px rgba(69, 48, 31, .07);
  opacity: 0;
  animation: fmReportRise .48s cubic-bezier(.22, 1, .36, 1) forwards;
}

.fm-report-kpi:nth-child(2) { animation-delay: 50ms; }
.fm-report-kpi:nth-child(3) { animation-delay: 100ms; }
.fm-report-kpi:nth-child(4) { animation-delay: 150ms; }
.fm-report-kpi:nth-child(5) { animation-delay: 200ms; }
.fm-report-kpi[data-tone="green"] { border-top-color: var(--report-green); }
.fm-report-kpi[data-tone="gold"] { border-top-color: var(--report-gold); }
.fm-report-kpi[data-tone="violet"] { border-top-color: var(--report-violet); }
.fm-report-kpi[data-tone="red"] { border-top-color: var(--report-red); }

.fm-report-kpi-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--report-blue);
  background: #eaf4ff;
}

.fm-report-kpi[data-tone="green"] .fm-report-kpi-icon { color: var(--report-green); background: #e8f8f1; }
.fm-report-kpi[data-tone="gold"] .fm-report-kpi-icon { color: var(--report-gold); background: #fff4d9; }
.fm-report-kpi[data-tone="violet"] .fm-report-kpi-icon { color: var(--report-violet); background: #f1ecfa; }
.fm-report-kpi[data-tone="red"] .fm-report-kpi-icon { color: var(--report-red); background: #fff0ee; }
.fm-report-kpi-icon svg { width: 21px; height: 21px; }
.fm-report-kpi span { display: block; color: #6b7280; font-size: 11px; font-weight: 800; line-height: 1.35; text-transform: uppercase; }
.fm-report-kpi b { display: block; margin-top: 4px; color: #14213a; font-size: 27px; line-height: 1.1; overflow-wrap: anywhere; }
.fm-report-kpi small { display: block; min-height: 15px; margin-top: 7px; color: #7c8799; font-size: 11px; font-weight: 700; line-height: 1.35; }
.fm-report-kpi small.is-positive { color: #147c53; }
.fm-report-kpi small.is-negative { color: #b5473f; }

.fm-report-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.fm-report-grid-primary { grid-template-columns: minmax(0, 1.62fr) minmax(300px, .88fr); }
.fm-report-grid-secondary { grid-template-columns: minmax(285px, .9fr) minmax(360px, 1.28fr) minmax(250px, .82fr); }

.fm-report-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--report-border);
  border-radius: 8px;
  background: var(--report-surface);
  box-shadow: 0 14px 32px rgba(69, 48, 31, .075);
  opacity: 0;
  animation: fmReportRise .52s cubic-bezier(.22, 1, .36, 1) .12s forwards;
}

.fm-report-grid-secondary .fm-report-panel:nth-child(2) { animation-delay: .17s; }
.fm-report-grid-secondary .fm-report-panel:nth-child(3) { animation-delay: .22s; }

.fm-report-panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(139, 101, 35, .15);
  background: linear-gradient(90deg, rgba(255, 250, 240, .76), rgba(255, 255, 255, .34));
}

.fm-report-panel-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.fm-report-panel-head p {
  margin-top: 3px;
  color: #788395;
  font-size: 11px;
  line-height: 1.35;
}

.fm-report-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #657184;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fm-report-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--report-blue);
}

.fm-report-legend i.is-green { margin-left: 4px; background: var(--report-green); }

.fm-report-chart {
  height: 300px;
  padding: 16px 16px 12px;
}

.fm-report-chart canvas { width: 100% !important; height: 100% !important; }

.fm-report-funnel {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 22px 19px;
}

.fm-report-funnel-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.fm-report-funnel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.fm-report-funnel-track {
  height: 15px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f5;
}

.fm-report-funnel-bar {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--report-blue);
  transition: width .72s cubic-bezier(.22, 1, .36, 1);
}

.fm-report-funnel-row:nth-child(2) .fm-report-funnel-bar { background: var(--report-violet); }
.fm-report-funnel-row:nth-child(3) .fm-report-funnel-bar { background: var(--report-gold); }
.fm-report-funnel-row:nth-child(4) .fm-report-funnel-bar { background: var(--report-green); }
.fm-report-funnel-value { color: #17233a; font-size: 15px; font-weight: 900; text-align: right; }

.fm-report-donut-wrap {
  min-height: 286px;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(130px, .9fr);
  gap: 13px;
  align-items: center;
  padding: 18px;
}

.fm-report-donut {
  position: relative;
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.fm-report-donut canvas { width: 100% !important; height: 100% !important; }
.fm-report-donut-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.fm-report-donut-total b { font-size: 25px; line-height: 1; }
.fm-report-donut-total span { margin-top: 4px; color: #7d8797; font-size: 11px; font-weight: 700; }
.fm-report-area-legend { display: grid; gap: 10px; }
.fm-report-area-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 11px; }
.fm-report-area-item i { width: 9px; height: 9px; border-radius: 3px; }
.fm-report-area-item span { color: #5b6677; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-report-area-item b { color: #17233a; font-size: 12px; }

.fm-report-heatmap {
  min-height: 286px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
}

.fm-report-heat-grid {
  display: grid;
  grid-template-columns: 38px repeat(6, minmax(34px, 1fr));
  gap: 6px;
  align-items: center;
}

.fm-report-heat-label {
  color: #778295;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.fm-report-heat-label.is-day { text-align: left; }
.fm-report-heat-cell { height: 31px; border: 1px solid rgba(40, 119, 199, .08); border-radius: 5px; background: #edf5fc; transition: transform .16s ease, border-color .16s ease; }
.fm-report-heat-cell:hover { transform: translateY(-1px); border-color: rgba(40, 119, 199, .38); }
.fm-report-heat-cell[data-level="1"] { background: #d6e9f8; }
.fm-report-heat-cell[data-level="2"] { background: #a9d2ed; }
.fm-report-heat-cell[data-level="3"] { background: #64addc; }
.fm-report-heat-cell[data-level="4"] { background: #2877c7; }
.fm-report-heat-scale { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 14px; color: #7b8594; font-size: 10px; }
.fm-report-heat-scale i { width: 15px; height: 8px; border-radius: 3px; background: #edf5fc; }
.fm-report-heat-scale i:nth-of-type(2) { background: #a9d2ed; }
.fm-report-heat-scale i:nth-of-type(3) { background: #2877c7; }

.fm-report-insight-list {
  min-height: 286px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
}

.fm-report-insight {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid #e7e1d7;
  border-radius: 7px;
  background: #fbfcfe;
}

.fm-report-insight-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #7c5d20;
  background: #fff1c9;
  font-size: 15px;
  font-weight: 900;
}

.fm-report-insight b { display: block; margin-bottom: 3px; color: #29364b; font-size: 12px; }
.fm-report-insight p { color: #687487; font-size: 11px; line-height: 1.42; }

.fm-report-table-panel { margin-bottom: 0; }
.fm-report-updated { color: #7b8594; font-size: 11px; font-weight: 700; white-space: nowrap; }
.fm-report-table-scroll { overflow-x: auto; }
.fm-report-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.fm-report-table th,
.fm-report-table td { padding: 13px 17px; border-bottom: 1px solid #ece8e1; text-align: left; font-size: 12px; }
.fm-report-table th { color: #7d8795; background: #fbfaf7; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.fm-report-table td { color: #354156; }
.fm-report-table tbody tr:last-child td { border-bottom: 0; }
.fm-report-table tbody tr:hover td { background: #fffdf8; }
.fm-report-area-name { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.fm-report-area-name i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.fm-report-conversion-pill { display: inline-flex; min-width: 54px; justify-content: center; padding: 4px 8px; border-radius: 999px; color: #147c53; background: #e9f8f1; font-weight: 900; }
.fm-report-table-empty { height: 90px; color: #7d8795 !important; font-style: italic; text-align: center !important; }
.fm-report-empty { min-height: 100px; display: flex; align-items: center; justify-content: center; color: #7d8795; font-size: 12px; font-style: italic; text-align: center; }

.fm-report-view.is-loading .fm-report-kpi b,
.fm-report-view.is-loading .fm-report-chart,
.fm-report-view.is-loading .fm-report-funnel,
.fm-report-view.is-loading .fm-report-donut-wrap,
.fm-report-view.is-loading .fm-report-heatmap,
.fm-report-view.is-loading .fm-report-insight-list,
.fm-report-view.is-loading .fm-report-table-scroll {
  opacity: .46;
}

@keyframes fmReportRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fmReportFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1450px) {
  .fm-report-kpis { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .fm-report-grid-secondary { grid-template-columns: 1fr 1.25fr; }
  .fm-report-insights { grid-column: 1 / -1; }
  .fm-report-insight-list { min-height: 0; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1120px) {
  .fm-report-kpis { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .fm-report-grid-primary,
  .fm-report-grid-secondary { grid-template-columns: 1fr; }
  .fm-report-insights { grid-column: auto; }
  .fm-report-insight-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .fm-report-head { flex-direction: column; }
  .fm-report-actions { width: 100%; justify-content: flex-start; }
  .fm-report-export { flex: 1; }
  .fm-report-kpis { grid-template-columns: 1fr; }
  .fm-report-kpi { min-height: 98px; }
  .fm-report-panel-head { align-items: flex-start; flex-direction: column; }
  .fm-report-legend { white-space: normal; }
  .fm-report-chart { height: 260px; }
  .fm-report-donut-wrap { grid-template-columns: 1fr; }
  .fm-report-area-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-report-heat-grid { grid-template-columns: 32px repeat(6, minmax(29px, 1fr)); gap: 4px; }
  .fm-report-heat-cell { height: 27px; }
  .fm-report-updated { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-report-kpi,
  .fm-report-panel,
  .fm-report-notice,
  .fm-report-funnel-bar {
    animation: none !important;
    opacity: 1;
    transition: none !important;
  }
}
