[data-chart-type-value="bar"] .c3-chart .c3-chart-texts .c3-chart-text .c3-text {
  fill: black !important;
}

[data-chart-type-value="bar"] .c3-grid .c3-ygrids .c3-ygrid {
  stroke: black !important;
}

/* Y-axis labels - adapt to theme */
.c3-axis-y .tick text {
  fill: black !important;
}

/* X-axis labels - adapt to theme */
.c3-axis-x .tick text {
  fill: black !important;
}

/* Legend text - adapt to theme */
.c3-legend-item text {
  fill: black !important;
}

.c3-grid .c3-ygrid,
.c3-grid .c3-xgrid {
  stroke: #e0e0e0 !important;
}

.c3-axis-x path,
.c3-axis-x line,
.c3-axis-y path,
.c3-axis-y line {
  stroke: #bdbdbd !important;
  fill: none !important;
}

.c3-axis-x path {
  stroke: none !important;
}

/* Restore X-axis line for specific charts */
.show-x-axis .c3-axis-x path {
  stroke: #bdbdbd !important;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  [data-chart-type-value="bar"] .c3-chart .c3-chart-texts .c3-chart-text .c3-text {
    fill: white !important;
  }

  [data-chart-type-value="bar"] .c3-grid .c3-ygrids .c3-ygrid {
    stroke: rgba(255, 255, 255, 0.3) !important;
  }

  .c3-axis-y .tick text {
    fill: white !important;
  }

  .c3-axis-x .tick text {
    fill: white !important;
  }

  .c3-legend-item text {
    fill: white !important;
  }

  .c3-grid .c3-ygrid,
  .c3-grid .c3-xgrid {
    stroke: rgba(255, 255, 255, 0.2) !important;
  }

  .c3-axis-x path,
  .c3-axis-x line,
  .c3-axis-y path,
  .c3-axis-y line {
    stroke: rgba(255, 255, 255, 0.4) !important;
  }

  .show-x-axis .c3-axis-x path {
    stroke: rgba(255, 255, 255, 0.4) !important;
  }
}

.spline-chart-present .c3-line {
  stroke-width: 3px;
  fill: none !important;
}

.c3-legend-item-tile {
  stroke-width: 10;
  shape-rendering: auto;
  stroke-linecap: round;
  stroke-dasharray: .1 10;
  transform: translate(6px);
}

.c3-tooltip-container {
  background: #333 !important;
  border: 1px solid #333 !important;
  border-radius: 5px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  color: white !important;
}

.c3-tooltip th {
  background-color: #333 !important;
  font-size: 14px;
  padding: 5px 10px;
  text-align: left !important;
  color: #fff;
}

.c3-tooltip td {
  font-size: 13px;
  padding: 5px 10px;
  color: #fff;
  border-left: none !important;
}