.section-card {
  background: var(--bs-body-bg);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Transaction History's own tab already gives it the full page, so this no
   longer caps height/scrolls internally (it used to, back when this table
   sat stacked among several other sections on one long page) - just keeps
   the header visible while scrolling a long list. */
.table-sticky-header thead th {
  position: sticky;
  top: 0;
  background: var(--bs-body-bg);
  z-index: 1;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.alloc-bar-track {
  width: 4.5rem;
  height: 0.35rem;
  background: var(--bs-secondary-bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.alloc-bar-fill {
  background: #0d6efd;
  height: 100%;
}

.table > :not(caption) > * > * {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Every table here sets its own <colgroup> widths; without this, browsers
   use table-layout: auto and treat those widths as mere hints, resizing
   columns based on cell content instead (badge-only columns end up with
   dead space, text-heavy columns get squeezed regardless of what's set). */
.table {
  table-layout: fixed;
}

.table td {
  overflow-wrap: break-word;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}

.sortable-th:hover {
  text-decoration: underline;
}

.upload-zone {
  border: 2px dashed var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  background: var(--bs-body-bg);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
}

#upload-panel > summary {
  cursor: pointer;
}

/* Compact info icon with a JS-positioned tooltip (see infoIcon() in app.js)
   instead of a CSS-only :hover tooltip - position: fixed, placed via
   getBoundingClientRect() on hover/focus. A table cell's tooltip escaping
   its row (e.g. the table's last row, with nowhere below to overflow into)
   made .table-responsive's overflow-x: auto compute overflow-y to auto too
   (a CSS quirk: an ancestor can't be "scroll in x, visible in y" - the
   visible axis is forced to auto), so it grew a real scrollbar instead of
   just visually overflowing. Fixed positioning escapes all ancestor
   overflow/clipping entirely, and the JS clamps it to the viewport besides. */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #997404;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.info-icon-tooltip {
  display: none;
  position: fixed;
  background: #212529;
  color: #fff;
  padding: 0.5rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: normal;
  white-space: pre-line;
  width: max-content;
  max-width: 280px;
  text-align: left;
  z-index: 1050;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.info-icon-tooltip.visible {
  display: block;
}

#investment-chart svg line {
  stroke: var(--bs-border-color);
}

/* Bootstrap's contextual .table-light doesn't adapt to data-bs-theme="dark",
   so the Yearly Breakdown's month rows need their own theme-aware shade. */
.month-row {
  background: var(--bs-secondary-bg);
}
