@charset "UTF-8";
/* ========================================================================== */
/* RECHNUNGSVERWALTUNG – ZENTRALES DESIGN-SYSTEM                              */
/* Eine einzige Stylesheet-Quelle für Layout, Komponenten und Fachbereiche.   */
/* Diese Datei verwendet CSS-kompatible SCSS-Syntax und kann 1:1 als CSS       */
/* ausgeliefert werden. So ist kein zusätzlicher Sass-Build-Schritt nötig.     */
/* ========================================================================== */
/* -------------------------------------------------------------------------- */
/* 01 · DESIGN-TOKENS: FARBEN, TYPOGRAFIE, RADII, SCHATTEN UND ABSTÄNDE       */
/* -------------------------------------------------------------------------- */
:root {
  /* Grundfarben */
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-surface-muted: #f1f4f8;
  --color-sidebar: #172235;
  --color-sidebar-muted: #9eacc0;
  --color-text: #1d2939;
  --color-muted: #667085;
  --color-line: #e5eaf0;
  --color-line-soft: #edf0f4;
  --color-primary: #4263eb;
  --color-primary-dark: #3152d5;
  --color-success: #16865b;
  --color-warning: #b7791f;
  --color-danger: #c2414b;
  --color-info: #3453c7;
  /* Rückwärtskompatible Tokens aus den bisherigen Stylesheets */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-soft: var(--color-surface-soft);
  --surface-muted: var(--color-surface-muted);
  --sidebar: var(--color-sidebar);
  --sidebar-muted: var(--color-sidebar-muted);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --text-muted: var(--color-muted);
  --line: var(--color-line);
  --border: var(--color-line);
  --border-color: var(--color-line);
  --primary: var(--color-primary);
  --accent: var(--color-primary);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  /* Typografie */
  --font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 25px;
  --line-height-base: 1.5;
  /* Einheitliche Abstände */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 30px;
  --space-8: 40px;
  --layout-space-1: 6px;
  --layout-space-2: 10px;
  --layout-space-3: 14px;
  --layout-space-4: 18px;
  --layout-space-5: 24px;
  --layout-space-6: 30px;
  --table-cell-y: 12px;
  --table-cell-x: 14px;
  /* Radien und Schatten */
  --radius-sm: 7px;
  --radius-md: 9px;
  --radius: 13px;
  --radius-lg: 13px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(24, 39, 75, .055);
  --shadow-toast: 0 8px 28px rgba(0, 0, 0, .2);
}

/* -------------------------------------------------------------------------- */
/* 02 · RESET, GRUNDLAYOUT UND TYPOGRAFIE                                     */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
}

button, a, input, select {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-size: var(--font-size-xl);
  line-height: 1.2;
  letter-spacing: -0.7px;
}

h2 {
  margin: 0;
  font-size: var(--font-size-md);
  letter-spacing: -0.2px;
}

h3 {
  font-size: 15px;
}

small {
  font-size: var(--font-size-xs);
}

.text-muted {
  color: var(--color-muted);
}

.text-right {
  text-align: right;
}

.mono, .amount, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* -------------------------------------------------------------------------- */
/* 03 · APP-SHELL, SIDEBAR, NAVIGATION UND TOPBAR                             */
/* -------------------------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 28px;
  padding: 25px 16px;
  background: var(--color-sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--color-primary);
  font-weight: 800;
}

.nav-group-label {
  padding: 0 12px 8px;
  color: #73839a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--color-sidebar-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-icon {
  width: 19px;
  text-align: center;
  opacity: 0.9;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #91a0b4;
  font-size: var(--font-size-sm);
}

.main-area {
  min-width: 0;
}

.topbar {
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-surface);
}

.breadcrumb {
  color: var(--color-muted);
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e9edff;
  color: #354fbd;
  font-weight: 700;
}

.mobile-menu {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* 04 · SEITENRAHMEN, ÜBERSCHRIFTEN, KARTEN UND ABSTÄNDE                      */
/* -------------------------------------------------------------------------- */
.content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--layout-space-6) 34px 48px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--layout-space-5);
}

