/* Polished cashflow chart and connect-page removal. */
#connectPanel {
  display: none !important;
}

body:has(#connectPanel:not(.hidden)) #businessProfileView {
  display: block !important;
}

body:has(#connectPanel:not(.hidden)) #pageTitle {
  visibility: hidden;
  position: relative;
}

body:has(#connectPanel:not(.hidden)) #pageTitle::after {
  content: 'Настройки аккаунта';
  visibility: visible;
  position: absolute;
  left: 0;
  top: 0;
}

body:has(#connectPanel:not(.hidden)) #pageSubtitle {
  visibility: hidden;
  position: relative;
}

body:has(#connectPanel:not(.hidden)) #pageSubtitle::after {
  content: 'Подключение маркетплейсов и параметры бизнеса';
  visibility: visible;
  position: absolute;
  left: 0;
  top: 0;
}

.chart-panel {
  overflow: hidden;
}

.chart-panel .chart-header {
  align-items: flex-start;
  gap: 24px;
}

.cashflow-legend-v2 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.cashflow-legend-v2 > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cashflow-legend-v2 p {
  margin: 0;
  display: grid;
  gap: 1px;
}

.cashflow-legend-v2 small {
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.2;
}

.cashflow-legend-v2 strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(15, 111, 78, .07);
}

.legend-swatch.ordered {
  background: #7bd3ad;
}

.legend-swatch.paid {
  background: #0b6b4b;
}

.cashflow-legend-v2 .legend-pending {
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 10px;
  background: rgba(248, 250, 252, .8);
}

.cashflow-chart-v2 {
  position: relative;
  min-height: 300px;
  padding-top: 8px;
}

.cashflow-chart-v2 svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.cashflow-grid {
  stroke: rgba(148, 163, 184, .18);
  stroke-width: 1;
}

.cashflow-axis-label {
  fill: #94a3b8;
  font-size: 10px;
  font-weight: 500;
}

.cashflow-x-label {
  font-size: 10px;
}

.cashflow-area {
  pointer-events: none;
}

.ordered-area {
  fill: url(#orderedAreaGradientV2);
}

.paid-area {
  fill: url(#paidAreaGradientV2);
}

.cashflow-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.ordered-line {
  stroke: #7bd3ad;
  stroke-width: 3;
}

.paid-line {
  stroke: #0b6b4b;
  stroke-width: 3.6;
}

.cashflow-crosshair {
  stroke: rgba(15, 23, 42, .18);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.cashflow-hover-point {
  fill: #fff;
  stroke-width: 3;
}

.ordered-point {
  stroke: #7bd3ad;
}

.paid-point {
  stroke: #0b6b4b;
}

.cashflow-hit-area {
  cursor: crosshair;
}

.cashflow-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 188px;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  background: rgba(15, 23, 42, .94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .2);
  color: #fff;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.cashflow-tooltip[hidden] {
  display: none;
}

.cashflow-tooltip > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}

.cashflow-tooltip > span {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: rgba(255, 255, 255, .75);
  font-size: 11px;
}

.cashflow-tooltip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cashflow-tooltip i.ordered {
  background: #7bd3ad;
}

.cashflow-tooltip i.paid {
  background: #0f9f70;
}

.cashflow-tooltip b {
  color: #fff;
  font-weight: 700;
}

.chart-empty-v2 {
  min-height: 250px;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
}

.chart-empty-v2 strong {
  color: var(--ink);
  font-size: 14px;
}

.chart-empty-v2 span {
  color: var(--ink-muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .chart-panel .chart-header {
    display: grid;
    gap: 14px;
  }
  .cashflow-legend-v2 {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .cashflow-legend-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .cashflow-legend-v2 .legend-pending {
    grid-column: 1 / -1;
  }
  .cashflow-chart-v2 {
    min-height: 250px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .cashflow-chart-v2 svg {
    min-width: 700px;
  }
}
