:root {
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --border: #e2e4e9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error: #dc2626;
  --investment: #2563eb;
  --cash: #16a34a;
  --total: #7c3aed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card-bg: #1c1f26;
    --text: #e8eaed;
    --text-muted: #9aa0aa;
    --border: #2c303a;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page__header {
  margin-bottom: 1.5rem;
}

.page__header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.page__subtitle {
  margin: 0;
  color: var(--text-muted);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form__field label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form__field input {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.form__field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Hide the native up/down steppers — incrementing by 1 is not a useful way to edit money/rate inputs */
.form__field input[type="number"] {
  -moz-appearance: textfield;
}

.form__field input[type="number"]::-webkit-outer-spin-button,
.form__field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form__submit {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
}

.form__submit:hover {
  background: var(--accent-hover);
}

.error {
  color: var(--error);
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.summary__highlight {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.summary__highlight .label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.summary__highlight .value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
}

.summary__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.summary__row + .summary__row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.summary__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary__item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary__item .value {
  font-size: 1.25rem;
  font-weight: 600;
}

.chart-card {
  height: 380px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: right;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th:first-child, td:first-child {
  text-align: left;
}

thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

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