/* ---------------------------------------------------------------
 * The Finanzen screen's own layout — the open items side by side, the month bars, the meter, the
 * Kennzahlen. Everything else is the kit's; load this after its index.css.
 * --------------------------------------------------------------- */

/* One column that may shrink: a grid item's min-width is its content, and the UVA table would push
   the whole screen past a phone's edge instead of scrolling inside `.table-scroll`. */
.fin-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.fin-head,
.fin-head-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}
.fin-head-acts .field {
  margin: 0;
}
.fin-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.fin-badge {
  margin-left: 0.4rem;
}
.fin-sum {
  margin: 0.75rem 0 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* What is owed each way: two boxes, one under the other on a phone. */
.fin-open {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.fin-open-box {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius, 0.5rem);
}
.fin-open-label {
  color: var(--muted);
  font-size: 0.8rem;
}
.fin-open-total {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

/* Twelve months, two bars each. Decoration: the table below carries the numbers. */
.fin-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.35rem;
  height: 9rem;
  margin: 0.5rem 0 0.25rem;
  overflow-x: auto;
}
.fin-bar-month {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 1.6rem;
}
.fin-bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.fin-bar {
  display: block;
  width: 40%;
  min-height: 1px;
  border-radius: 2px 2px 0 0;
}
.fin-bar.in,
.fin-swatch.in {
  background: var(--accent, #2563eb);
}
.fin-bar.out,
.fin-swatch.out {
  background: var(--muted, #94a3b8);
}
.fin-bar-label {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}
.fin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}
.fin-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.fin-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}

.fin-meter {
  height: 0.6rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.fin-meter span {
  display: block;
  height: 100%;
  background: var(--accent, #2563eb);
}
.fin-meter.warn span {
  background: var(--warn, #d97706);
}
.fin-meter.bad span {
  background: var(--bad, #dc2626);
}

.fin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fin-filter .btn[aria-pressed="true"] {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}
.fin-tax {
  display: block;
  font-size: 0.75rem;
}
.fin-kz {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}
.fin-kz dt {
  font-weight: 600;
  white-space: nowrap;
}
.fin-kz dd {
  margin: 0;
  color: var(--muted);
}
.fin-period-quarter td,
.fin-period-year td {
  font-weight: 700;
}
