/* Flujo de efectivo de Inicio — visualización premium exclusiva de escritorio. */
@media (min-width: 769px) {
  #overview-view #widget-cashflow {
    --cashflow-positive: #25e397;
    --cashflow-positive-bright: #70ffc2;
    --cashflow-negative: #f4ad3f;
    --cashflow-negative-bright: #ffd47d;
    isolation: isolate;
    overflow: hidden;
    border-color: var(--v2-glass-edge);
    background:
      linear-gradient(165deg, rgba(255, 255, 255, 0.07), transparent 60%),
      rgba(20, 24, 21, 0.66);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.09),
      inset 0 0 0 1px rgba(0, 0, 0, 0.16),
      0 1px 2px rgba(0, 0, 0, 0.3),
      0 20px 48px -26px rgba(0, 0, 0, 0.7),
      0 32px 64px -30px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(34px) saturate(160%);
    -webkit-backdrop-filter: blur(34px) saturate(160%);
  }

  #overview-view #widget-cashflow::before {
    position: absolute;
    z-index: 1;
    border-radius: inherit;
    background: radial-gradient(130% 90% at 18% -20%, rgba(255, 255, 255, 0.09), transparent 55%);
    content: '';
    filter: none;
    inset: 0;
    opacity: 1;
    pointer-events: none;
  }

  #overview-view #widget-cashflow.is-trend-down::before {
    background: radial-gradient(130% 90% at 18% -20%, rgba(255, 255, 255, 0.09), transparent 55%);
  }

  #overview-view.is-entering #widget-cashflow {
    animation: mv7-cashflow-panel-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
  }

  #overview-view #widget-cashflow .mv7-panel-header {
    min-height: 104px;
    border-color: rgba(255, 255, 255, 0.065);
    background: transparent;
  }

  #overview-view #widget-cashflow .mv7-panel-header h3 {
    letter-spacing: -0.015em;
  }

  #overview-view #widget-cashflow .mv7-legend {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  #overview-view #widget-cashflow .mv7-cashflow-header-tools {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
  }

  #overview-view #widget-cashflow .mv7-cashflow-view-control {
    display: inline-flex;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  }

  #overview-view #widget-cashflow .mv7-cashflow-view-control button {
    min-width: 72px;
    height: 26px;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--v2-muted);
    font: inherit;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
    transition:
      background 160ms ease,
      box-shadow 160ms ease,
      color 160ms ease;
  }

  #overview-view #widget-cashflow .mv7-cashflow-view-control button:hover {
    color: var(--v2-text);
  }

  #overview-view #widget-cashflow .mv7-cashflow-view-control button.is-active {
    background: rgba(255, 255, 255, 0.11);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.12),
      0 4px 12px -8px rgba(0, 0, 0, 0.8);
    color: var(--v2-text);
  }

  #overview-view #widget-cashflow .mv7-cashflow-view-control button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--cashflow-positive) 70%, white);
    outline-offset: 2px;
  }

  #overview-view #widget-cashflow .mv7-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  #overview-view #widget-cashflow .mv7-legend i {
    width: 7px;
    height: 7px;
    background: var(--cashflow-positive);
    box-shadow: 0 0 10px color-mix(in srgb, var(--cashflow-positive) 75%, transparent);
  }

  #overview-view #widget-cashflow .mv7-legend .is-down i {
    background: var(--cashflow-negative);
    box-shadow: 0 0 10px color-mix(in srgb, var(--cashflow-negative) 72%, transparent);
  }

  #overview-view #widget-cashflow .mv7-legend .is-flat i {
    background: rgba(188, 199, 194, 0.58);
    box-shadow: none;
  }

  #overview-view #widget-cashflow .mv7-chart-wrap {
    overflow: hidden;
    margin: 14px 14px 12px;
    padding: 24px 20px 11px 62px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background:
      radial-gradient(circle at 12% 18%, rgba(37, 227, 151, 0.07), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.025) 54%),
      rgba(9, 14, 11, 0.22);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.13),
      inset 0 -30px 60px rgba(0, 0, 0, 0.08),
      0 12px 30px -24px rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
  }

  #overview-view #widget-cashflow .mv7-main-chart {
    height: 258px;
    overflow: visible;
  }

  #overview-view #widget-cashflow .mv7-chart-candles {
    pointer-events: auto;
  }

  #overview-view #widget-cashflow .mv7-candle {
    cursor: default;
    outline: none;
  }

  #overview-view #widget-cashflow .mv7-candle-hitbox {
    fill: transparent;
    pointer-events: all;
  }

  #overview-view #widget-cashflow .mv7-candle:focus-visible .mv7-candle-body {
    stroke: #fff;
    stroke-width: 2;
  }

  #overview-view #widget-cashflow .mv7-grid-lines path {
    stroke: rgba(157, 174, 192, 0.105);
    stroke-dasharray: 5 8;
    stroke-width: 1;
  }

  #overview-view #widget-cashflow .mv7-chart-area {
    opacity: 0.4;
  }

  #overview-view #widget-cashflow #chart-area stop {
    stop-color: var(--cashflow-positive);
  }

  #overview-view #widget-cashflow.is-trend-down #chart-area stop {
    stop-color: var(--cashflow-negative);
  }

  #overview-view #widget-cashflow .mv7-candle-wick {
    stroke-width: 2;
    opacity: 0.98;
    filter: drop-shadow(0 0 3px currentColor);
  }

  #overview-view #widget-cashflow .mv7-candle {
    transform-box: fill-box;
    animation: mv7-cashflow-candle-enter 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--cashflow-candle-index, 0) * 32ms + 80ms);
  }

  #overview-view #widget-cashflow .mv7-candle-body {
    stroke-width: 1;
    opacity: 1;
  }

  #overview-view #widget-cashflow .mv7-candle-wick.is-up {
    stroke: var(--cashflow-positive-bright);
    color: var(--cashflow-positive);
  }

  #overview-view #widget-cashflow .mv7-candle-body.is-up {
    fill: url('#cashflow-candle-up');
    stroke: var(--cashflow-positive-bright);
    filter: drop-shadow(0 0 5px rgba(37, 227, 151, 0.62));
  }

  #overview-view #widget-cashflow .mv7-candle-wick.is-down {
    stroke: var(--cashflow-negative-bright);
    color: var(--cashflow-negative);
  }

  #overview-view #widget-cashflow .mv7-candle-body.is-down {
    fill: url('#cashflow-candle-down');
    stroke: var(--cashflow-negative-bright);
    filter: drop-shadow(0 0 5px rgba(244, 173, 63, 0.6));
  }

  #overview-view #widget-cashflow .mv7-candle-wick.is-flat {
    stroke: rgba(210, 220, 215, 0.78);
    stroke-linecap: round;
    stroke-width: 1.6;
    filter: none;
  }

  #overview-view #widget-cashflow .mv7-candle-body.is-flat {
    fill: rgba(210, 220, 215, 0.82);
    stroke: rgba(238, 243, 240, 0.72);
    filter: none;
  }

  #overview-view #widget-cashflow.is-trend-down .mv7-candle-body.is-up,
  #overview-view #widget-cashflow.is-trend-down .mv7-candle-wick.is-up {
    opacity: 0.76;
  }

  #overview-view #widget-cashflow .mv7-chart-line {
    stroke: var(--cashflow-positive-bright);
    stroke-width: 3;
    opacity: 0.94;
    filter:
      drop-shadow(0 0 4px rgba(37, 227, 151, 0.9))
      drop-shadow(0 0 12px rgba(37, 227, 151, 0.3));
  }

  #overview-view #widget-cashflow.is-trend-down .mv7-chart-line {
    stroke: var(--cashflow-negative-bright);
    filter:
      drop-shadow(0 0 4px rgba(244, 173, 63, 0.9))
      drop-shadow(0 0 12px rgba(244, 173, 63, 0.3));
  }

  #overview-view #widget-cashflow .mv7-chart-flow {
    display: block;
    stroke: var(--cashflow-positive-bright);
    stroke-width: 2;
    stroke-dasharray: 3 32;
    opacity: 0.72;
    filter: drop-shadow(0 0 5px rgba(37, 227, 151, 0.72));
    animation: mv7-cashflow-travel 2.1s linear infinite;
  }

  #overview-view #widget-cashflow.is-trend-down .mv7-chart-flow {
    stroke: var(--cashflow-negative-bright);
    filter: drop-shadow(0 0 5px rgba(244, 173, 63, 0.72));
    animation-direction: reverse;
  }

  #overview-view #widget-cashflow .mv7-chart-point circle:first-child {
    fill: color-mix(in srgb, var(--cashflow-positive) 22%, transparent);
    stroke: color-mix(in srgb, var(--cashflow-positive) 38%, transparent);
    stroke-width: 1;
  }

  #overview-view #widget-cashflow .mv7-chart-point circle:last-child {
    fill: var(--cashflow-positive-bright);
    stroke: #08100c;
    stroke-width: 2;
    filter: drop-shadow(0 0 6px var(--cashflow-positive));
  }

  #overview-view #widget-cashflow.is-trend-down .mv7-chart-point circle:first-child {
    fill: color-mix(in srgb, var(--cashflow-negative) 23%, transparent);
    stroke: color-mix(in srgb, var(--cashflow-negative) 38%, transparent);
  }

  #overview-view #widget-cashflow.is-trend-down .mv7-chart-point circle:last-child {
    fill: var(--cashflow-negative-bright);
    filter: drop-shadow(0 0 6px var(--cashflow-negative));
  }

  #overview-view #widget-cashflow .mv7-chart-axis {
    width: 48px;
    height: 218px;
    top: 34px;
    left: 9px;
    color: rgba(187, 198, 211, 0.58);
    font-size: 10px;
  }

  #overview-view #widget-cashflow .mv7-chart-footer {
    padding-top: 8px;
    color: rgba(187, 198, 211, 0.58);
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip {
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 50%;
    display: grid;
    width: 214px;
    gap: 7px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025)),
      rgba(10, 15, 12, 0.76);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.12),
      0 18px 36px -20px rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    pointer-events: none;
    transform: translateX(-50%);
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip[hidden] {
    display: none;
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip-period {
    padding-bottom: 3px;
    color: var(--v2-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--v2-muted);
    font-size: 11px;
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip strong {
    color: var(--v2-text);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip strong.is-income {
    color: var(--cashflow-positive-bright);
  }

  #overview-view #widget-cashflow .mv7-cashflow-tooltip strong.is-expense {
    color: var(--cashflow-negative-bright);
  }

  #overview-view #widget-cashflow .mv7-panel-stats {
    border-top-color: rgba(255, 255, 255, 0.065);
    background: rgba(255, 255, 255, 0.012);
  }

  #overview-view #widget-cashflow .mv7-panel-stats strong {
    font-variant-numeric: tabular-nums;
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow {
    border-color: var(--v2-line);
    background:
      linear-gradient(165deg, rgba(255, 255, 255, 0.82), transparent 60%),
      rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 42px rgba(33, 49, 66, 0.08);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow::before,
  :root[data-resolved-theme='light'] #overview-view #widget-cashflow.is-trend-down::before {
    background: radial-gradient(130% 90% at 18% -20%, rgba(255, 255, 255, 0.75), transparent 55%);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-panel-header,
  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-panel-stats {
    border-color: rgba(29, 44, 58, 0.08);
    background: rgba(246, 249, 248, 0.42);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-chart-wrap {
    border-color: rgba(255, 255, 255, 0.78);
    background:
      radial-gradient(circle at 12% 18%, rgba(24, 180, 118, 0.075), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24) 56%),
      rgba(238, 246, 242, 0.2);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.96),
      inset 0 -26px 54px rgba(35, 54, 48, 0.018),
      0 12px 30px -24px rgba(35, 54, 48, 0.22);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-grid-lines path {
    stroke: rgba(29, 44, 58, 0.1);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-chart-axis,
  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-chart-footer {
    color: rgba(57, 72, 86, 0.62);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-candle-body.is-flat {
    fill: rgba(72, 89, 81, 0.68);
    stroke: rgba(48, 64, 57, 0.64);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-cashflow-view-control {
    border-color: rgba(29, 44, 58, 0.12);
    background: rgba(29, 44, 58, 0.035);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.85);
  }

  :root[data-resolved-theme='light']
    #overview-view
    #widget-cashflow
    .mv7-cashflow-view-control
    button.is-active {
    background: rgba(255, 255, 255, 0.84);
    box-shadow:
      inset 0 1px #fff,
      0 4px 12px -8px rgba(35, 54, 48, 0.28);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-candle-wick.is-flat {
    stroke: rgba(57, 75, 66, 0.66);
  }

  :root[data-resolved-theme='light'] #overview-view #widget-cashflow .mv7-cashflow-tooltip {
    border-color: rgba(255, 255, 255, 0.86);
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.4)),
      rgba(239, 246, 243, 0.72);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.98),
      0 18px 36px -22px rgba(35, 54, 48, 0.28);
  }

  @keyframes mv7-cashflow-candle-enter {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes mv7-cashflow-panel-enter {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes mv7-cashflow-travel {
    to {
      stroke-dashoffset: -35;
    }
  }
}

@media (min-width: 769px) and (prefers-reduced-motion: reduce) {
  #overview-view #widget-cashflow .mv7-candle {
    animation: none;
  }

  #overview-view #widget-cashflow .mv7-chart-flow {
    animation: none;
    opacity: 0;
  }
}

@media (min-width: 769px) {
  :root[data-animated-charts='false'] #overview-view #widget-cashflow .mv7-candle {
    animation: none;
  }

  :root[data-animated-charts='false'] #overview-view #widget-cashflow .mv7-chart-flow {
    animation: none;
    opacity: 0;
  }
}
