:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 240 5.3% 26.1%;
  --sidebar-primary: 240 5.9% 10%;
  --sidebar-primary-foreground: 0 0% 98%;
  --sidebar-accent: 240 4.8% 95.9%;
  --sidebar-accent-foreground: 240 5.9% 10%;
  --sidebar-border: 220 13% 91%;
  --sidebar-ring: 217.2 91.2% 59.8%;
}

* {
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-feature-settings: "rlig" 1, "calt" 1;
}

.sidebar {
  background-color: hsl(var(--sidebar-background));
  color: hsl(var(--sidebar-foreground));
  border-color: hsl(var(--sidebar-border));
}

.sidebar-menu-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-menu-btn:hover:not(.sidebar-menu-btn-disabled) {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}

.sidebar-menu-btn-active {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
  font-weight: 600;
}

.sidebar-menu-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sidebar-sub-btn {
  padding-left: 2rem;
  font-size: 0.8125rem;
}

.sidebar-group-label {
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-soon {
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.25rem;
  padding: 0 1rem;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.input,
.select {
  display: flex;
  height: 2.25rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.alert {
  border-radius: var(--radius);
  border: 1px solid hsl(142.1 76.2% 36.3% / 0.3);
  background-color: hsl(142.1 76.2% 36.3% / 0.1);
  color: hsl(142.1 76.2% 26.3%);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-objekt {
  background-color: hsl(214.3 94.6% 92.7%);
  color: hsl(226.4 57.8% 40.8%);
}

.badge-kategorie {
  background-color: hsl(270.7 91% 95.1%);
  color: hsl(272.1 71.7% 47.1%);
}

.badge-unassigned {
  background-color: hsl(48 96.5% 89%);
  color: hsl(26 90.5% 37.1%);
}

.badge-art-miete {
  background-color: hsl(142.1 76.2% 92%);
  color: hsl(142.1 76.2% 26.3%);
}

.badge-art-kaution {
  background-color: hsl(214.3 94.6% 92.7%);
  color: hsl(226.4 57.8% 40.8%);
}

.badge-art-auszahlung-darlehen {
  background-color: hsl(24.6 95% 93.1%);
  color: hsl(20.5 90.2% 38%);
}

.badge-art-dividende {
  background-color: hsl(270.7 91% 95.1%);
  color: hsl(272.1 71.7% 47.1%);
}

.badge-kostenart-kaufnebenkosten {
  background-color: hsl(24.6 95% 93.1%);
  color: hsl(20.5 90.2% 38%);
}

.badge-kostenart-laufend {
  background-color: hsl(270.7 91% 95.1%);
  color: hsl(272.1 71.7% 47.1%);
}

.badge-kaufnebenkosten {
  background-color: hsl(48 96.5% 89%);
  color: hsl(26 90.5% 37.1%);
}

.badge-laufende-kosten {
  background-color: hsl(142.1 76.2% 92.2%);
  color: hsl(142.1 70.6% 30.2%);
}

.badge-allgemeinkosten {
  background-color: hsl(214.3 94.6% 92.7%);
  color: hsl(226.4 57.8% 40.8%);
}

.tx-vz-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tx-vz-text.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.tx-table-select {
  height: 2rem;
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.75rem;
  line-height: 1.25rem;
}

.tx-label-cell.tx-loading {
  opacity: 0.55;
  pointer-events: none;
}

.tx-nk-split-panel {
  min-width: 14rem;
  max-width: 18rem;
  padding: 0.375rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--muted) / 0.35);
}

.alert-error {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.amount-positive {
  color: hsl(142.1 76.2% 36.3%);
}

.amount-negative {
  color: hsl(var(--destructive));
}

.stat-value-positive {
  color: hsl(142.1 76.2% 36.3%);
}

.stat-value-negative {
  color: hsl(var(--destructive));
}

[data-collapsible-icon] {
  transition: transform 0.2s;
}

[data-collapsible-open="true"] [data-collapsible-icon] {
  transform: rotate(90deg);
}

[data-collapsible-content] {
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

[data-collapsible-content][data-collapsible-open="false"] {
  max-height: 0;
}

[data-collapsible-content][data-collapsible-open="true"] {
  max-height: 20rem;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  height: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  padding: 0.25rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.tab:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--background) / 0.6);
}

.tab-active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.tab-active:hover {
  background-color: hsl(var(--background));
}

.tab-panel {
  margin-top: 0.5rem;
}

.sidebar-backdrop {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
}

.sidebar-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 767px) {
  #sidebar {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  }

  .btn {
    min-height: 2.5rem;
  }

  .mobile-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .mobile-filter-row .select {
    width: 100%;
    min-width: 0;
  }

  .mobile-search-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .mobile-search-row .input {
    max-width: none;
  }

  .mobile-search-row .btn {
    width: 100%;
  }

  .mobile-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-toolbar .btn,
  .mobile-toolbar form {
    width: 100%;
  }

  .mobile-toolbar form.flex {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-toolbar input[type="file"] {
    max-width: none;
    width: 100%;
  }

  .mobile-tabs-scroll {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-tabs-scroll::-webkit-scrollbar {
    display: none;
  }

  .mobile-tabs-scroll > * {
    flex-shrink: 0;
  }

  .cashflow-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .cashflow-controls > form {
    width: 100%;
  }

  .cashflow-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .cashflow-filter-grid .select {
    width: 100%;
  }

  #cashflow-view-toggle {
    width: 100%;
    justify-content: stretch;
  }

  #cashflow-view-toggle button {
    flex: 1;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  .mobile-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-search-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .mobile-search-row .input {
    flex: 1 1 12rem;
  }

  .mobile-search-row .btn {
    width: auto;
  }
}
