@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* =========================================================================
   Private Finanzen · Design Tokens
   Einzige Quelle für Farben, Typografie, Radien und Schatten.
   Synchron mit dem Claude-Design-Projekt "Private Finanzen" (styles.css).
   ========================================================================= */
:root {
  /* --- Flächen & Text --- */
  --color-bg: #f7f7f8;
  --color-surface: #ffffff;
  --color-surface-muted: #f2f2f7;
  --color-text: #1c1c1e;
  --color-text-secondary: #8e8e93;
  --color-text-tertiary: #48484a;
  --color-border: #e5e5ea;
  --color-border-strong: #d1d1d6;

  /* --- Akzent (Blau) --- */
  --color-accent: #1e4f8f;
  --color-accent-hover: #1a4680;
  --color-accent-active: #163c6f;
  --color-accent-soft: #eef2f8;
  --color-accent-soft-strong: #dbe4f1;
  --color-accent-border: #cdd9ec;
  --focus-ring-accent: rgba(30, 79, 143, 0.4);

  /* --- Status --- */
  --color-positive: #2f9e44;
  --color-negative: #b3261e;
  /* Dezente Wertfarben für Einnahmen/Ausgaben in Auswertungen */
  --color-income: #2f7d4f;
  --color-expense: #a8443c;
  --color-danger: #d33227;
  --color-warning: #f2c14e;
  --color-danger-border: #d9a09b;
  --color-danger-soft: #fbeceb;
  --color-danger-soft-strong: #f6dad8;
  --focus-ring-danger: rgba(179, 38, 30, 0.35);
  /* Weiche Statusflächen (für Meldungen) */
  --color-positive-soft: #e9f6ec;
  --color-positive-border: #b6e0c0;
  --color-positive-text: #1e6b30;
  --color-warning-soft: #fdf4dd;
  --color-warning-border: #f0dca0;
  --color-warning-text: #8a6d1a;

  /* --- Deaktiviert --- */
  --color-disabled-bg: #e5e5ea;
  --color-disabled-text: #a1a1a6;

  /* --- Typografie --- */
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  /* --- Radien --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* --- Schatten --- */
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-btn: 0 1px 2px rgba(30, 79, 143, 0.25);
  --shadow-btn-hover: 0 2px 6px rgba(30, 79, 143, 0.32);
  --shadow-btn-active: 0 1px 1px rgba(30, 79, 143, 0.25);

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  background: var(--color-bg);
  color: var(--color-text);
}

/* Formularelemente erben die App-Schrift nicht automatisch — ohne diese Regel
   rendern Datums- und Auswahlfelder in der System-Schrift. */
button,
input,
select,
textarea {
  font-family: inherit;
}

/* =========================================================================
   Kopfzeile
   ========================================================================= */
.app-header {
  padding: 1rem;
  background: var(--color-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.header-user button {
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  background: transparent;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

#app {
  padding: 1rem;
  width: 100%;
  margin: 0 auto;
}

/* =========================================================================
   Karte
   ========================================================================= */
.card {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card label {
  font-size: 0.9rem;
  font-weight: 500;
}

.card select,
.card input[type="file"] {
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  margin-bottom: 0.5rem;
}

/* =========================================================================
   Button-Komponente (.pf-btn) — kanonische, wiederverwendbare Variante
   ========================================================================= */
.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}

.pf-btn:focus-visible {
  outline: 3px solid var(--focus-ring-accent);
  outline-offset: 2px;
}

.pf-btn--sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.pf-btn--block {
  width: 100%;
}

/* Primär */
.pf-btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.pf-btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-btn-hover);
}

.pf-btn--primary:active {
  background: var(--color-accent-active);
  box-shadow: var(--shadow-btn-active);
  transform: translateY(1px);
}

/* Sekundär */
.pf-btn--secondary {
  background: var(--color-surface);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.pf-btn--secondary:hover {
  background: var(--color-accent-soft);
}

.pf-btn--secondary:active {
  background: var(--color-accent-soft-strong);
  transform: translateY(1px);
}

/* Destruktiv */
.pf-btn--danger {
  background: transparent;
  color: var(--color-negative);
  border-color: var(--color-danger-border);
}

.pf-btn--danger:hover {
  background: var(--color-danger-soft);
}

.pf-btn--danger:active {
  background: var(--color-danger-soft-strong);
  transform: translateY(1px);
}

.pf-btn--danger:focus-visible {
  outline-color: var(--focus-ring-danger);
}

/* Deaktiviert — für alle Varianten eindeutig inaktiv */
.pf-btn:disabled,
.pf-btn:disabled:hover {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.card button {
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}

.card button:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-btn-hover);
}