.page-heading h1 {
  margin-bottom: 6px;
}

.subtitle {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

.card {
  min-width: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: var(--layout-space-5);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--layout-space-4);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-label {
  color: var(--color-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.stat-value {
  margin: 7px 0 3px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.8px;
}

.stat-note {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #eef2ff;
  color: var(--color-primary);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-grid, .two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--layout-space-4);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line-soft);
}

.list-row:last-child {
  border: 0;
}

.list-main {
  min-width: 0;
}

.list-title {
  font-weight: 650;
}

.list-sub {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.empty-state {
  padding: 40px 20px;
  color: var(--color-muted);
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* 05 · BUTTONS, AKTIONEN, BADGES UND STATUS                                  */
/* -------------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  border-color: #cbd5e1;
  background: #f8faff;
}

.btn-primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--color-primary-dark);
  background: var(--color-primary-dark);
}

.btn-quiet {
  background: transparent;
}

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: var(--font-size-sm);
}

.btn-danger {
  color: var(--color-danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.badge-success {
  background: #e8f7ef;
  color: #087443;
}

.badge-warning {
  background: #fff5df;
  color: #996515;
}

.badge-danger {
  background: #fee4e2;
  color: #b42318;
}

.badge-neutral {
  background: #eef1f5;
  color: #596579;
}

.badge-blue {
  background: #edf1ff;
  color: #3453c7;
}

/* -------------------------------------------------------------------------- */
/* 06 · TABELLEN: EINHEITLICHE KÖPFE, ZELLEN, HOVER UND SCROLLVERHALTEN       */
/* -------------------------------------------------------------------------- */
.table-wrap, .customer-table-wrap, .bulk-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap {
  border-radius: 0 0 var(--radius) var(--radius);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  background: #f8fafc;
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.065em;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line-soft);
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background: #fafbfe;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap td .actions, .table-wrap td .row-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.table-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: var(--layout-space-3);
  padding: 12px var(--layout-space-4);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--font-size-sm);
}

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.page-btn {
  padding: 5px 9px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

.page-btn.active {
  border-color: #cbd5ff;
  background: #edf1ff;
  color: #3453c7;
}

.table-sort {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.table-sort:hover {
  opacity: 0.72;
}

.invoice-select-column, .invoice-select-cell {
  width: 76px;
  min-width: 76px;
  text-align: center;
}

.invoice-select-column label {
  display: block;
  margin-bottom: 5px;
}

#invoice-list input[type="checkbox"][data-select-invoice], #invoice-select-all {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  vertical-align: middle;
  cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* 07 · FORMULARE: FELDER, LABELS, INPUTS, FILTER UND VALIDIERUNG              */
/* -------------------------------------------------------------------------- */
.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field label {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.input, .select, .textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--color-text);
}

.input:focus, .select:focus, .textarea:focus {
  border-color: #8298ff;
  box-shadow: 0 0 0 3px rgba(66, 99, 235, 0.1);
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-line);
}

.search {
  min-width: 230px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 18px;
}

.form-main {
  display: grid;
  gap: var(--layout-space-4);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--layout-space-3) var(--layout-space-4);
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-layout .side-sticky {
  position: sticky;
  top: 18px;
  display: grid;
  gap: var(--layout-space-3);
}

.info-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}

.info-block:last-child {
  border: 0;
}

.info-label {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.info-value {
  margin-top: 3px;
  font-weight: 650;
}

.editor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px 120px 34px;
  align-items: end;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 5px 0;
}

.summary-total {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-line);
  font-size: 18px;
  font-weight: 750;
}

