@layer components {
  /* Period Selector — sits at top of content area */
  .insights-period-selector {
    display: flex;
    gap: 8px;
    padding: 0 var(--content-padding) 8px;
  }

  .insights-period-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: var(--text-caption);
    font-weight: 500;
    color: var(--color-muted);
    text-decoration: none;
    background: var(--color-bg-secondary);
    transition: background 0.15s, color 0.15s;

    &.active {
      background: var(--color-primary);
      color: white;
    }
  }

  /* Sections */
  .insights-revenue,
  .insights-utilization-section,
  .insights-customers-section,
  .insights-booking-section {
    padding: 0 var(--content-padding);
  }

  /* Revenue Big Number */
  .insights-big-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
  }

  /* Comparison Badge */
  .insights-comparison {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: var(--text-caption);
    color: var(--color-muted);
  }

  /* Change Indicators */
  .insights-change {
    font-size: var(--text-caption);
    font-weight: 600;

    &.change-positive {
      color: var(--color-accent-green);
    }

    &.change-negative {
      color: var(--color-accent-red);
    }

    &.change-neutral {
      color: var(--color-muted);
    }
  }

  /* Sub-metrics — row layout */
  .insights-sub-metrics {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 16px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .insights-sub-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;

    &:not(:last-child) {
      border-bottom: 1px solid var(--color-border);
    }

    .label {
      font-size: var(--text-caption);
      color: var(--color-muted);
    }

    .value {
      font-size: var(--text-caption);
      font-weight: 600;
      color: var(--color-text);
    }
  }

  /* Outstanding Alert */
  .insights-outstanding {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--color-accent-amber-light);
    border-radius: var(--radius-md);
    font-size: var(--text-caption);
    color: var(--color-accent-amber-dark);
    text-decoration: none;

    svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }
  }

  /* Progress Bar (Utilization) */
  .insights-progress-bar {
    height: 10px;
    background: var(--color-bg-secondary);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 12px;
  }

  .insights-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 5px;
    transition: width 0.4s ease;
  }

  .insights-utilization-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
  }

  .insights-utilization-detail {
    font-size: var(--text-caption);
    color: var(--color-muted);
    margin-top: 6px;
  }

  /* Weak Days Info */
  .insights-weak-days {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-caption);
    color: var(--color-muted);

    svg {
      width: 14px;
      height: 14px;
      vertical-align: -2px;
      margin-right: 4px;
    }
  }

  /* Customer Total */
  .insights-customer-total {
    margin-top: 12px;
    text-align: center;
    font-size: var(--text-caption);
    color: var(--color-muted);
  }

  /* At Risk Row */
  .insights-at-risk {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-caption);
    color: var(--color-accent-amber-dark);
    text-decoration: none;

    svg {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
    }

    .arrow {
      margin-left: auto;
      color: var(--color-muted);
    }
  }

  /* Conversion Rate */
  .insights-conversion {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;

    .value {
      font-size: 18px;
      font-weight: 600;
      color: var(--color-text);
    }
  }

  /* Section labels within insights — parent handles horizontal padding */
  .insights-utilization-section,
  .insights-customers-section,
  .insights-booking-section {
    .page-section-label {
      padding: 0;
    }
  }

  /* Money visibility toggle */
  .money-hidden {
    .money-value { display: none; }
    .money-mask { display: block !important; }
  }

  .money-mask {
    color: var(--color-muted);
  }
}