.card button:active {
  background: var(--color-accent-active);
  box-shadow: var(--shadow-btn-active);
  transform: translateY(1px);
}

.card button:focus-visible {
  outline: 3px solid var(--focus-ring-accent);
  outline-offset: 2px;
}

.card button:disabled,
.card button:disabled:hover {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  margin: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}

.secondary-button:hover {
  background: var(--color-accent-soft);
}

.secondary-button:active {
  background: var(--color-accent-soft-strong);
  transform: translateY(1px);
}

.secondary-button:focus-visible {
  outline: 3px solid var(--focus-ring-accent);
  outline-offset: 2px;
}

.secondary-button:disabled,
.secondary-button:disabled:hover {
  color: var(--color-disabled-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  cursor: not-allowed;
  transform: none;
}

/* =========================================================================
   Import-Vorschau
   ========================================================================= */
.import-summary {
  margin: 1rem 0 0.5rem;
  font-weight: 500;
}

.import-success {
  margin: 0.75rem 0 0;
  color: var(--color-accent);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.preview-table td:nth-child(3) {
  white-space: normal;
  min-width: 12rem;
}

.preview-table .num {
  text-align: right;
}

.preview-table tr.duplicate {
  color: var(--color-text-secondary);
  background: var(--color-surface-muted);
}

#import-preview button {
  width: 100%;
}

/* =========================================================================
   IST-Matrix
   ========================================================================= */
.ist-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.year-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.year-nav button {
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-border-strong);
}

.ist-controls select {
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.ist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ist-table th,
.ist-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.ist-table .num {
  text-align: right;
}

.ist-table .neg {
  color: var(--color-negative);
}

.ist-table .strong {
  font-weight: 600;
}

.ist-table .ist-name {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--color-surface);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ist-table tr.group-row {
  cursor: pointer;
  background: var(--color-surface-muted);
}

.ist-table tr.group-row .ist-name {
  background: var(--color-surface-muted);
  font-weight: 600;
}

.ist-table tr.category-row .ist-name {
  padding-left: 1.4rem;
  color: var(--color-text-tertiary);
}

.ist-table tr.uncategorized-row .ist-name {
  box-shadow: inset 4px 0 0 var(--color-warning);
  font-style: italic;
}

/* Prognose-Modus: Plan-Monate deutlich blau hinterlegt und kursiv —
   kräftiger als das Grau der Gruppenzeilen, damit beides unterscheidbar bleibt */
.ist-table th.plan-col,
.ist-table td.plan-col {
  background: var(--color-accent-soft-strong);
  font-style: italic;
}

/* Spannzeile "Ist | Plan" über den Monatsspalten */
.ist-table tr.ist-span-row th {
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-text-secondary);
  border-bottom: none;
}

.ist-table tr.ist-span-row th.span-plan {
  background: var(--color-accent-soft-strong);
  color: var(--color-accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.ist-table tr.expenses-row {
  background: var(--color-surface-muted);
  border-top: 2px solid var(--color-border-strong);
  border-bottom: 2px solid var(--color-border-strong);
  font-weight: 700;
}

.ist-table tr.expenses-row .ist-name {
  background: var(--color-surface-muted);
  font-weight: 700;
}

.ist-table tr.saldo-row {
  border-top: 2px solid var(--color-text);
  font-weight: 700;
}

.ist-table tr.saldo-row .ist-name {
  font-weight: 700;
}

/* =========================================================================
   Kennzahlen-Kacheln
   ========================================================================= */
.analysis-range {
  margin-bottom: 1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  background: var(--color-surface-muted);
  border-radius: 10px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
}

.kpi-value.neg {
  color: var(--color-negative);
}

/* Info-Popover an einer Kennzahl (z. B. Herleitung der Sparquote) */
.kpi {
  position: relative;
}

.kpi-info-btn {
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.3rem;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  vertical-align: 1px;
}

.kpi-info-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.kpi-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  z-index: 40;
  min-width: 19rem;
  padding: 0.75rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card), 0 6px 20px rgba(0, 0, 0, 0.12);
  font-size: 0.8rem;
  font-weight: 400;
}

.kpi-popover[hidden] {
  display: none;
}

.kpi-popover__intro {
  margin: 0 0 0.5rem;
  color: var(--color-text-secondary);
}