/* -------------------------------------------------------------------------- */
/* 08 · TABS, TOASTS, HINWEISE UND FEHLERMELDUNGEN                            */
/* -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-line);
}

.tab {
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.tab.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

.toast, .customer-toast, .contract-notice, .payments-toast, .work-toast, .review-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: min(420px, 100vw - 48px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #172235;
  color: #fff;
  box-shadow: var(--shadow-toast);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show, .customer-toast.visible, .contract-notice.show, .payments-toast.visible, .work-toast.visible, .review-notice.show {
  opacity: 1;
  transform: translateY(0);
}

#invoice-error, .customer-error, .contract-error, .payments-error, .work-error, .review-error, .bulk-error {
  color: var(--color-danger);
}

#invoice-error {
  margin: 1rem 0 0;
}

#invoice-rows tr[hidden], .work-bulk-panel[hidden], .customer-editor[hidden], .customer-detail[hidden] {
  display: none;
}

#editor-message {
  min-height: 1.4em;
}

/* -------------------------------------------------------------------------- */
/* 09 · RECHNUNGSEDITOR UND POSITIONSZEILEN                                    */
/* -------------------------------------------------------------------------- */
.invoice-item-row {
  align-items: end;
}

.invoice-item-row .field {
  min-width: 0;
}

.invoice-item-row .remove-item {
  align-self: end;
}

#recent-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#recent-items[hidden] {
  display: none;
}

#customer-details p {
  line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* 10 · DASHBOARD                                                             */
/* -------------------------------------------------------------------------- */
.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem;
}

.dashboard-kpi > span {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.dashboard-kpi strong {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.dashboard-kpi small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel {
  min-width: 0;
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.dashboard-panel .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel .card-head h2 {
  margin: 0 0 0.25rem;
}

.dashboard-panel .card-head a {
  font-size: 0.88rem;
  white-space: nowrap;
}

.dashboard-chart {
  display: grid;
  height: 230px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 0.45rem;
  overflow-x: auto;
}

.dashboard-chart-column {
  display: flex;
  height: 100%;
  min-width: 25px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.dashboard-chart-value {
  height: 1rem;
  color: var(--color-muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.dashboard-chart-track {
  display: flex;
  width: min(100%, 28px);
  height: 175px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(128, 128, 128, 0.1);
}

.dashboard-chart-track span {
  display: block;
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: var(--color-primary);
}

.dashboard-chart-column small {
  color: var(--color-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
}

.dashboard-list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--color-line);
  color: inherit;
  text-decoration: none;
}

.dashboard-list-row:last-child {
  border-bottom: 0;
}

.dashboard-list-row span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.2rem;
}

.dashboard-list-row small, .dashboard-list-row time {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.dashboard-list-row time {
  white-space: nowrap;
}

.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dashboard-table th, .dashboard-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--color-line);
  font-size: 0.88rem;
  text-align: left;
}

.dashboard-table .number {
  text-align: right;
  white-space: nowrap;
}

.dashboard-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.12);
  font-size: 0.75rem;
}

.dashboard-error {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #b94a48;
  border-radius: 0.5rem;
  color: #b94a48;
}

.dashboard-updated {
  color: var(--color-muted);
  font-size: 0.75rem;
  text-align: right;
}

.dashboard-app .text-muted {
  color: var(--color-muted);
}

/* -------------------------------------------------------------------------- */
/* 11 · KUNDENVERWALTUNG                                                      */
/* -------------------------------------------------------------------------- */
.customer-list, .customer-editor, .customer-detail {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.customer-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px auto;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.customer-filters .input, .customer-filters .select {
  width: 100%;
  min-width: 0;
}

.customer-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.customer-table th, .customer-table td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: middle;
}

.customer-table th {
  white-space: nowrap;
}

.customer-name-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-align: left;
}

.customer-name-link:hover {
  text-decoration: underline;
}

.customer-row-actions {
  text-align: right !important;
  white-space: nowrap;
}

.customer-status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 650;
}

