@import url("./income_statement_results.css?v=20260604-2");

.income-statement .income-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.income-tree {
  display: grid;
  gap: 6px;
  padding: 18px 20px 22px;
}

.tree-section {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 900;
}

.tree-section.revenue { color: #166534; background: #dcfce7; }
.tree-section.cogs { color: #9a3412; background: #ffedd5; }
.tree-section.expense { color: #991b1b; background: #fee2e2; }

.tree-node,
.tree-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  background: #f8fbff;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 14px;
}

.tree-node .label {
  color: #0f172a;
  background: transparent;
  border: 0;
  font-weight: 800;
  text-align: start;
}

.tree-node .label.has-children::before {
  content: "▸";
  display: inline-block;
  margin-inline-end: 8px;
  transition: transform .15s ease;
}

.tree-node .label.open::before {
  transform: rotate(90deg);
}

.tree-node .amount,
.tree-result span:last-child {
  color: #0f172a;
  font-weight: 900;
  white-space: nowrap;
}

.children {
  display: grid;
  gap: 6px;
  margin-inline-start: 24px;
  padding-inline-start: 16px;
  border-inline-start: 2px dashed #cbd5e1;
}

.children[hidden] {
  display: none;
}

.tree-result {
  margin-top: 8px;
  color: #fff;
  background: #132144;
  font-weight: 900;
}

.tree-result span,
.tree-result span:last-child {
  color: #fff;
}

.tree-result.negative {
  background: #991b1b;
}

.income-empty.compact {
  margin: 0;
  padding: 12px;
}

@media (max-width: 1100px) {
  .income-statement .income-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .income-statement .income-kpis {
    grid-template-columns: 1fr;
  }
  .children {
    margin-inline-start: 10px;
    padding-inline-start: 10px;
  }
}