.kpi-popover__row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.15rem 0;
}

.kpi-popover__row .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi-popover__total {
  border-top: 1px solid var(--color-border);
  margin-top: 0.15rem;
  padding-top: 0.3rem;
  font-weight: 600;
}

.kpi-popover__sub {
  padding-left: 0.9rem;
  color: var(--color-text-secondary);
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* =========================================================================
   Planung & Ist/Plan-Vergleich
   ========================================================================= */
.plan-table input.plan-input {
  width: 5.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  text-align: right;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

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

/* Abgeleitete Plan-Zeilen (Investitionen): Pflege auf der Investitions-Seite */
.plan-table tr.plan-derived {
  cursor: pointer;
}

.plan-table tr.plan-derived .ist-name {
  color: var(--color-accent);
}

/* Investitions-Editor: Position × Monat mit Eingabefeldern */
.inv-editor input.inv-text-input {
  width: 8.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.inv-editor input.inv-text-input--wide {
  width: 12rem;
}

.inv-editor select.inv-cat-select {
  max-width: 8rem;
  padding: 0.3rem 0.25rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.inv-editor input.inv-month-input {
  width: 4.4rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  text-align: right;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.inv-editor input:focus,
.inv-editor select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.inv-editor .inv-delete {
  padding: 0.15rem 0.4rem;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.inv-editor .inv-delete:hover {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.recon-table input.recon-input {
  width: 7rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  text-align: right;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

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

.recon-table td.recon-diff {
  white-space: nowrap;
}

.recon-table td.recon-diff .ampel {
  vertical-align: middle;
  margin-right: 0.3rem;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.comp-table th,
.comp-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.comp-table .num {
  text-align: right;
}

.comp-table .neg {
  color: var(--color-negative);
}

.comp-table .comp-name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   Ampeln
   ========================================================================= */
.ampel {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}

.ampel.green {
  background: var(--color-positive);
}

.ampel.red {
  background: var(--color-danger);
}

/* =========================================================================
   Filter
   ========================================================================= */
.filter-bar input[type="search"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  font-size: 0.9rem;
}

.filter-row input[type="date"],
.filter-row input[type="month"] {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  font-size: 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.filter-row select {
  flex: 1;
  min-width: 8rem;
  margin-bottom: 0;
}

.filter-row label.stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}

label.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
}

label.stacked input[type="text"],
label.stacked input[type="number"],
label.stacked input[type="email"],
label.stacked input[type="password"] {
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

label.stacked select {
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

label.stacked select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

/* =========================================================================
   Fortschritts-/Budgetbalken (.pf-progress)
   ========================================================================= */
.pf-progress {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pf-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.pf-progress__track {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  overflow: hidden;
}

.pf-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent);
  transition: width 0.2s ease;
}

.pf-progress__fill--over {
  background: var(--color-negative);
}

.pf-progress__fill--success {
  background: var(--color-positive);
}

/* =========================================================================
   Navigation (.pf-nav) — Seitenleiste (Desktop) & untere Leiste (Mobil)
   ========================================================================= */
.pf-nav__dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

/* Seitenleiste */
.pf-nav--sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.pf-nav--sidebar .pf-nav__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.pf-nav--sidebar .pf-nav__item:hover {
  background: var(--color-surface-muted);
}

.pf-nav--sidebar .pf-nav__item[aria-current="page"] {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* Untere Leiste */
.pf-nav--bottom {
  display: flex;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.pf-nav--bottom .pf-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-top: 2px solid transparent;
  margin-top: -1px;
  cursor: pointer;
}

.pf-nav--bottom .pf-nav__item[aria-current="page"] {
  color: var(--color-accent);
  border-top-color: var(--color-accent);
}

.pf-nav__item:focus-visible {
  outline: 2px solid var(--focus-ring-accent);
  outline-offset: -2px;
}

/* App-Layout mit Navigation */
.pf-layout {
  display: flex;
  align-items: flex-start;
}

.pf-layout__sidebar {
  flex: 0 0 auto;
  width: 240px;
  position: sticky;
  top: 0;
  align-self: stretch;
  min-height: 100%;
}

.pf-layout__main {
  flex: 1 1 auto;
  min-width: 0;
}

.pf-bottomnav {
  position: sticky;
  bottom: 0;
  z-index: 40;
}

@media (max-width: 767px) {
  .pf-layout__sidebar {
    display: none;
  }
}

@media (min-width: 768px) {
  .pf-bottomnav {
    display: none;
  }
}

/* =========================================================================
   Transaktionen
   ========================================================================= */
.tx-count {
  margin: 1rem 0 0.5rem;
  font-weight: 500;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.bulk-bar[hidden] {
  display: none;
}

.bulk-bar select {
  flex: 1;
  min-width: 10rem;
  margin-bottom: 0;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

.bulk-bar button {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  width: auto;
}

.tx-table th.check,
.tx-table td.check {
  width: 2rem;
  text-align: center;
}

.tx-table input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-accent);
}

.rules-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.rules-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.rules-list button.rule-delete {
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  color: var(--color-negative);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}

.rules-list button.rule-delete:hover {
  background: var(--color-danger-soft);
}

.rules-list button.rule-delete:active {
  background: var(--color-danger-soft-strong);
}

.rules-list button.rule-delete:focus-visible {
  outline: 3px solid var(--focus-ring-danger);
  outline-offset: 2px;
}

#rules-apply {
  width: 100%;
}

.tx-table select.row-category {
  max-width: 12rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.tx-empty {
  margin: 1rem 0 0;
  color: var(--color-text-secondary);
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tx-table th,
.tx-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.tx-table .num {
  text-align: right;
  white-space: nowrap;
}

.tx-table td.negative {
  color: var(--color-text);
}

.tx-table td.positive {
  color: var(--color-income);
  font-weight: 600;
}

.tx-table tr.uncategorized td:first-child {
  box-shadow: inset 4px 0 0 var(--color-warning);
}

/* Excel-artige Kopfzeile: Klick sortiert, ▾ öffnet den Spaltenfilter */
.tx-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.tx-table th.sortable:hover {
  color: var(--color-accent);
}

.sort-arrow {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--color-accent);
  vertical-align: middle;
}

/* Ohne aktive Sortierung keinen Platz reservieren — sonst klafft eine
   Lücke zwischen Spaltentitel und Filter-Icon */
.sort-arrow:empty {
  display: none;
}

/* ".card button"-Grundstil bewusst überstimmen (höhere Spezifität) */
.card button.th-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 0.3rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--color-text-secondary);
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: -6px; /* optisch mittig zur Textzeile des Spaltentitels */
}

.th-filter-btn .filter-icon {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card button.th-filter-btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-accent);
}

/* Spalte hat einen aktiven Filter: Trichter gefüllt und blau */
.card button.th-filter-btn--active {
  border-color: var(--color-accent-border);
  background: var(--color-accent-soft-strong);
  color: var(--color-accent);
}

.card button.th-filter-btn--active .filter-icon {
  fill: currentColor;
}

.th-popover {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
  padding: 0.65rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  font-weight: 400;
  white-space: nowrap;
  cursor: default;
  text-align: left;
}

.th-popover[hidden] {
  display: none;
}

.th-popover--right,
.tx-table th.num .th-popover {
  left: auto;
  right: 0;
}

.th-popover label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.th-popover input,
.th-popover select {
  width: 100%;
  min-width: 9.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.th-popover input:focus,
.th-popover select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.card button.th-popover-clear {
  align-self: flex-start;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}

.card button.th-popover-clear:hover {
  background: transparent;
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Mobile: Tabellenkopf (und damit die Spaltenfilter) wird zur Kartenansicht
   ausgeblendet — dann übernimmt das einfache Suchfeld */
.tx-mobile-filter {
  display: none;
  margin-bottom: 0.75rem;
}

.tx-mobile-filter input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

@media (max-width: 767px) {
  .tx-mobile-filter {
    display: block;
  }
}

.pagination[hidden] {
  display: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination button {
  margin-top: 0;
  padding: 0.5rem 1rem;
  flex: 0 0 auto;
  width: auto;
}

.pagination span {
  font-size: 0.9rem;
}

/* Mobile: Transaktionszeilen als Karten */
@media (max-width: 767px) {
  #transactions-section .table-scroll {
    border: none;
    overflow: visible;
  }

  .tx-table thead {
    display: none;
  }

  .tx-table,
  .tx-table tbody,
  .tx-table tr,
  .tx-table td {
    display: block;
  }

  .tx-table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--color-surface);
  }

  .tx-table tr.uncategorized {
    border-left: 4px solid var(--color-warning);
  }

  .tx-table tr.uncategorized td:first-child {
    box-shadow: none;
  }

  .tx-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: none;
    padding: 0.2rem 0;
    text-align: right;
  }

  .tx-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: left;
    flex-shrink: 0;
  }
}

/* =========================================================================
   Login-Formular
   ========================================================================= */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.login-form h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.login-form label {
  font-size: 0.9rem;
  font-weight: 500;
}

.login-form input {
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

.login-form input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

.login-form button {
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}

.login-form button:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-btn-hover);
}

.login-form button:active {
  background: var(--color-accent-active);
  box-shadow: var(--shadow-btn-active);
  transform: translateY(1px);
}

.login-form button:focus-visible {
  outline: 3px solid var(--focus-ring-accent);
  outline-offset: 2px;
}

.login-form button:disabled,
.login-form button:disabled:hover {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.form-error {
  margin: 0;
  color: var(--color-negative);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  #app {
    padding: 1.5rem 2rem 2.5rem;
  }

  .login-form {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================================================================
   Meldung / Toast (.pf-toast)
   ========================================================================= */
.pf-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pf-toast[hidden] {
  display: none;
}

.pf-toast__dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  background: currentColor;
}

.pf-toast__body {
  flex: 1;
}

.pf-toast__close {
  flex: 0 0 auto;
  margin: -0.2rem -0.2rem 0 0;
  padding: 0 0.3rem;
  font-size: 1.1rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}

.pf-toast__close:hover {
  opacity: 1;
}

.pf-toast--success {
  background: var(--color-positive-soft);
  border-color: var(--color-positive-border);
  color: var(--color-positive-text);
}

.pf-toast--error {
  background: var(--color-danger-soft);
  border-color: var(--color-danger-border);
  color: var(--color-negative);
}

.pf-toast--info {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent);
}

.pf-toast--warning {
  background: var(--color-warning-soft);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

/* =========================================================================
   Modal / Dialog (.pf-modal)
   ========================================================================= */
.pf-modal__overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 28, 30, 0.45);
}

.pf-modal {
  width: 100%;
  max-width: 30rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.pf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.pf-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.pf-modal__close {
  flex: 0 0 auto;
  padding: 0 0.35rem;
  font-size: 1.4rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.pf-modal__close:hover {
  color: var(--color-text);
}

.pf-modal__body {
  padding: 1.25rem;
  overflow-y: auto;
}

.pf-modal__body p {
  margin: 0 0 0.5rem;
}

.pf-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

/* =========================================================================
   Tabs (.pf-tabs)
   ========================================================================= */
.pf-tabs__list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
}

.pf-tabs__tab {
  padding: 0.6rem 0.9rem;
  margin-bottom: -1px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.pf-tabs__tab:hover {
  color: var(--color-text);
}

.pf-tabs__tab[aria-selected="true"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.pf-tabs__tab:focus-visible {
  outline: 2px solid var(--focus-ring-accent);
  outline-offset: 2px;
}

.pf-tabs__tab:disabled {
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

.pf-tabs__panel {
  padding-top: 1rem;
}

/* =========================================================================
   Badge / Chip (.pf-badge)
   ========================================================================= */
.pf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  white-space: nowrap;
}

.pf-badge--neutral {
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
}

.pf-badge--accent {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.pf-badge--success {
  background: var(--color-positive-soft);
  color: var(--color-positive-text);
}

.pf-badge--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.pf-badge--danger {
  background: var(--color-danger-soft);
  color: var(--color-negative);
}

.pf-badge__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-right: -0.2rem;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.75;
}

.pf-badge__remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

/* =========================================================================
   App-Ergänzungen (Layout-Verdrahtung, nicht Teil des Design-Systems)
   ========================================================================= */

/* Dezente Wertfarben: Einnahmen grün, Ausgaben rot (ohne Vorzeichen) */
.val-pos {
  color: var(--color-income);
}

.val-neg {
  color: var(--color-expense);
}

/* Sekundär-Buttons in Karten nicht vom .card-button-Selektor überstimmen lassen */
.card button.secondary-button {
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  box-shadow: none;
  font-weight: 500;
}

.card button.secondary-button:hover {
  background: var(--color-accent-soft);
  box-shadow: none;
}

.card button.secondary-button:active {
  background: var(--color-accent-soft-strong);
  transform: translateY(1px);
}

/* Navigations-Icons */
.pf-nav__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.pf-nav--bottom .pf-nav__icon {
  width: 20px;
  height: 20px;
}

/* Kategorienverwaltung in den Einstellungen */
.cat-group-title {
  margin: 1rem 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.cat-inactive > span {
  color: var(--color-disabled-text);
  text-decoration: line-through;
}

/* Frag deine Finanzen: Frage-Eingabe mit Antwortbereich —
   ".card form" (Spalte) bewusst überstimmen */
.card form.ask-form {
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.card form.ask-form button {
  margin-top: 0;
  padding: 0.55rem 1.4rem;
  white-space: nowrap;
}

.ask-form input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

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

.ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ask-answer {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
}

.ask-answer[hidden] {
  display: none;
}

.ask-answer__value {
  font-size: 1.6rem;
  font-weight: 700;
}

.ask-answer__meta {
  margin: 0.2rem 0 0.9rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* Absprung zur vorgefilterten Transaktionen-Seite (Link-Optik statt Button) */
.card button.ask-answer__link {
  margin-top: 0.9rem;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.card button.ask-answer__link:hover {
  background: transparent;
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Dashboard: Zeitraum-Auswertung & Jahresscheiben */
.period-total {
  font-weight: 600;
  background: var(--color-surface-muted);
}

td.period-sub {
  padding-left: 1.4rem;
  color: var(--color-text-tertiary);
}

tr.slice-plan {
  font-style: italic;
}

/* Jahresscheiben: Zeitraum-Presets als Chips statt Jahreseingabe */
.range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* ".card button"-Grundstil bewusst überstimmen (höhere Spezifität) */
.card button.range-chip {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
}

.card button.range-chip:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
  color: var(--color-accent);
}

.card button.range-chip--active {
  background: var(--color-accent-soft-strong);
  border-color: var(--color-accent-border);
  color: var(--color-accent);
  font-weight: 600;
}

/* Jahresscheiben: klickbare Ausgaben-Spalte + neutrale Gruppen-Spalten */
.ist-table th.slices-toggle {
  cursor: pointer;
  color: var(--color-accent);
  user-select: none;
}

.ist-table td.slice-muted {
  color: var(--color-text-tertiary);
}

.ist-table tr.slices-sum td {
  border-top: 2px solid var(--color-text);
  border-bottom: none;
  font-weight: 700;
}

/* Dashboard: Diagramme */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.chart-card {
  margin-top: 1rem;
  min-width: 0;
}

.chart-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Klickbare Balkenzeilen (Drill-down in der Mittelverwendung) */
.struct-row--click {
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.struct-row--click:hover {
  background: var(--color-accent-soft);
}

/* Filter über der Top-Ausgaben-Liste */
.dash-top-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.dash-top-filter select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.dash-top-filter select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.chart-grid + .chart-grid .chart-card {
  margin-top: 0;
}

.chart-grid + .chart-grid {
  margin-top: 1rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-legend__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
}

.chart-legend__dot--income {
  background: var(--color-income);
}

.chart-legend__dot--expense {
  background: var(--color-expense);
}

.chart-bar--income {
  fill: var(--color-income);
}

.chart-bar--expense {
  fill: var(--color-expense);
}

.chart-legend__dot--plan {
  background: var(--color-accent);
}

.chart-bar--plan {
  fill: var(--color-accent);
}

/* Balkenlisten wachsen nicht ins Unendliche, sondern scrollen — feste Höhe,
   damit "Größte Ausgaben" und "Mittelverwendung" gleich hoch nebeneinanderstehen */
.struct-rows--scroll {
  height: 340px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--color-accent);
}

.chart-dot:hover {
  fill: var(--color-accent-hover);
}

.chart-grid-line {
  stroke: var(--color-border);
  stroke-width: 1;
}

.chart-baseline {
  stroke: var(--color-text-secondary);
  stroke-width: 1;
}

.chart-axis-text {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: var(--color-text-secondary);
}

/* Dashboard: horizontale Balkenlisten (Mittelverwendung, Top-Ausgaben) */
.struct-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.struct-row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.struct-row--list {
  grid-template-columns: minmax(8rem, 1fr) auto auto;
}

.struct-row__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.struct-row__meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.struct-row__value {
  white-space: nowrap;
  font-weight: 500;
}

.struct-row__value.neg {
  color: var(--color-negative);
}

/* Investitionsplanung */
.kpi-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 768px) {
  .kpi-grid--three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi-value.neg {
  color: var(--color-negative);
}

.inv-progress-col {
  min-width: 12rem;
}

td.inv-progress-col {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

td.inv-progress-col .pf-progress__track {
  flex: 1;
  min-width: 6rem;
}

.inv-pct {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
