/* TotalCRM-specific styles. The design system lives in theme.css — anything
   reusable across projects belongs there, not here. */

/* ==========================================================================
   Pipeline board
   ========================================================================== */

.pipeline-board {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.pipeline-column {
  flex: 0 0 264px;
  background: var(--app-surface-sunk);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}

.pipeline-column-header {
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--app-border);
  border-top: 2px solid var(--app-border-strong);
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  background: var(--app-surface);
}

.pipeline-column-name {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--app-text);
}

.pipeline-column-meta {
  font-size: .75rem;
  color: var(--app-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: .1rem;
}

.pipeline-dropzone {
  padding: .5rem;
  min-height: 110px;
  overflow-y: auto;
  flex: 1 1 auto;
  transition: background-color .12s ease;
}

.pipeline-dropzone.drop-target {
  background: var(--app-accent-soft);
  outline: 2px dashed var(--app-accent);
  outline-offset: -4px;
}

.deal-card {
  position: relative;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: .6rem .7rem;
  margin-bottom: .5rem;
  cursor: grab;
}

.deal-card:hover {
  border-color: var(--app-border-strong);
}

.deal-card.dragging {
  opacity: .45;
  cursor: grabbing;
}

.deal-card-name {
  font-size: .8125rem;
  font-weight: 550;
  color: var(--app-text);
  display: block;
}

.deal-card-account {
  font-size: .75rem;
  color: var(--app-text-muted);
}

.deal-card-amount {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Charts

   Column charts are absolutely-positioned divs rather than SVG: the bars need
   to reflow with the card, and percentage-positioned slots do that for free
   where an SVG viewBox would need a redraw. Marks stay thin, the baseline is
   the only axis rule, and data-ends are rounded 4px away from the baseline.
   ========================================================================== */

/* The plot carries the fixed height, not the wrapper. Putting it on .chart made the
   axis labels overflow the box and the legend rendered on top of them. */
.chart {
  position: relative;
  margin-top: .25rem;
}

.chart-plot {
  position: relative;
  height: var(--chart-h, 190px);
  border-bottom: 1px solid var(--app-border-strong);
}

.chart-slot {
  position: absolute;
  bottom: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* A hit target wider than the marks — hovering the gap still reads the month. */
.chart-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--app-radius-sm);
}

.chart-slot:hover::before { background: var(--app-surface-sunk); }

.chart-bars {
  display: flex;
  align-items: flex-end;
  height: 100%;
  width: 74%;
  justify-content: center;
}

.chart-bar {
  flex: 1 1 0;
  min-height: 2px;
  max-width: 22px;
  border-radius: 4px 4px 0 0;   /* rounded away from the baseline only */
}

.chart-axis {
  position: relative;
  height: 1.1rem;
  margin-top: .4rem;
}

.chart-axis span {
  position: absolute;
  text-align: center;
  font-size: .6875rem;
  color: var(--app-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
  font-size: .75rem;
  color: var(--app-text-soft);
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: .35rem;
  vertical-align: -1px;
}

/* Shared hover tooltip, driven by any element carrying data-tip. */
.chart-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--app-text);
  color: #fff;
  font-size: .75rem;
  padding: .35rem .55rem;
  border-radius: var(--app-radius-sm);
  box-shadow: var(--app-shadow);
  max-width: 280px;
  opacity: 0;
  transition: opacity .1s ease;
}

.chart-tooltip.visible { opacity: 1; }

/* ==========================================================================
   Dashboard stage bars
   ========================================================================== */

.stage-bar {
  height: .4rem;
  border-radius: 999px;
  background: var(--app-surface-sunk);
  overflow: hidden;
}

.stage-bar > span {
  display: block;
  height: 100%;
  background: var(--app-accent);
  border-radius: 999px;
}
