<style>
:root {
  --primary: #4a90e2;
  --highlight: #ffa07a;
  --accent: #ff8c66;
  --shadow: rgba(0, 0, 0, 0.25);
}

  #loadingOverlay {
      position: fixed;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      background-color: rgba(0, 0, 0, 0.9);
      color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      opacity: 1;
      visibility: visible;
      transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    #loadingOverlay.fade-out {
      opacity: 0;
      visibility: hidden;
    }

    .loader-content {
      text-align: center;
      font-size: 1.5rem;
    }

    .loader-content i {
      font-size: 2.5rem;
      margin-bottom: 0.5rem;
    }

/* Light Theme */
[data-theme="light"] {
  --bg: #ffffff;
  --text: #121212;
  --card-bg: #f0f0f0;
  --border: #cccccc;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #121212;
  --text: #e0e0e0;
  --card-bg: #1e1e1e;
  --border: #2a2a2a;
}

.earnings-counter-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}


body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

main.report-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

h2.title {
  font-size: 2.8rem;
  margin: 0 0 1rem;
  color: var(--highlight);
  text-align: center;
  font-weight: 700;
  text-shadow: 1px 1px 3px var(--shadow);
  letter-spacing: 0.5px;
}

.intro-text {
  text-align: center;
  font-size: 1.1rem;
  margin: 0 0 2rem;
  color: var(--text);
}

.earnings-counter-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 6px 12px var(--shadow);
  margin-bottom: 0.4rem;
}

.earnings-counter {
  background: linear-gradient(135deg, var(--card-bg), #ffffff0d);
  color: var(--text);
  padding: 1.8rem;
  border-radius: 16px;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.7rem;
  font-weight: 700;
  box-shadow: 0 6px 10px var(--shadow);
  margin-bottom: 1rem;
  width: 720px;
}

.earnings-counter i {
  color: var(--accent);
  font-size: 1.6rem;
}

.campaign-start-box {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.1rem;
  border-radius: 16px;
  box-shadow: 0 6px 12px var(--shadow);
  overflow-x: auto;
}

.campaign-date-item {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.campaign-date-item .label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

.campaign-date-item .value {
  font-size: 1.5rem;
  font-weight: 500;
}

.summary-box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 6px 12px var(--shadow);
}

.summary-item {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: linear-gradient(135deg, #ffffff0c, #ffffff08);
  box-shadow: 0 6px 10px var(--shadow);
}

.summary-item i {
  font-size: 2rem;
  color: var(--primary);
}

.summary-item .value {
  font-size: 1.7rem;
  font-weight: bold;
  color: var(--accent);
}

.chart-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 6px 12px var(--shadow);
}

.chart-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  text-align: center;
}

canvas {
  max-width: 100%;
  height: auto;
}

.floating-toolbar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toolbar-btn {
  padding: 0.65rem 1.1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px var(--shadow);
  transition: background 0.25s ease, transform 0.15s ease;
}

.toolbar-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

/* Optional: Highlight class for critical metrics */
.key-highlight {
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  color: var(--highlight) !important;
}

/* Improved Mobile Responsiveness */
@media screen and (max-width: 768px) {
  .campaign-start-box {
    flex-direction: column;
    gap: 1rem;
    overflow-x: visible;
  }

 .campaign-date-item {
  width: 100%;
  padding: 0.5rem 0.5rem;
  background-color: inherit; /* match parent or theme */
  border-radius: 1px;
  box-shadow: none; /* remove extra height from shadow */
  height: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem; /* match with summary */
  color: inherit; /* match theme */
}

.campaign-date-item .value {
   display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 70%;
  padding: 1rem;
  background-color: inherit;
  border-radius: 10px;
  box-shadow: none;
  text-align: center;
  font-size: 1.5rem;
  color: inherit;
}

.campaign-date-item .label {
   display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 70%;
  padding: 1rem;
  background-color: inherit;
  border-radius: 10px;
  box-shadow: none;
  text-align: center;
  font-size: 1.5rem;
  color: inherit;
}

  .summary-box {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }

.summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 70%;
  padding: 1rem;
  background-color: inherit;
  border-radius: 10px;
  box-shadow: none;
  text-align: center;
  font-size: 1.5rem;
  color: inherit;
}

.summary-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px var(--shadow);
    text-align: center;
  }

  .summary-item .label,
  .summary-item .value {
    font-size: 1.4rem;
    color: inherit;
    text-align: center;
  }

  .earnings-counter-wrapper {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .earnings-counter {
    flex-direction: column;
    width: 100%;
    font-size: 1.4rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow);
    text-align: center;
  }
  h2.title {
    font-size: 2rem;
    padding: 0 0.1rem;
  }

  .intro-text {
    font-size: 1rem;
    padding: 0 0.1rem;
  }
}
</style>
