:root {
  --page: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #1b2430;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #075e54;
  --brand-2: #0ea5a4;
  --gold: #d8a400;
  --green: #16a34a;
  --red: #dc2626;
  --purple: #7c3aed;
  --blue: #2563eb;
  --shadow: 0 16px 40px rgba(27, 36, 48, 0.08);
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.report_topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand_lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand_badge {
  width: 58px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand_lockup strong,
.brand_lockup span {
  display: block;
}

.brand_lockup strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.brand_lockup span,
.report_meta dt,
.panel_header p,
.filter_band span,
.metric_picker span,
.eyebrow,
.empty_state {
  color: var(--muted);
}

.brand_lockup span {
  font-size: 0.78rem;
}

.report_actions {
  display: flex;
  gap: 8px;
}

.icon_button,
.primary_button,
.secondary_button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.icon_button {
  width: 44px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.primary_button {
  padding: 0 18px;
  color: #ffffff;
  border-color: var(--brand);
  background: var(--brand);
}

.secondary_button {
  padding: 0 18px;
}

.nav_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  text-decoration: none;
}

.report_shell {
  width: min(100% - 32px, 1440px);
  margin: 24px auto 52px;
  display: grid;
  gap: 18px;
}

.report_intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 8px 0 4px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  font-weight: 800;
}

#reportSubtitle {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.report_meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, auto));
  gap: 10px;
}

.report_meta div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.report_meta dt {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report_meta dd {
  margin-top: 4px;
  font-weight: 800;
}

.filter_band {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filter_band label,
.metric_picker {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.filter_band input,
.metric_picker select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--text);
}

.insight_grid,
.kpi_grid,
.dashboard_grid {
  display: grid;
  gap: 14px;
}

.insight_grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi_grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two_columns {
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 0.85fr);
}

.panel,
.kpi_card,
.insight_card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  min-width: 0;
}

.chart_panel {
  overflow: hidden;
}

.kpi_card,
.insight_card {
  padding: 16px;
}