.customer-status-pill.is-active {
  background: rgba(22, 163, 74, 0.12);
  color: #16803d;
}

.customer-status-pill.is-inactive {
  background: rgba(120, 120, 120, 0.14);
  color: var(--color-muted);
}

.customer-footer {
  padding-top: 0.9rem;
}

.customer-error {
  margin-top: 0.75rem;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.customer-form-grid .field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.4rem;
}

.customer-form-grid .field-wide {
  grid-column: 1/-1;
}

.customer-form-grid .input, .customer-form-grid .select, .customer-form-grid .textarea {
  width: 100%;
  min-width: 0;
}

.customer-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.customer-detail-cell {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: 0.6rem;
}

.customer-detail-cell span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.customer-detail-cell strong {
  overflow-wrap: anywhere;
}

.customer-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.customer-history-grid h3, .customer-notes h3 {
  margin: 0 0 0.7rem;
}

.customer-history-list {
  display: grid;
  gap: 0.55rem;
}

.history-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-line);
  border-radius: 0.55rem;
}

.history-item span {
  color: var(--color-muted);
  font-size: 0.84rem;
}

.history-item p {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.customer-notes {
  margin-top: 1.5rem;
}

#customer-note-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

/* -------------------------------------------------------------------------- */
/* 12 · VERTRAGSVERWALTUNG                                                    */
/* -------------------------------------------------------------------------- */
.contract-editor {
  margin-top: 22px;
}

.contract-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.contract-form-grid .field-wide {
  grid-column: 1/-1;
}

.contract-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 25px 0 12px;
}

.contract-items-head h3 {
  margin: 0;
  font-size: 15px;
}

.contract-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(85px, 0.7fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(90px, 0.7fr) 38px;
  align-items: end;
  gap: 10px;
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: #fbfcfe;
}

.contract-item-row .field label {
  font-size: 10px;
}

.contract-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
}

.contract-form-footer p {
  margin: 0;
}

.contract-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contract-error {
  padding: 0 18px 14px;
}

.contract-row-title {
  font-weight: 700;
}

.contract-row-sub {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 11px;
}

/* -------------------------------------------------------------------------- */
/* 13 · ABRECHNUNGSVORSCHLÄGE UND PRÜFUNG                                     */
/* -------------------------------------------------------------------------- */
.billing-review {
  padding: 18px;
}

.billing-review .filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.billing-review .filters .select {
  max-width: 320px;
}

.billing-review table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.billing-review th, .billing-review td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
}

.billing-review th {
  color: var(--color-muted);
  font-size: 0.82rem;
  text-align: left;
  white-space: nowrap;
}

.billing-review .text-right {
  text-align: right;
}

.billing-intro {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface-soft);
  line-height: 1.5;
}

.billing-intro strong {
  font-size: 0.9rem;
}

.billing-intro span {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.review-sub {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-actions .btn {
  white-space: nowrap;
}

.review-error {
  margin-top: 12px;
}

.billing-prepare-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  line-height: 1.5;
}

.billing-prepare-result ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.review-detail {
  margin-top: 20px;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.review-summary > div {
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}

.review-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.review-summary strong {
  font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/* 14 · SAMMELRECHNUNGEN                                                      */
/* -------------------------------------------------------------------------- */
.bulk-invoice {
  padding: 1.25rem;
}

.bulk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.bulk-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
}

.bulk-grid .input, .bulk-grid .select {
  width: 100%;
  min-width: 0;
}

.bulk-table-head, .bulk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0;
}

.bulk-table-head h2 {
  margin: 0 0 0.25rem;
}

.bulk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.bulk-table th, .bulk-table td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
}

.bulk-table th {
  white-space: nowrap;
}

.bulk-table .input {
  width: 100%;
  min-width: 130px;
}

.bulk-table td:last-child {
  width: 1%;
}

.bulk-error {
  margin-top: 1rem;
}

.bulk-results {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--color-line);
  border-radius: 0.65rem;
}

