/* Same visual family as transactions.css (base, buttons, tiles, footer) - a
   near-copy rather than a shared sheet, for the reason transactions.css's own
   header gives. Only the account cards and yearly table below are new. */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 16px 40px;
  color: #1b1b1b;
  font-size: 14px;
}

h1 {
  font-size: 18px;
  margin-bottom: 4px;
}

h2 {
  font-size: 16px;
  margin: 0;
}

a {
  color: #6b2c81;
}

.intro {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin-top: 0;
}

.status {
  font-size: 12px;
  color: #6b2c81;
  min-height: 18px;
  margin: 12px 0;
}

.status-error {
  color: #eb5757;
}

.muted {
  font-size: 12px;
  color: #888;
}

.hidden {
  display: none !important;
}

button {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #6b2c81;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #582269;
}

button:disabled {
  background: #ccc;
  cursor: default;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: #6b2c81;
  font-weight: 500;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover:not(:disabled) {
  background: none;
  color: #582269;
}

input,
select {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button.secondary {
  background: #f2f2f2;
  color: #444;
}

button.secondary:hover:not(:disabled) {
  background: #e6e6e6;
}

/* Status on the left, Export on the right; stacks on a narrow screen. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* --- filters ------------------------------------------------------------------ */

/* Label above its control, fields side by side; wraps to rows on a phone. */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  padding: 10px 12px;
  margin: 4px 0 12px;
  background: #faf7fb;
  border-radius: 8px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.filter select {
  max-width: 100%;
}

.filter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 700;
}

.filter-summary {
  padding-bottom: 6px;
}

/* --- tiles (same as the Transactions page's totals) ----------------------- */

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 150px;
  padding: 8px 12px;
  background: #faf7fb;
  border-radius: 8px;
}

/* The investment return leads: it's the answer to "how is my super doing",
   with contributions and costs as the explanation beside it. */
.tile.tile-lead {
  background: #f1e7f5;
  flex-basis: 220px;
}

.tile-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 700;
}

.tile-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tile.tile-lead .tile-value {
  font-size: 20px;
}

.tile-sub {
  font-size: 12px;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: #1e8e3e;
}

.negative {
  color: #eb5757;
}

/* --- account cards ---------------------------------------------------------- */

.combined,
.super-card {
  padding: 14px 0;
  border-top: 1px solid #eee;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.card-balance {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stale {
  color: #c77700;
  font-weight: 600;
}

.period-note {
  font-size: 12px;
  color: #666;
  margin: 4px 0 0;
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: #f2f2f2;
  color: #666;
  vertical-align: 1px;
}

.hint {
  font-size: 13px;
  color: #555;
  background: #fff8e6;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0 6px;
}

/* --- yearly table ----------------------------------------------------------- */

/* Scrolls sideways on its own on a phone, rather than pushing the page wider
   than the screen. */
.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 6px 8px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #f0f0f0;
  font-variant-numeric: tabular-nums;
}

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

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  font-weight: 700;
}

tr.current-year td:first-child {
  font-weight: 700;
}

td.na {
  color: #bbb;
}

/* --- table / chart switch ------------------------------------------------------ */

.view-toggle {
  display: inline-flex;
  margin: 12px 0 4px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle-btn {
  background: #fff;
  color: #444;
  border-radius: 0;
  padding: 5px 14px;
  font-weight: 600;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid #ddd;
}

.view-toggle-btn:hover:not(:disabled) {
  background: #f6f0f8;
}

.view-toggle-btn[aria-pressed="true"],
.view-toggle-btn[aria-pressed="true"]:hover {
  background: #6b2c81;
  color: #fff;
}

/* --- charts ------------------------------------------------------------------ */

.chart-view {
  margin-top: 6px;
}

.chart-title {
  font-size: 13px;
  margin: 14px 0 2px;
}

.chart-caption {
  font-size: 12px;
  color: #52514e;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
}

.chart-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Legend key for the projection: the same dotted line + hollow marker as
   the chart draws. */
.chart-swatch-projection {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px dotted #2a78d6;
  vertical-align: middle;
  position: relative;
}

.chart-swatch-projection::after {
  content: "";
  position: absolute;
  left: 5px;
  top: -6px;
  width: 6px;
  height: 6px;
  border: 2px solid #2a78d6;
  border-radius: 50%;
  background: #fff;
}

.projection-note {
  font-size: 12px;
  line-height: 1.6;
  color: #52514e;
  margin: 8px 0 4px;
}

.projection-note p {
  margin: 0 0 2px;
}

.projection-note strong {
  color: #1b1b1b;
  font-size: 13px;
}

.contribution-changes ul {
  list-style: none;
  padding: 0;
  margin: 4px 0;
}

.contribution-changes li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.contribution-changes select {
  padding: 2px 6px;
  font-size: 12px;
}

.projection-input {
  width: 90px;
  padding: 2px 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* The tooltip positions against this box, so it stays with its chart. */
.chart-frame {
  position: relative;
}

.chart-host {
  width: 100%;
}

.chart-tick {
  font-variant-numeric: tabular-nums;
}

.chart-hit {
  cursor: default;
  outline: none;
}

.chart-hit:focus-visible {
  outline: 2px solid #6b2c81;
  outline-offset: -2px;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid rgba(11, 11, 11, 0.1);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.chart-tooltip strong {
  font-size: 14px;
  color: #0b0b0b;
}

.chart-tooltip span {
  color: #52514e;
}

/* --- statement balances ------------------------------------------------------ */

.statement-details {
  margin-top: 10px;
  font-size: 13px;
}

.statement-details summary,
.tracked-details summary {
  cursor: pointer;
  color: #6b2c81;
  font-weight: 600;
  font-size: 13px;
}

.statement-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.statement-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 2px 0;
}

.statement-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.statement-form input {
  width: 150px;
}

.statement-error {
  color: #eb5757;
  font-size: 12px;
}

.statement-details h4 {
  font-size: 13px;
  margin: 16px 0 2px;
}

/* One labelled number per cell; wraps to two columns on a phone. */
.statement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.statement-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #666;
}

.statement-grid input,
.statement-grid select {
  width: 100%;
}

.statement-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.statement-check {
  font-size: 12px;
  font-weight: 600;
}

.annualised {
  font-size: 13px;
  margin: 12px 0 0;
}

.tracked-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.tracked-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tracked-options label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.tracked-options input {
  accent-color: #6b2c81;
}

.page-footer {
  margin-top: 24px;
  text-align: right;
}

.page-footer a {
  margin-left: 12px;
  font-size: 13px;
}
