:root {
  color: #19261e;
  background: #f6f8f4;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.page {
  width: min(100% - 2rem, 44rem);
  margin: 4rem auto;
}

.page__header {
  margin-bottom: 2rem;
}

.page__header h1,
.page__header p {
  margin: 0;
}

.page__header h1 {
  margin: 0.25rem 0 0.5rem;
}

.eyebrow {
  color: #38714d;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid #d6ded4;
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 0.5rem 1.5rem rgb(25 38 30 / 8%);
}

.import-form,
.category-form {
  display: grid;
  gap: 1rem;
}

.import-form label,
.category-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

input[type="file"] {
  padding: 0.75rem;
  border: 1px dashed #8eaa96;
  border-radius: 0.5rem;
}

input,
select {
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid #b9c8bb;
  border-radius: 0.375rem;
  background: white;
  font: inherit;
}

button {
  justify-self: start;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: #237340;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-height: 1.5rem;
  margin: 0;
}

.status[data-state="error"] {
  color: #a21b1b;
}

.status[data-state="success"] {
  color: #176635;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  margin: 0;
}

.table-wrapper {
  overflow-x: auto;
}

.month-form {
  display: flex;
  align-items: end;
  gap: 1rem;
}

.month-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.sankey-form {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.sankey-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.sankey-chart {
  min-height: 2rem;
  margin-top: 1.5rem;
  overflow-x: auto;
}

.sankey-chart svg {
  display: block;
  min-width: 640px;
  font-size: 0.75rem;
}

.sankey-link {
  stroke-opacity: 0.4;
  mix-blend-mode: multiply;
}

.sankey-link:hover {
  stroke-opacity: 0.7;
}

.projection-form {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.projection-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.forecast-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
  gap: 1rem;
}

.forecast-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.forecast-form button {
  align-self: end;
}

.projection-total {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.projection-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
}

.projection-summary dt,
.projection-summary dd {
  margin: 0;
}

.scheduled-expenses,
.forecast-list {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}

.forecast-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forecast-list button {
  padding: 0.35rem 0.5rem;
  background: #9b2c2c;
}

.dashboard-total {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.category-tree__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
}

.category-tree details {
  display: grid;
  gap: 0.5rem;
}

.category-tree summary {
  cursor: pointer;
  font-weight: 600;
}

.category-tree button {
  margin-left: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e3e9e2;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #526358;
  font-size: 0.8rem;
  text-transform: uppercase;
}

@media (min-width: 48rem) {
  .page {
    width: min(100% - 4rem, 90rem);
  }

  .transactions-table {
    table-layout: fixed;
  }

  .transactions-table th:nth-child(1) {
    width: 6.5rem;
  }

  .transactions-table th:nth-child(3) {
    width: 7.5rem;
  }

  .transactions-table th:nth-child(4) {
    width: 7rem;
  }

  .transactions-table th:nth-child(5) {
    width: 14rem;
  }

  .transactions-table th:nth-child(6) {
    width: 8rem;
  }

  .transactions-table th:nth-child(2),
  .transactions-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .transactions-table select {
    width: 100%;
  }
}