.bulk-results h3 {
  margin-top: 0;
}

.bulk-results li {
  margin: 0.35rem 0;
}

/* -------------------------------------------------------------------------- */
/* 15 · ZAHLUNGSEINGÄNGE                                                      */
/* -------------------------------------------------------------------------- */
.payments-app, .payment-editor {
  margin-bottom: 1.25rem;
}

.payments-error {
  margin-top: 0.75rem;
}

.payments-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.payments-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.payments-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.payments-summary span {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.payments-summary strong {
  font-size: 1.35rem;
}

.payments-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
}

.payments-table th, .payments-table td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
}

.payments-table th {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.payment-status {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.14);
  font-size: 0.78rem;
}

.payment-status.is-paid {
  background: rgba(40, 170, 100, 0.14);
  color: #299b62;
}

.payment-status.is-overdue {
  background: rgba(220, 70, 70, 0.14);
  color: #d65b5b;
}

.payment-editor {
  padding: 1.25rem;
}

.payment-history {
  margin: 1rem 0 1.5rem;
}

.payment-history h3 {
  margin-bottom: 0.6rem;
}

.payment-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-line);
}

.payment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.payment-form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.payment-form-grid .field-wide {
  grid-column: 1/-1;
}

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

/* -------------------------------------------------------------------------- */
/* 16 · ARBEITSLEISTUNGEN UND SAMMELÜBERNAHME                                 */
/* -------------------------------------------------------------------------- */
.work-app, .work-editor {
  margin-bottom: 1.25rem;
}

.work-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) repeat(2, minmax(135px, 1fr)) auto;
  gap: 0.65rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-line);
}

.work-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.work-table th, .work-table td {
  padding: var(--table-cell-y) var(--table-cell-x);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: middle;
}

.work-table th {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.work-table td {
  font-size: 0.9rem;
}

.work-description-cell {
  max-width: 320px;
  white-space: normal;
}

.work-row-actions {
  display: flex;
  gap: 0.35rem;
  white-space: nowrap;
}

.work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.work-error {
  margin: 0 1rem 1rem;
}

.work-editor {
  padding: 1.2rem;
}

.work-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.work-form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.work-form-grid .field-wide {
  grid-column: 1/-1;
}

.work-amount {
  padding: 0.55rem 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.work-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.work-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-line);
}

