.reports-page {
  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;

    .header-text {
      h1 { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--color-text-primary); }
      p { margin: 0.25rem 0 0; color: var(--color-text-secondary); font-size: 0.8125rem; }
    }
  }

  .reports-card {
    background: var(--color-surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--color-surface-border);
    padding: 1.5rem;
  }
}

.report-filters {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--color-surface-muted);
  border-radius: 8px;
  flex-wrap: wrap;

  .filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;

    label { font-weight: 600; font-size: 0.8125rem; color: var(--color-text-secondary); }
  }
}

.report-content {
  .report-title {
    text-align: center;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-accent);
  }
}

.report-section {
  margin-bottom: 1.25rem;

  .section-title {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;

    &.assets { background: rgba(99, 102, 241, 0.08); color: var(--color-info); }
    &.liabilities { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); }
    &.equity { background: rgba(16, 185, 129, 0.08); color: var(--color-success); }
    &.revenue { background: rgba(16, 185, 129, 0.08); color: var(--color-success); }
    &.expenses { background: rgba(245, 158, 11, 0.08); color: var(--color-warning); }
  }

  .report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;

    tr {
      border-bottom: 1px solid var(--color-surface-hover);

      &.level-0 { font-weight: 600; background: var(--color-surface-muted); }
      &.level-1 { font-weight: 600; }

      &.total-row {
        border-top: 2px solid var(--color-surface-border);
        background: var(--color-surface-muted);

        td { padding: 0.5rem 0.75rem; }
      }
    }

    td {
      padding: 0.35rem 0.75rem;
      color: var(--color-text-primary);

      &.account-code {
        font-family: var(--font-mono);
        font-size: 0.8rem;
        color: var(--color-text-muted);
        width: 100px;
      }

      &.account-name { flex: 1; }

      &.amount {
        text-align: end;
        font-family: var(--font-mono);
        font-weight: 600;
        width: 150px;
      }
    }
  }
}

.net-income-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 1.1rem;
  margin-top: 1rem;

  &.positive { background: rgba(16, 185, 129, 0.08); color: var(--color-success); }
  &.negative { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); }

  strong {
    font-family: var(--font-mono);
    font-size: 1.2rem;
  }
}

.cash-summary {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;

  .cash-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-surface-muted);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-text-primary);

    strong { font-family: var(--font-mono); }
  }
}

.opening-balance-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-surface-muted);
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-primary);

  strong { font-family: var(--font-mono); }
}

.aging-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;

  .aging-card {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--color-surface-muted);
    border-radius: 8px;

    span { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 600; }
    strong { font-family: var(--font-mono); font-size: 0.9rem; color: var(--color-text-primary); }

    &.total {
      background: var(--color-accent-glow);
      strong { color: var(--color-accent-dark); }
    }
  }
}

.profit-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;

  .profit-card {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--color-surface-muted);

    span { font-size: 0.8125rem; color: var(--color-text-secondary); }
    strong { font-family: var(--font-mono); font-size: 1.2rem; color: var(--color-text-primary); }

    &.positive { background: rgba(16, 185, 129, 0.08); color: var(--color-success); strong { color: var(--color-success); } }
    &.negative { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); strong { color: var(--color-danger); } }
  }
}

.loading-state {
  display: flex; justify-content: center; padding: 2rem;
}

.table-card {
  background: var(--color-surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid var(--color-surface-border);

  .amount { text-align: end; font-family: var(--font-mono); }
  .mono { font-family: var(--font-mono); font-size: 0.8rem; }
  .text-center { text-align: center; }
  .positive-var { color: var(--color-success); }
  .negative-var { color: var(--color-danger); }
}

.entry-link {
  color: var(--color-brand, #4f46e5);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  &:hover { text-decoration: underline; }
}

.empty-report {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  gap: 1rem;
  color: var(--color-text-muted);

  i { font-size: 3rem; }
  p { font-size: 0.8125rem; }
}