.kpi_card {
  min-height: 140px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.kpi_card span,
.kpi_card small,
.insight_card p {
  color: var(--muted);
  line-height: 1.42;
}

.kpi_card strong {
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.kpi_card.accent {
  border-color: rgba(14, 165, 164, 0.34);
}

.kpi_card.success {
  border-color: rgba(22, 163, 74, 0.34);
}

.kpi_card.warning {
  border-color: rgba(216, 164, 0, 0.42);
}

.kpi_card.danger {
  border-color: rgba(220, 38, 38, 0.30);
}

.insight_card {
  display: grid;
  gap: 8px;
}

.insight_card.info {
  border-left: 5px solid var(--brand-2);
}

.insight_card.accent {
  border-left: 5px solid var(--gold);
}

.insight_card.success {
  border-left: 5px solid var(--green);
}

.insight_card.danger {
  border-left: 5px solid var(--red);
}

.panel_header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.panel_header h2 {
  font-size: 1.1rem;
}

.panel_header p {
  margin-top: 4px;
  font-size: 0.86rem;
}

.heatmap_header {
  align-items: end;
}

.metric_picker {
  min-width: 190px;
}

.chart_box {
  min-height: 330px;
}

.timeline_svg {
  width: 100%;
  min-height: 310px;
  display: block;
}

.timeline_grid {
  stroke: #e7ebf1;
  stroke-width: 1;
}

.timeline_axis,
.timeline_scale {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline_line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline_dot {
  stroke: var(--panel);
  stroke-width: 2;
}

.legend_row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.chart_box .legend_row {
  margin: 8px 0 0;
}

.legend_item {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.legend_swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.metric_results {
  background: var(--brand);
  stroke: var(--brand);
}

.metric_uploads {
  background: var(--brand-2);
  stroke: var(--brand-2);
}

.metric_prints {
  background: var(--gold);
  stroke: var(--gold);
}

.metric_downloads {
  background: var(--blue);
  stroke: var(--blue);
}

.timeline_dot.metric_results {
  fill: var(--brand);
}

.timeline_dot.metric_uploads {
  fill: var(--brand-2);
}

.timeline_dot.metric_prints {
  fill: var(--gold);
}

.timeline_dot.metric_downloads {
  fill: var(--blue);
}

.funnel_chart {
  display: grid;
  gap: 12px;
}

.funnel_row {
  display: grid;
  gap: 7px;
}

.funnel_meta,
.bar_meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.funnel_meta strong {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  white-space: nowrap;
}

.funnel_meta strong small {
  color: var(--muted);
  font-size: 0.72rem;
}

.track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.daily_compare {
  display: grid;
  gap: 14px;
}

.metric_group {
  display: grid;
  gap: 9px;
}

.metric_group h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.metric_row {
  display: grid;
  grid-template-columns: minmax(130px, 0.22fr) minmax(0, 1fr) minmax(52px, auto);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric_track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.metric_fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.bar_chart,
.hour_chart {
  display: grid;
  gap: 10px;
}

.hour_chart {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.hour_chart_grid {
  display: grid;
  gap: 10px;
  align-items: end;
  min-height: 280px;
  padding-top: 8px;
}

.hour_slot {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  justify-items: center;
  height: 280px;
}

.hour_bars {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: end;
  padding-top: 22px;
  border-bottom: 1px solid #e7ebf1;
}

.hour_bar_wrap {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 3px;
}

.hour_bar_value {
  min-height: 14px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
}

.hour_fill {
  width: 100%;
  min-height: 0;
  border-radius: 8px 8px 4px 4px;
}

.hour_fill.has_value {
  min-height: 8px;
}

.hour_slot small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.heatmap {
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap_top,
.heatmap_row {
  display: grid;
  grid-template-columns: 74px repeat(24, minmax(28px, 1fr));
  gap: 5px;
  align-items: center;
  min-width: 900px;
}

.heatmap_label,
.heatmap_hour {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.heatmap_cell {
  min-height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
}

.table_wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--panel-soft);
}

td.numeric,
th.numeric {
  text-align: right;
}

.status_chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf0f5;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.empty_state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: center;
}

@media (max-width: 1160px) {
  .insight_grid,
  .kpi_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two_columns,
  .report_intro,
  .filter_band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .report_topbar {
    position: static;
    align-items: flex-start;
  }

  .brand_badge {
    width: 52px;
  }

  .report_shell {
    width: min(100% - 20px, 1440px);
    margin-top: 14px;
  }

  .insight_grid,
  .kpi_grid,
  .report_meta {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .metric_row {
    grid-template-columns: minmax(94px, 0.42fr) minmax(0, 1fr) minmax(42px, auto);
    gap: 7px;
  }

  .heatmap_header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric_picker {
    min-width: 0;
    width: 100%;
  }

  .hour_chart_grid {
    min-width: 760px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  :root {
    --page: #ffffff;
    --panel: #ffffff;
    --panel-soft: #ffffff;
    --text: #111827;
    --muted: #4b5563;
    --line: #c7ced8;
    --shadow: none;
  }

  body {
    background: #ffffff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report_topbar,
  .filter_band {
    display: none;
  }

  .report_shell {
    width: 100%;
    margin: 0;
    gap: 12px;
  }

  .panel,
  .kpi_card,
  .insight_card,
  .report_meta div {
    box-shadow: none;
    break-inside: avoid;
  }

  .print_break_before {
    break-before: page;
  }

  .chart_box {
    min-height: 240px;
  }

  .timeline_svg {
    min-height: 230px;
  }

  .hour_chart {
    overflow: visible;
  }

  .hour_chart_grid {
    min-width: 0 !important;
    gap: 6px;
  }

  .heatmap {
    overflow: visible;
  }

  .heatmap_top,
  .heatmap_row {
    min-width: 0;
    grid-template-columns: 58px repeat(24, minmax(18px, 1fr));
    gap: 3px;
  }

  table {
    font-size: 0.72rem;
  }

  th,
  td {
    padding: 6px 5px;
  }
}