.work-bulk-toolbar span {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.work-bulk-panel {
  margin-top: 1rem;
  padding: 1.25rem;
}

.work-bulk-panel .work-form-grid {
  margin-top: 1rem;
}

.work-select {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.work-status-pill {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.work-status-pill.is-open {
  background: rgba(220, 160, 50, 0.14);
  color: #d7a94b;
}

.work-status-pill.is-invoiced {
  background: rgba(70, 170, 120, 0.14);
  color: #5bb98b;
}

.work-status-pill.is-reserved {
  background: rgba(214, 158, 46, 0.14);
  color: #b7791f;
}

/* -------------------------------------------------------------------------- */
/* 17 · EINSTELLUNGEN                                                         */
/* -------------------------------------------------------------------------- */
.settings-form {
  display: grid;
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid .span-2 {
  grid-column: span 2;
}

.settings-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.settings-success {
  border: 1px solid #b9e4c9;
  background: #eaf7ef;
  color: #17633b;
}

.settings-error {
  border: 1px solid #f0c5c5;
  background: #fff0f0;
  color: #8b2525;
}

.settings-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 10px;
}

.settings-readonly {
  margin-top: 18px;
}

.settings-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.settings-stats > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}

.settings-stats strong {
  font-size: 20px;
  font-weight: 650;
}

.settings-note {
  margin: 14px 0 0;
}

/* -------------------------------------------------------------------------- */
/* 18 · RESPONSIVE BREAKPOINTS                                                */
/* -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .content {
    padding: 24px 22px 40px;
  }
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .work-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contract-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contract-item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contract-item-row .remove-contract-item {
    grid-column: 2;
    justify-self: end;
  }
}
@media (max-width: 850px) {
  .customer-form-grid, .customer-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .customer-filters {
    grid-template-columns: 1fr 180px;
  }
  .customer-filters button {
    grid-column: 1/-1;
    justify-self: start;
  }
  .bulk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .billing-review .filters {
    align-items: stretch;
    flex-direction: column;
  }
  .billing-review .filters .select {
    max-width: none;
  }
  .review-summary {
    grid-template-columns: 1fr;
  }
  .review-actions {
    min-width: 180px;
  }
}
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 260px;
    min-height: 100vh;
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    padding: 0 18px;
  }
  .content {
    padding: 22px 16px 36px;
  }
  .dashboard-grid, .form-layout, .two-col {
    grid-template-columns: 1fr;
  }
  .side-sticky {
    position: static;
  }
  .form-layout .side-sticky {
    position: static;
  }
  .page-heading {
    flex-direction: column;
  }
  .card-pad {
    padding: 17px;
  }
  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .payments-filters {
    grid-template-columns: 1fr;
  }
  .payments-summary {
    grid-template-columns: 1fr;
  }
  .payment-form-grid {
    grid-template-columns: 1fr;
  }
  .payment-history-row {
    grid-template-columns: 1fr auto;
  }
  .payment-history-row .btn {
    grid-column: 1/-1;
    justify-self: start;
  }
  .settings-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-grid .span-2 {
    grid-column: auto;
  }
  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (max-width: 700px) {
  .work-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .work-bulk-toolbar .btn {
    width: 100%;
  }
}
@media (max-width: 650px) {
  .contract-form-grid {
    grid-template-columns: 1fr;
  }
  .contract-form-grid .field-wide {
    grid-column: auto;
  }
  .contract-form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .work-filters, .work-form-grid {
    grid-template-columns: 1fr;
  }
  .work-form-grid .field-wide {
    grid-column: auto;
  }
  .work-footer, .work-form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .payment-form-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .dashboard-heading {
    align-items: center;
  }
  .dashboard-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .dashboard-kpi {
    padding: 0.8rem;
  }
  .dashboard-kpi strong {
    font-size: 1.25rem;
  }
  .dashboard-panel {
    padding: 0.8rem;
  }
  .dashboard-table th, .dashboard-table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.78rem;
  }
  .customer-form-grid, .customer-detail-grid, .customer-history-grid {
    grid-template-columns: 1fr;
  }
  .customer-filters {
    grid-template-columns: 1fr;
  }
  .customer-form-footer {
    align-items: stretch;
    flex-direction: column;
  }
  #customer-note-form {
    grid-template-columns: 1fr;
  }
  .customer-table {
    min-width: 760px;
  }
  .content {
    padding: 18px 12px 30px;
  }
  .card-pad {
    padding: 14px;
  }
  .table-wrap th, .table-wrap td {
    padding: 10px 11px;
  }
  .settings-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bulk-grid {
    grid-template-columns: 1fr;
  }
  .bulk-table-wrap {
    overflow-x: auto;
  }
  .bulk-table-head, .bulk-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .billing-review .filters {
    align-items: stretch;
    flex-direction: column;
  }
  .review-summary {
    grid-template-columns: 1fr;
  }
  .payments-summary {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .bulk-grid {
    grid-template-columns: 1fr;
  }
  .bulk-table-head, .bulk-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .stat-card {
    padding: 13px;
  }
  .stat-value {
    font-size: 21px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
  .editor-item {
    grid-template-columns: 1fr 1fr;
  }
  .editor-item .field:first-child {
    grid-column: span 2;
  }
  .search {
    min-width: 100%;
  }
  .table-wrap th, .table-wrap td {
    padding: 10px 11px;
  }
}/*# sourceMappingURL=app.css.map */
