* {
  box-sizing: border-box;
}

.cc-invoice-admin-wrap {
  margin: 0 0 0 0;
}

.cc-invoice-admin {
  margin: 20px 20px 20px 0;
}

body {
  background: #f3f5f7;
}

.site-header {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  text-align: center;
  border-radius: 10px;
}


.site-header-logo {
  display: block;
  width: min(280px, 60vw);
  max-width: 280px;
  height: auto;
  margin: 0 auto 0.5rem;
}

#generalSettingsPanel textarea {
  min-height: 92px;
}

.site-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.9rem;
}

.site-header p {
  margin: 0;
  color: #1f2937;
  font-size: 14px;
}

.generator-tabs-wrap {
  width: min(100%, 1460px);
  max-width: 1460px;
  margin: 1rem auto 0 auto;
  padding: 0 0.6rem;
}

.cc-workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.generator-primary-tabs,
.generator-subtabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.generator-primary-tab {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f2f6e;
  border-radius: 11px;
  padding: 0.78rem 1.25rem;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.generator-primary-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.generator-subtabs {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.58rem;
  background: #f8fafc;
}

.generator-tab-placeholder {
  position: relative;
}

.generator-tab-placeholder::after {
  content: "vorbereitet";
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.1rem 0.38rem;
}

.generator-tab-placeholder.is-active::after {
  color: #1e3a8a;
  background: #ffffff;
}

.app-shell {
  width: min(100%, 1480px);
  max-width: 1480px;
  margin: 0.75rem auto;
  padding: 0 0.6rem 1rem 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 690px) minmax(0, 750px);
  gap: 0.75rem;
  align-items: start;
  justify-content: center;
}

.panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  padding: 0.72rem;
}

.form-panel h2,
.preview-panel h2 {
  margin: 0.58rem 0 0.42rem;
  font-size: 1rem;
}

.create-mode-bar {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 1rem;
}

.create-mode-field {
  min-width: 260px;
  max-width: 360px;
}

.form-panel h2:first-child,
.preview-panel h2:first-child {
  margin-top: 0;
}

.grid.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.46rem;
}

.span-2 {
  grid-column: 1 / -1;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.field-group label {
  font-size: 0.82rem;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ok-check,
.confirm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ff0000;
  white-space: nowrap;
}

.ok-check input,
.confirm-check input {
  width: auto;
  margin: 0;
}

.confirm-box {
  margin-top: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0.38rem 0.52rem;
  font-size: 0.88rem;
  background: #fff;
  color: #1e3a8a;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #64748b;
}

.field-group textarea {
  resize: vertical;
}

.help-text {
  margin: 0.16rem 0 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #6b7280;
}

.recipient-card {
  grid-column: 1 / -1;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.56rem 0.62rem 0.54rem;
}

.recipient-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.42rem 0.55rem;
}

.recipient-card-grid--invoice .recipient-col-type {
  grid-column: span 2;
}

.recipient-card-grid--invoice .recipient-col-name {
  grid-column: span 4;
}

.recipient-card-grid--invoice .recipient-col-half {
  grid-column: span 3;
}

.recipient-card-grid--invoice .recipient-col-full {
  grid-column: 1 / -1;
}

.recipient-card-grid--invoice .recipient-col-zip {
  grid-column: span 2;
}

.recipient-card-grid--invoice .recipient-col-city {
  grid-column: span 4;
}

.recipient-card .field-group {
  gap: 0.26rem;
}

.recipient-card .customer-action-group {
  margin-top: 0.05rem;
}

.recipient-card-grid--unified .recipient-col-name-wide {
  grid-column: span 6;
}

.recipient-card-grid--unified .recipient-col-half {
  grid-column: span 3;
}

.recipient-card-grid--unified .recipient-col-full {
  grid-column: 1 / -1;
}

.recipient-card-grid--unified .recipient-col-zip {
  grid-column: span 2;
}

.recipient-card-grid--unified .recipient-col-city {
  grid-column: span 4;
}

.unified-card {
  margin-top: 0.05rem;
}

.unified-form-grid {
  gap: 0.75rem 0.9rem;
}

.unified-form-grid .field-group {
  gap: 0.28rem;
}

.unified-col-half {
  grid-column: span 1;
}

.master-unified-card {
  background: #f7fbff;
}


.field-status {
  min-height: 1.2rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.field-status-error {
  color: #b91c1c;
}

.field-input-error {
  border-color: #dc2626 !important;
}

.positions-toolbar,
.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.72rem;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.primary-btn {
  background: #2563eb;
  color: #fff;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.action-row--invoice-actions {
  align-items: center;
}

.invoice-paid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}

.invoice-paid-toggle input {
  width: 1rem;
  height: 1rem;
}

.customer-master-history-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.customer-master-history-status.status-paid {
  background: #dcfce7;
  color: #166534;
}

.customer-master-history-status.status-open {
  background: #fee2e2;
  color: #b91c1c;
}

.customer-master-history-status.status-na {
  background: #e2e8f0;
  color: #475569;
}

.secondary-btn {
  background: #e5e7eb;
  color: #111827;
}

.secondary-btn:hover {
  background: #d1d5db;
}


.secondary-btn.danger-btn {
  background: #fee2e2;
  color: #991b1b;
}

.secondary-btn.danger-btn:hover {
  background: #fecaca;
}

.customer-tools {
  margin-bottom: 0.55rem;
}

.customer-status {
  min-height: 1.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
}


.template-status {
  min-height: 1.3rem;
  margin-top: -0.35rem;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #2563eb;
}

#savedCustomers {
  min-height: 136px;
}

.customer-action-group {
  margin-top: -0.1rem;
}

.customer-mini-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.small-btn {
  padding: 0.44rem 0.66rem;
  font-size: 0.8rem;
}

.customer-status-under-actions {
  margin-top: 0.45rem;
}

.customer-save-attention {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  overflow-x: hidden;
}

.position-row {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  padding: 0.48rem;
  background: #f8fbff;
  overflow: hidden;
}

.position-grid {
  display: grid;
  grid-template-columns: 52px 88px minmax(220px, 1.9fr) 92px 108px;
  gap: 0.32rem;
  align-items: start;
}

.position-grid .field-group label {
  white-space: nowrap;
}

.position-grid .readonly-field input,
.position-grid .pos-price {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.position-grid > .field-group {
  min-width: 0;
}

.position-grid input,
.position-grid textarea {
  min-width: 0;
}

.pos-desc {
  min-height: 58px;
}

.pos-price,
.pos-total {
  text-align: right;
}

.readonly-field input {
  background: #eef2f7;
  font-weight: 700;
}

.row-actions {
  margin-top: 0.28rem;
  text-align: right;
}

.epc-box {
  margin-top: 0.65rem;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  padding: 0.65rem;
  background: #f8fbff;
}

.epc-box summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.preview-header p {
  margin-top: -0.3rem;
  color: #6b7280;
}

.preview-panel .preview-header {
  background: #ffffff;
  padding-bottom: 0.25rem;
}

.preview-panel {
  position: sticky;
  top: 0.75rem;
  align-self: start;
  overflow: visible;
}

.preview-panel .preview-header {
  margin-bottom: 0.05rem;
}

.page-info {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #1f2937;
  font-weight: 700;
}

.invoice-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  align-items: center;
}

.preview-panel .invoice-page {
  transform: scale(0.84);
  transform-origin: top center;
  margin: 0 auto -180px auto;
}

.invoice-page {
  position: relative;
  width: 794px;
  min-height: 1123px;
  height: 1123px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  break-after: page;
  page-break-after: always;
}

.invoice-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.invoice-template-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
}

.invoice-template-image:not([src]),
.invoice-template-image[src=""] {
  display: none;
}

.invoice-content-layer {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 1123px;
  padding: 0;
  font-family: Arial, sans-serif;
}

.address-window {
  position: absolute;
  white-space: pre-line;
  min-height: 90px;
  font-size: 0.82rem;
  line-height: 1.34;
  color: #111827;
}

.meta-top,
.invoice-title,
.invoice-subtitle,
.invoice-project,
.invoice-period,
.invoice-table,
.invoice-bottom-row,
.invoice-continuation {
  position: absolute;
}

.meta-top {
  display: block;
  text-align: right;
  font-size: 0.74rem;
  line-height: 1.24;
  color: #111827;
}

.invoice-title {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.12;
  color: #111827;
}

.invoice-main-title,
.invoice-number-value {
  font-size: 0.94rem;
  font-weight: 700;
}

.invoice-customer-number {
  font-size: 0.68rem;
  font-weight: 600;
  color: #1f2937;
}

.invoice-continuation {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.15;
  color: #111827;
}

.invoice-subtitle,
.invoice-project,
.invoice-period,
.invoice-reference {
  font-size: 0.82rem;
  line-height: 1.28;
  white-space: pre-line;
  color: #111827;
}


.invoice-reference {
  position: absolute;
  font-size: 0.78rem;
  line-height: 1.24;
  white-space: pre-line;
}

.final-deduction-label {
  font-weight: 400;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 0.72rem;
  line-height: 1.18;
  background: transparent;
  color: #111827;
}

.invoice-table th,
.invoice-table td {
  border-bottom: 1px solid #d1d5db;
  padding: 0.22rem 0.24rem;
  vertical-align: top;
}

.invoice-table th {
  background: #f3f4f6;
  text-align: left;
  font-weight: 700;
  font-size: 0.71rem;
}

.col-qty {
  width: 52px;
}

.col-item {
  width: 92px;
}

.col-price,
.col-total {
  width: 96px;
  text-align: right;
}

.invoice-table td:last-child,
.invoice-table th:last-child,
.invoice-table td:nth-last-child(2),
.invoice-table th:nth-last-child(2) {
  text-align: right;
}

.sum-label {
  text-align: right;
  font-weight: 700;
}

.sum-value {
  font-weight: 700;
}

.grand-total-row td {
  font-size: 0.88rem;
  border-top: 2px solid #6b7280;
}

.invoice-bottom-row {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
}

.invoice-bottom-row-compact {
  gap: 0.55rem;
}

.footer-note {
  flex: 1 1 auto;
  max-width: 220px;
  font-size: 0.74rem;
  color: #111827;
  line-height: 1.34;
  white-space: pre-line;
}

.bank-box {
  font-size: 0.72rem;
  line-height: 1.32;
  color: #111827;
  max-width: 260px;
  flex: 0 0 260px;
  white-space: pre-line;
}

.qr-box {
  width: 108px;
  margin-left: auto;
  flex: 0 0 108px;
  text-align: center;
}

.qr-box img {
  width: 88px;
  height: 88px;
  border: 1px solid #cbd5e1;
  background: #fff;
  object-fit: contain;
}

.qr-caption {
  margin-top: 0.18rem;
  font-size: 0.62rem;
  color: #1f2937;
  line-height: 1.12;
}

.measure-root {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

.desc-line-measure {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 340px;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  line-height: 1.18;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 1320px) {
  .app-shell {
    width: min(100%, 760px);
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-panel {
    overflow: visible;
  }

  .invoice-preview-container {
    align-items: center;
  }

  .preview-panel .invoice-page {
    transform-origin: top center;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  .grid.two-cols {
    grid-template-columns: 1fr;
  }

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

  .position-grid {
    grid-template-columns: 1fr;
  }

  .invoice-page {
    width: 100%;
    min-height: auto;
    height: auto;
  }

  .invoice-content-layer {
    min-height: auto;
    height: auto;
  }

  .invoice-bottom-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-note,
  .bank-box {
    max-width: 100%;
  }

  .label-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


.cc-invoice-app {
  color: #1f2937;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.cc-invoice-frontend-wrap {
  max-width: 1560px;
  margin: 1.5rem auto;
}

.cc-invoice-frontend-wrap .site-header {
  border-radius: 12px;
}

.cc-invoice-login-card {
  max-width: 520px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.cc-invoice-login-card h2 {
  margin-top: 0;
}

.cc-invoice-login-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.cc-invoice-login-form input[type="text"],
.cc-invoice-login-form input[type="password"] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.58rem 0.72rem;
  font-size: 0.95rem;
  background: #fff;
  margin-bottom: 0.85rem;
}

.cc-invoice-login-form .login-remember {
  margin: 0.5rem 0 0.9rem;
}

.cc-invoice-login-form .button-primary {
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  background: #2563eb;
  color: #fff;
}


@media (max-width: 1550px) {
  .position-grid {
    grid-template-columns: 56px 108px minmax(220px, 1.7fr) 98px 122px;
  }
}

.hidden {
  display: none !important;
}

.invoice-type-notice,
.invoice-type-status {
  min-height: 1.2rem;
}

.type-notice-card,
.type-panel {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.95rem 1rem;
}

.type-notice-card {
  color: #1e3a8a;
  font-size: 0.9rem;
  line-height: 1.4;
}

.invoice-type-panel h3,
.final-payments-header h4 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.type-panel-grid {
  margin-bottom: 0.85rem;
}


.final-positions-host {
  margin-top: 0.25rem;
  margin-bottom: 0.85rem;
}

.final-positions-host .positions-toolbar {
  margin-top: 0.85rem;
}

.final-positions-host h2 {
  margin-top: 0;
}

.final-payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.progress-payment-rows {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.progress-payment-row {
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.85rem;
}

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

@media (max-width: 900px) {
  .progress-payment-grid {
    grid-template-columns: 1fr;
  }
}

.progress-details-block {
  position: absolute;
  color: #111827;
}

.progress-detail-line {
  margin-bottom: 0.38rem;
  font-size: 0.8rem;
  line-height: 1.26;
  color: #111827;
}

.progress-summary-card {
  margin-top: 0.62rem;
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,0.92);
}

.progress-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0.62rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.78rem;
  line-height: 1.18;
  color: #111827;
}

.progress-summary-row:last-child {
  border-bottom: none;
}

.progress-summary-header {
  font-weight: 700;
  background: #f8fafc;
}

.progress-summary-total {
  font-weight: 700;
  border-top: 2px solid #6b7280;
}

.progress-summary-value {
  text-align: right;
  white-space: normal;
  word-break: break-word;
}

.build-meta-section {
  position: absolute;
  color: #111827;
}

.build-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
}

.build-meta-item {
  padding-bottom: 0.16rem;
  border-bottom: 1px solid #e5e7eb;
}

.build-meta-item-wide {
  grid-column: 1 / -1;
}

.build-meta-label {
  font-size: 0.68rem;
  line-height: 1.15;
  font-weight: 700;
  color: #374151;
}

.build-meta-value {
  margin-top: 0.08rem;
  font-size: 0.77rem;
  line-height: 1.16;
  color: #111827;
}

.build-inline-note {
  margin-top: 0.32rem;
  font-size: 0.72rem;
  line-height: 1.22;
  color: #374151;
}


.final-summary-card {
  margin-top: 0.8rem;
}

.final-progress-row {
  font-size: 0.78rem;
}

.final-subtotal-row {
  font-weight: 700;
}

.final-warning,
.final-mode-hint {
  margin-top: 0.65rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #92400e;
}

.final-warning {
  color: #b91c1c;
  font-weight: 700;
}

.generator-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.generator-tab {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e3a8a;
  border-radius: 9px;
  padding: 0.62rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.generator-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.generator-tab-panel.hidden {
  display: none;
}

#savedInvoices {
  min-height: 240px;
}


#savedMasterCustomers {
  min-height: 220px;
}

.customer-master-grid {
  margin-top: 0.35rem;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 0.2rem;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.customer-status.is-error {
  color: #b91c1c;
}

.customer-status.is-success {
  color: #2563eb;
}

.customer-master-preview-card {
  width: 100%;
  max-width: 920px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.customer-master-preview-card.is-empty {
  max-width: 760px;
}

.customer-master-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 220px;
  gap: 1.2rem;
  align-items: start;
}

.customer-master-preview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.45rem;
}

.customer-master-preview-company {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.customer-master-preview-badge {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.customer-master-preview-subline,
.customer-master-preview-address {
  color: #475569;
  margin-bottom: 0.7rem;
}

.customer-master-preview-section {
  margin-top: 1rem;
}

.customer-master-preview-section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  color: #111827;
}

.customer-master-preview-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.22rem 0;
  border-bottom: 1px dashed #e5e7eb;
}

.customer-master-preview-row span {
  color: #64748b;
  font-size: 0.86rem;
}

.customer-master-preview-row strong {
  color: #0f172a;
  font-size: 0.9rem;
  word-break: break-word;
}

.customer-master-preview-notes {
  color: #1f2937;
  line-height: 1.55;
  white-space: normal;
}

.customer-master-preview-qr {
  text-align: center;
}

.customer-master-preview-qr img {
  width: 190px;
  height: 190px;
  display: block;
  margin: 0 auto 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.customer-master-preview-qr-caption {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .customer-master-preview-grid {
    grid-template-columns: 1fr;
  }

  .customer-master-preview-qr {
    text-align: left;
  }

  .customer-master-preview-qr img {
    margin-left: 0;
  }
}

.offer-page {
  position: relative;
  width: 794px;
  min-height: 1123px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.offer-content-layer {
  position: relative;
  z-index: 2;
  padding: 198px 60px 120px 66px;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
}

.collection-letter-page .offer-content-layer {
  padding-top: 240px;
}

.collection-header-row {
  display: block;
  margin-bottom: 18px;
}

.offer-address-block,
.offer-meta-block {
  font-size: 14px;
  line-height: 1.45;
}

.offer-address-block {
  max-width: 380px;
  margin-bottom: 24px;
}

.offer-meta-block {
  margin-top: 0;
  margin-bottom: 28px;
}

.collection-letter-page .offer-address-block,
.collection-letter-page .offer-meta-block {
  margin-bottom: 0;
}

.collection-reference-card {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 420px;
  margin: 0 0 18px;
}

.collection-reference-card .label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  color: #1e3a8a;
}

.collection-reference-card .muted {
  color: #475569;
}

.collection-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 0;
  margin: 12px 0 20px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.collection-detail-grid .cell {
  padding: 10px 12px;
  border-right: 1px solid #e5e7eb;
}

.collection-detail-grid .cell:last-child {
  border-right: none;
}

.collection-detail-grid .label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.collection-detail-grid .value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.offer-title {
  font-size: 20px;
  font-weight: 700;
  margin: 14px 0 14px;
}

.offer-project,
.offer-note,
.offer-intro {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.offer-table {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  margin: 18px 0 20px !important;
}



@media (max-width: 1100px) {
  .collection-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.customer-master-history {
  margin-top: 20px;
  border-top: 1px solid #dbe4f0;
  padding-top: 18px;
}

.customer-master-history--preview {
  display: none;
  margin-top: 18px;
  border-top: none;
  padding-top: 0;
}

.preview-panel .customer-master-history--preview {
  max-width: 100%;
}

.customer-master-history-header h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.customer-master-history-header p {
  margin: 0 0 12px;
  color: #5c6f91;
  font-size: 0.92rem;
}

.customer-master-history-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.customer-master-history-empty {
  border: 1px dashed #d7e0ec;
  border-radius: 12px;
  background: #f8fbff;
  color: #5c6f91;
  padding: 0.95rem 1rem;
  font-size: 0.92rem;
}

.customer-master-history-item {
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  background: #fff;
  padding: 0.82rem 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.customer-master-history-item:hover,
.customer-master-history-item:focus-within {
  border-color: #bfdbfe;
  background: #f5f9ff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.08);
}

.customer-master-history-item + .customer-master-history-item {
  margin-top: 0.62rem;
}

.customer-master-history-item.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.customer-master-history-item-top,
.customer-master-history-item-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.customer-master-history-item-bottom {
  margin-top: 0.56rem;
}

.customer-master-history-meta,
.customer-master-history-secondary {
  min-width: 0;
}

.customer-master-history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.customer-master-history-line + .customer-master-history-line {
  margin-top: 0.3rem;
}

.customer-master-history-number {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.98rem;
}

.customer-master-history-date,
.customer-master-history-amount,
.customer-master-history-project,
.customer-master-history-action {
  color: #475569;
  font-size: 0.9rem;
}

.customer-master-history-project {
  color: #0f4c81;
}

.customer-master-history-line-muted {
  margin-top: 0.12rem;
}

.customer-master-history-type {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  color: #123f7a;
  background: #e5efff;
}

.customer-master-history-type.type-re {
  background: #e5efff;
  color: #123f7a;
}

.customer-master-history-type.type-ar {
  background: #fff2dd;
  color: #9a5b00;
}

.customer-master-history-type.type-sr {
  background: #efe6ff;
  color: #5a2ea6;
}

.customer-master-history-type.type-an {
  background: #e8f8ef;
  color: #0e6b3f;
}

.customer-master-history-open {
  padding: 7px 12px;
  border: 1px solid #b8c8e1;
  border-radius: 8px;
  background: #fff;
  color: #123f7a;
  cursor: pointer;
}

.customer-master-history-open:hover {
  background: #f5f9ff;
}


.customer-master-history-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-shell.is-customer-master-layout {
  grid-template-columns: minmax(0, 660px) minmax(0, 780px);
}

.app-shell.is-customer-master-layout .customer-master-grid {
  grid-template-columns: 1fr 1fr;
}

.app-shell.is-customer-master-layout .preview-panel {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

@media (max-width: 1180px) {
  .app-shell.is-customer-master-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .customer-master-history-item-top,
  .customer-master-history-item-bottom {
    grid-template-columns: 1fr;
  }

  .customer-master-history-actions {
    justify-content: flex-start;
  }
}


.open-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.open-items-empty {
  border: 1px dashed #d7e0ec;
  border-radius: 12px;
  background: #f8fbff;
  color: #5c6f91;
  padding: 0.95rem 1rem;
  font-size: 0.92rem;
}

.open-item-card {
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem 0.95rem;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.open-item-card:hover,
.open-item-card:focus-within {
  border-color: #bfdbfe;
  background: #f5f9ff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.08);
}

.open-item-card.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.open-item-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.72rem;
  align-items: start;
}

.open-item-main {
  min-width: 0;
}

.open-item-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.open-item-line + .open-item-line {
  margin-top: 0.35rem;
}

.open-item-customer {
  color: #0f172a;
  font-weight: 600;
}

.open-item-meta {
  color: #475569;
  font-size: 0.92rem;
}

.open-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}

.open-item-actions .small-btn,
.open-item-actions .customer-master-history-paid-toggle {
  width: 100%;
  justify-content: center;
}

@media (max-width: 980px) {
  .open-item-top {
    grid-template-columns: 1fr;
  }

  .open-item-actions {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .recipient-card-grid--invoice,
  .recipient-card-grid--unified {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipient-card-grid--invoice .recipient-col-type,
  .recipient-card-grid--invoice .recipient-col-name,
  .recipient-card-grid--invoice .recipient-col-half,
  .recipient-card-grid--invoice .recipient-col-full,
  .recipient-card-grid--invoice .recipient-col-zip,
  .recipient-card-grid--invoice .recipient-col-city,
  .recipient-card-grid--unified .recipient-col-name-wide,
  .recipient-card-grid--unified .recipient-col-half,
  .recipient-card-grid--unified .recipient-col-full,
  .recipient-card-grid--unified .recipient-col-zip,
  .recipient-card-grid--unified .recipient-col-city {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .recipient-card-grid {
    grid-template-columns: 1fr;
  }

  .recipient-card-grid--invoice .recipient-col-type,
  .recipient-card-grid--invoice .recipient-col-name,
  .recipient-card-grid--invoice .recipient-col-half,
  .recipient-card-grid--invoice .recipient-col-full,
  .recipient-card-grid--invoice .recipient-col-zip,
  .recipient-card-grid--invoice .recipient-col-city,
  .recipient-card-grid--unified .recipient-col-name-wide,
  .recipient-card-grid--unified .recipient-col-half,
  .recipient-card-grid--unified .recipient-col-full,
  .recipient-card-grid--unified .recipient-col-zip,
  .recipient-card-grid--unified .recipient-col-city {
    grid-column: 1;
  }
}

.settings-section-card {
  background: #f8fafc;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.settings-section-card h3 {
  margin: 0 0 12px;
  color: #0f172a;
}
.settings-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settings-number-card {
  background: #fff;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  padding: 14px;
}
.settings-number-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #1e3a8a;
}
.field-group--checkbox {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.field-group--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 10px;
}
@media (max-width: 900px) {
  .settings-number-grid { grid-template-columns: 1fr; }
}

.build-project-import-card {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.9rem 1rem;
}

.build-inline-actions {
  justify-content: flex-start;
}

#savedBuildProjects,
#buildProjectSelect {
  min-height: 220px;
}

.build-project-history-wrap {
  overflow-x: auto;
}


.build-project-inline-card h4 {
  margin: 0 0 12px;
  color: #1e3a8a;
}

.build-project-customer-row {
  align-items: end;
}

/* 0.4.21 – professionelle Verdichtung und Vorschau ohne interne Scrollbalken */
.generator-primary-tab {
  padding: 0.62rem 1.05rem;
  border-radius: 9px;
}

.generator-subtabs {
  padding: 0.42rem;
  border-radius: 11px;
}

.generator-tab {
  padding: 0.5rem 0.78rem;
  border-radius: 8px;
}

.form-panel {
  font-size: 0.92rem;
}

.preview-panel {
  min-width: 0;
}

.preview-panel .preview-header h2 {
  margin-bottom: 0.25rem;
}

.preview-panel .page-info {
  margin-top: 0.1rem;
}

.customer-status {
  min-height: 1rem;
  font-size: 0.78rem;
}

.template-status {
  min-height: 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
}

@media (max-width: 1320px) {
  .app-shell {
    width: min(100%, 980px);
    max-width: 980px;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .preview-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* 0.4.22 – Standard-Rechnungspositionen schlanker und fachlicher */
#standardInvoiceSections .positions-toolbar {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

#standardInvoiceSections .position-grid .field-group label {
  font-size: 0.76rem;
  color: #334155;
}

#standardInvoiceSections .position-grid input,
#standardInvoiceSections .position-grid textarea {
  font-size: 0.86rem;
}

#standardInvoiceSections .readonly-field input {
  background: #eef4fb;
}

#standardInvoiceSections .remove-row-btn {
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
}

@media (min-width: 1181px) {
  #standardInvoiceSections .position-row {
    border-radius: 7px;
  }
}

/* 0.4.23 – E-Rechnung Architekturvorbereitung */
.einvoice-box {
  margin: 0.55rem 0 0.7rem;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  padding: 0.62rem;
}

.einvoice-box summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f2f6e;
}

.einvoice-box .grid {
  margin-top: 0.5rem;
}

.settings-section-card h3 + .help-text {
  margin-bottom: 0.55rem;
}

/* 0.4.24 – Einheitenauswahl und Standard-Rechnung Feinschliff */
.settings-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.35rem 0.55rem;
  margin: 0.48rem 0 0.62rem;
}

.settings-unit-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.45rem;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
}

.settings-unit-grid input {
  width: auto;
  margin: 0;
}

/* 0.4.25 – E-Rechnungs-Datencheck und Einheitenhinweis */
.einvoice-status {
  margin-top: 0.55rem;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef4ff;
  color: #1e3a8a;
  padding: 0.5rem 0.62rem;
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 700;
}

.einvoice-status.is-warn {
  border-color: #facc15;
  background: #fffbeb;
  color: #92400e;
}

.einvoice-status.is-info {
  border-color: #c7d2fe;
  background: #eef4ff;
  color: #1e3a8a;
}

/* 0.4.26 – E-Rechnungs-Stammdaten vollständig vorbereiten */
.einvoice-settings-status {
  margin-top: 0.6rem;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef4ff;
  color: #1e3a8a;
  padding: 0.5rem 0.62rem;
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 700;
}

.einvoice-settings-status.is-warn {
  border-color: #facc15;
  background: #fffbeb;
  color: #92400e;
}

.einvoice-settings-status.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

/* 0.4.27 – E-Rechnungs-Datenvorschau und JSON-Export */
.einvoice-checklist {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.3rem;
}

.einvoice-check-item {
  display: grid;
  grid-template-columns: 56px minmax(145px, 0.9fr) minmax(180px, 1.4fr);
  gap: 0.45rem;
  align-items: center;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 0.38rem 0.48rem;
  font-size: 0.78rem;
}

.einvoice-check-item.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.einvoice-check-item.is-open {
  border-color: #fde68a;
  background: #fffbeb;
}

.einvoice-check-state {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  font-weight: 800;
  color: #ffffff;
  background: #ca8a04;
  font-size: 0.68rem;
}

.einvoice-check-item.is-ok .einvoice-check-state {
  background: #16a34a;
}

.einvoice-check-label {
  font-weight: 800;
  color: #1f2937;
}

.einvoice-check-info {
  color: #475569;
}

.einvoice-actions {
  margin-top: 0.5rem;
}

@media (max-width: 760px) {
  .einvoice-check-item {
    grid-template-columns: 1fr;
  }

  .einvoice-check-state {
    justify-self: start;
  }
}

/* 0.4.28 – E-Rechnung Bankdaten-Übernahme und Live-Readiness */
.einvoice-settings-actions {
  margin-top: 0.55rem;
}

.einvoice-settings-actions .secondary-btn {
  white-space: normal;
}

/* 0.4.29 – Speicherhinweise für E-Rechnung */
.save-scope-note {
  margin-top: 0.55rem;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  padding: 0.48rem 0.58rem;
  font-size: 0.78rem;
  line-height: 1.38;
}

.save-scope-note strong {
  color: #0f2f6e;
}

/* 0.4.30 – Stabilitätsfix Navigation/E-Rechnung */
.generator-tab.hidden {
  display: none !important;
}

/* 0.4.31 – Kunden-Stammdaten für E-Rechnung */
#masterVatId,
#masterInvoiceEmail {
  font-feature-settings: "tnum";
}

/* 0.4.32 – XRechnung XML-Entwurf */
.einvoice-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.einvoice-actions .primary-btn,
.einvoice-actions .secondary-btn {
  white-space: normal;
}

/* 0.4.33 – XRechnung XML-Entwurf fachlich erweitert */
.einvoice-check-item .einvoice-check-label {
  hyphens: auto;
}

/* 0.4.34 – ZUGFeRD/Factur-X XML-Entwurf */
.einvoice-actions .primary-btn {
  min-width: 220px;
}

/* 0.4.36 – E-Rechnung ansehen und prüfen */
.einvoice-readable-view {
  margin-top: 0.55rem;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #ffffff;
  padding: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.36;
}

.einvoice-readable-view.is-ready {
  border-color: #86efac;
  background: #f7fef9;
}

.einvoice-readable-view.is-warning {
  border-color: #facc15;
  background: #fffbeb;
}

.einvoice-readable-view.is-error {
  border-color: #fca5a5;
  background: #fff1f2;
}

.einvoice-readable-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.einvoice-readable-head strong {
  display: block;
  color: #0f2f6e;
  font-size: 0.9rem;
}

.einvoice-readable-head span {
  color: #475569;
}

.einvoice-readable-badge {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #e2e8f0;
  color: #0f172a !important;
  font-weight: 800;
  white-space: nowrap;
}

.einvoice-readable-view.is-ready .einvoice-readable-badge {
  background: #bbf7d0;
  color: #166534 !important;
}

.einvoice-readable-view.is-warning .einvoice-readable-badge {
  background: #fde68a;
  color: #92400e !important;
}

.einvoice-readable-view.is-error .einvoice-readable-badge {
  background: #fecaca;
  color: #991b1b !important;
}

.einvoice-readable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
  margin-bottom: 0.55rem;
}

.einvoice-readable-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.42rem 0.48rem;
}

.einvoice-readable-grid h4 {
  margin: 0 0 0.28rem;
  font-size: 0.78rem;
  color: #0f2f6e;
}

.einvoice-readable-grid p {
  margin: 0;
  color: #334155;
}

.einvoice-readable-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.3rem;
  font-size: 0.76rem;
}

.einvoice-readable-table th,
.einvoice-readable-table td {
  border: 1px solid #dbe4f0;
  padding: 0.32rem 0.36rem;
  text-align: left;
  vertical-align: top;
}

.einvoice-readable-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

.einvoice-readable-table .num,
.einvoice-readable-table tfoot td:last-child {
  text-align: right;
}

.einvoice-readable-table tfoot td {
  font-weight: 800;
  background: #f8fafc;
}

.einvoice-readable-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.55rem;
  color: #475569;
}

.einvoice-report {
  margin-top: 0.55rem;
  border: 1px solid #dbe4f0;
  border-radius: 9px;
  background: #f8fafc;
  padding: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.36;
}

.einvoice-report.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
}

.einvoice-report.is-warning {
  border-color: #facc15;
  background: #fffbeb;
}

.einvoice-report.is-error {
  border-color: #fca5a5;
  background: #fff1f2;
}

.einvoice-report-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.45rem;
  color: #0f172a;
}

.einvoice-report-head span {
  font-weight: 800;
}

.einvoice-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.einvoice-report-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.38rem 0.45rem;
}

.einvoice-report ul {
  margin: 0.45rem 0 0 1.2rem;
  padding: 0;
}

@media (max-width: 900px) {
  .einvoice-readable-grid,
  .einvoice-report-grid {
    grid-template-columns: 1fr 1fr;
  }

  .einvoice-readable-foot {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .einvoice-readable-grid,
  .einvoice-report-grid {
    grid-template-columns: 1fr;
  }

  .einvoice-readable-head,
  .einvoice-report-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 0.4.39 – Bauprojekt-Rechnung Verknüpfung */
.build-link-status {
  margin-top: 0.45rem;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 700;
}

.build-link-status.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

/* 0.4.40 – Bau-Gewerk-Rechnung Grundmaske */
.build-trade-type-panel textarea {
  min-height: 4.2rem;
}

.build-trade-summary-card .progress-summary-row .progress-summary-value {
  white-space: normal;
}

.build-trade-description {
  margin-top: 0.35rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

/* 0.4.41 – Bau-Gewerk-Rechnung Rechenblock */
.build-trade-calc-panel {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.7rem;
}

.build-trade-calc-panel h4 {
  margin: 0 0 0.25rem;
  color: #0f2f6e;
  font-size: 0.95rem;
}

.compact-grid.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.checkbox-line {
  align-self: end;
  min-height: 2.3rem;
  display: flex;
  align-items: center;
}

.checkbox-line label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
}

.build-trade-invoice-page .invoice-subtitle {
  line-height: 1.28;
}

.build-trade-invoice-page .progress-details-block {
  line-height: 1.24;
}

.build-trade-invoice-page .progress-detail-line {
  margin: 0 0 0.15rem;
}

.build-trade-invoice-page .build-trade-description {
  margin-top: 0.22rem;
  padding-top: 0.16rem;
}

.build-trade-summary-card {
  margin-top: 0.45rem;
}

.build-trade-summary-card .progress-summary-row {
  min-height: 0;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

.build-trade-summary-card .progress-summary-header,
.build-trade-summary-card .progress-summary-total {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.build-trade-note-row {
  font-size: 0.82em;
  color: #334155;
}

@media (max-width: 980px) {
  .compact-grid.four-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .compact-grid.four-cols {
    grid-template-columns: 1fr;
  }
}

/* 0.4.42 – Startauswahl / Rechnungstyp-Assistent */
.create-start-assistant {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.72rem;
  margin: 0 0 0.85rem;
}

.create-start-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.create-start-head h2 {
  margin: 0 0 0.18rem !important;
}

.create-start-head p {
  margin: 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.35;
}

.create-mode-field--compact {
  min-width: 220px;
  max-width: 280px;
}

.create-type-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.create-type-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  text-align: left;
  cursor: pointer;
  min-height: 76px;
}

.create-type-card strong {
  display: block;
  color: #0f2f6e;
  margin-bottom: 0.22rem;
  font-size: 0.9rem;
}

.create-type-card span {
  display: block;
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.28;
}

.create-type-card.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: #eff6ff;
}

.build-trade-assistant {
  margin-top: 0.65rem;
  border-top: 1px solid #dbe4f0;
  padding-top: 0.62rem;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 0.7rem;
}

.assistant-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  color: #0f2f6e;
}

.assistant-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.assistant-choice {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f2f6e;
  padding: 0.34rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.assistant-choice.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.create-mode-hint {
  margin-top: 0.62rem;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  padding: 0.48rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.34;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .create-start-head,
  .build-trade-assistant {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .create-type-cards {
    grid-template-columns: 1fr;
  }

  .create-mode-field--compact {
    min-width: 100%;
    max-width: 100%;
  }
}

/* 0.4.43 – Dashboard & Navigationsbereinigung */
.cc-dashboard-nav-wrap {
  margin-top: 0.85rem;
}

.cc-dashboard-menu {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.cc-dashboard-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  text-align: left;
  cursor: pointer;
  min-height: 92px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cc-dashboard-card strong {
  display: block;
  color: #0f2f6e;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  line-height: 1.15;
}

.cc-dashboard-card span {
  display: block;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.28;
}

.cc-dashboard-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.cc-dashboard-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.cc-legacy-tabs.hidden {
  display: none !important;
}

.create-start-assistant {
  padding-top: 0.62rem;
}

.create-start-head--simple {
  margin-bottom: 0.48rem;
}

.create-start-head--simple h2 {
  font-size: 1.05rem;
}

.create-mode-field--hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.choice-status {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 900;
}

.assistant-choice.is-disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.assistant-choice.is-disabled:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f2f6e;
}

@media (max-width: 1320px) {
  .cc-dashboard-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cc-dashboard-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .cc-dashboard-menu {
    grid-template-columns: 1fr;
  }

  .cc-dashboard-card {
    min-height: auto;
  }
}

/* 0.4.44 – Dashboard-Karten funktional */
.cc-dashboard-card {
  user-select: none;
}

.cc-dashboard-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.cc-dashboard-card.is-active strong {
  color: #0b3aa4;
}

.cc-dashboard-card.is-active span {
  color: #1e3a8a;
}

.cc-dashboard-card[aria-current="page"] {
  position: relative;
}

.cc-dashboard-card[aria-current="page"]::after {
  content: "aktiv";
  position: absolute;
  right: 0.55rem;
  top: 0.5rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.08rem 0.35rem;
}

/* 0.4.45 – Auswahlkarten zentriert und Arbeitsbereich getrennt */
.cc-dashboard-nav-wrap {
  width: min(100%, 1500px);
  margin-left: auto;
  margin-right: auto;
}

.cc-dashboard-menu {
  width: min(100%, 1450px);
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.cc-create-flow-stage {
  width: min(100%, 1180px);
  margin: 0.75rem auto 0.65rem;
  padding: 0 0.6rem;
}

.cc-create-flow-stage .create-start-assistant {
  margin: 0 auto;
}

.create-start-assistant.hidden {
  display: none !important;
}

.create-type-cards {
  width: min(100%, 980px);
  margin-left: auto;
  margin-right: auto;
}

.create-type-card {
  min-height: 88px;
}

.build-trade-card-assistant {
  display: block;
  border-top: 1px solid #dbe4f0;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.build-trade-card-assistant.hidden {
  display: none !important;
}

.build-trade-card-assistant .assistant-section + .assistant-section {
  margin-top: 0.7rem;
}

.build-trade-card-assistant .assistant-section h3 {
  text-align: center;
  font-size: 0.92rem;
  margin: 0 0 0.45rem;
  color: #0f2f6e;
}

.assistant-card-grid {
  display: grid;
  gap: 0.55rem;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.assistant-card-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1050px);
}

.assistant-card-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 620px);
}

.assistant-card {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 0.62rem 0.68rem;
  text-align: left;
  cursor: pointer;
  min-height: 84px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.assistant-card strong {
  display: block;
  color: #0f2f6e;
  margin-bottom: 0.22rem;
  font-size: 0.84rem;
  line-height: 1.15;
}

.assistant-card span {
  display: block;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.28;
}

.assistant-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.assistant-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.assistant-card.is-disabled:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.assistant-card-hint {
  text-align: center;
  margin-top: 0.42rem;
}

.create-mode-hint {
  width: min(100%, 980px);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.preview-header p {
  display: none !important;
}

.preview-panel .preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: 0.15rem;
}

.preview-panel .preview-header h2 {
  margin-bottom: 0.1rem;
}

.page-info {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .assistant-card-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .assistant-card-grid--four,
  .assistant-card-grid--two {
    grid-template-columns: 1fr;
  }
}

/* 0.4.46 – Bau-Gewerk-Abrechnungsarten funktional */
.build-trade-previous-field.hidden {
  display: none !important;
}

.build-trade-type-panel .help-text#buildTradeNetAmountHelp,
.build-trade-type-panel .help-text#buildTradePreviousAmountHelp {
  min-height: 1.9em;
}

.build-trade-summary-card .progress-summary-row.build-trade-note-row {
  font-size: 0.78em;
}

.build-trade-summary-card .progress-summary-row.build-trade-note-row > div {
  grid-column: 1 / -1;
  text-align: left;
}

/* 0.4.47 – Bauprojekt-Auswahl in Bau-Gewerk-Rechnung */
.build-trade-project-card {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.7rem;
}

.build-trade-project-card .action-row {
  margin-top: 0.45rem;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.build-trade-project-card .build-link-status {
  margin-top: 0.45rem;
}

.build-link-status.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* 0.4.48 – Optionale Rechnungszeilen nur bei Eingabe */
.build-trade-summary-card .progress-summary-row:empty {
  display: none;
}

.build-trade-summary-card .progress-summary-row {
  break-inside: avoid;
}

/* 0.4.49 – Optionale Summenzeilen global */
.invoice-table tfoot tr:empty,
.progress-summary-card .progress-summary-row:empty {
  display: none;
}

/* 0.4.50 – Kompaktes Nummernkreis-System */
.cc-number-system-card .compact-number-grid {
  align-items: start;
}

.number-live-preview {
  min-height: 2.35rem;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.55rem 0.65rem;
  font-weight: 900;
  color: #0f2f6e;
}

.settings-shared-number-row,
.settings-per-type-number-row {
  margin-top: 0.75rem;
}

.settings-number-compact-table {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.settings-number-compact-head,
.settings-number-compact-row {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 0.8fr 1fr;
  gap: 0.45rem;
  align-items: center;
  padding: 0.48rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.settings-number-compact-head {
  background: #f1f5f9;
  color: #0f2f6e;
  font-size: 0.78rem;
  font-weight: 900;
}

.settings-number-compact-row:last-child {
  border-bottom: 0;
}

.settings-number-compact-row input {
  min-height: 2.05rem;
  padding: 0.35rem 0.45rem;
}

.settings-number-compact-row span:last-child {
  font-weight: 900;
  color: #1d4ed8;
}

.number-duplicate-status {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.number-duplicate-status.is-error {
  color: #b91c1c;
}

.number-duplicate-status.is-ready {
  color: #2563eb;
}

@media (max-width: 780px) {
  .settings-number-compact-head {
    display: none;
  }

  .settings-number-compact-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* 0.4.51 – Nummernformat-Platzhalter und Änderungswarnung */
.number-placeholder-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.42rem;
}

.number-placeholder-chip {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f2f6e;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
}

.number-placeholder-chip:hover,
.number-placeholder-chip:focus-visible {
  border-color: #2563eb;
  background: #eff6ff;
  outline: none;
}

.number-live-preview.is-warning,
.settings-number-compact-row span.is-warning {
  color: #b45309 !important;
  background: #fffbeb;
}

.number-unsaved-status {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.number-unsaved-status.is-warning {
  color: #b45309;
}

.number-unsaved-status.is-ready {
  color: #2563eb;
}

/* 0.4.52 – Leeres Nummernformat stellt Standard wieder her */
.number-unsaved-status.is-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.42rem 0.55rem;
}

/* 0.4.53 – Nummernformat live und korrekte SEQ-Ermittlung */
.number-placeholder-chip {
  user-select: none;
}

/* 0.4.54 – Standard-Nummernübernahme und Angebotslayout */
.offer-page .offer-title {
  font-size: 20px !important;
  line-height: 1.25;
  margin: 14px 0 14px !important;
}

/* 0.4.56 – EPC/GiroCode QR-Fallback */
.qr-box img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

/* 0.4.57 – Bau-Gewerk-Skonto als Zahlungsoption oder echter Abzug */
.build-trade-discount-mode .help-text {
  margin-top: 0.25rem;
  line-height: 1.35;
}

.build-trade-summary-card .build-trade-skonto-row {
  background: #fffdf5;
}

.build-trade-summary-card .build-trade-pay-with-skonto {
  background: #f0fdf4;
}

.build-trade-summary-card .build-trade-gross-before-discount {
  border-top: 2px solid #94a3b8;
}

/* 0.4.58 – Skonto sichtbar und global */
.skonto-mode-field {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 0.6rem;
}

.skonto-row {
  background: #fffdf5;
}

.skonto-pay-row {
  background: #f0fdf4;
}

.build-trade-discount-select {
  margin-top: 0.2rem;
}

/* 0.4.59 – Skonto logisch getrennt: Option vs. echter Abzug */
.build-trade-discount-mode {
  display: none !important;
}

.skonto-deduct-row {
  background: #fff7ed;
}

.skonto-option-row {
  background: #f8fafc;
}

.skonto-option-pay-row {
  background: #eef6ff;
  font-weight: 700;
}

.skonto-note-row td,
.build-trade-note-row {
  font-size: 9px;
  color: #475569;
  background: #ffffff;
}

.skonto-pay-row {
  background: #f0fdf4;
  font-weight: 800;
}

/* 0.4.60 – Bau-Gewerk-Abrechnungsarten klarer getrennt */
.build-trade-guidance {
  margin: 0.45rem 0 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #0f2f6e;
  font-weight: 700;
  line-height: 1.35;
}

.build-trade-contract-field,
.build-trade-progress-field {
  transition: opacity 0.15s ease;
}

/* 0.4.61 – Bau-Gewerk-Leistungspositionen */
.build-trade-positions-panel {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.75rem;
}

.build-trade-position-head,
.build-trade-position-row {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 2.6fr 1fr 1fr auto;
  gap: 0.45rem;
  align-items: start;
}

.build-trade-position-head {
  font-size: 0.78rem;
  font-weight: 900;
  color: #0f2f6e;
  margin: 0.4rem 0;
}

.build-trade-position-row {
  margin-bottom: 0.45rem;
}

.build-trade-position-row textarea {
  min-height: 42px;
  resize: vertical;
}

.build-trade-pos-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 36px;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d7dfef;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
}

.build-trade-positions-total {
  margin-top: 0.45rem;
  text-align: right;
  font-weight: 900;
  color: #0f2f6e;
}

.tiny-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
}

.build-trade-position-table {
  margin-top: 6px;
  margin-bottom: 8px;
}

/* 0.4.62 – Bau-Gewerk-Abrechnung verständlicher */
.build-trade-guidance,
#buildTradePositionsHelp {
  line-height: 1.42;
}

.build-trade-summary-card .progress-summary-row div:first-child {
  overflow-wrap: anywhere;
}

/* 0.4.65 – Projektakte und Bau-/Handwerkerrechnung stabilisieren */
.build-trade-position-table {
  table-layout: fixed;
  width: 100%;
}

.build-trade-position-table th,
.build-trade-position-table td,
.build-trade-summary-card .progress-summary-row {
  box-sizing: border-box;
}

.build-trade-position-table th:nth-child(1),
.build-trade-position-table td:nth-child(1) { width: 10%; }
.build-trade-position-table th:nth-child(2),
.build-trade-position-table td:nth-child(2) { width: 13%; }
.build-trade-position-table th:nth-child(3),
.build-trade-position-table td:nth-child(3) { width: 39%; }
.build-trade-position-table th:nth-child(4),
.build-trade-position-table td:nth-child(4) { width: 18%; text-align: right; }
.build-trade-position-table th:nth-child(5),
.build-trade-position-table td:nth-child(5) { width: 20%; text-align: right; }

.build-trade-position-table td {
  overflow-wrap: anywhere;
}

/* 0.4.66 – Nummernkreis- und Projektabrechnungsstabilisierung */


/* 0.4.67 – E-Rechnungs-Prüfung erkennt Bau-Gewerk-/Projektabrechnungsbeträge */

/* 0.4.68 – Zahlungsziel/E-Rechnung Zahlungsbedingungen stabilisiert */
.einvoice-allowance-row td {
  background: #fffaf0;
  color: #5a4210;
}

#invoicePaymentGoalDays {
  max-width: 10rem;
}

/* 0.4.70 – JS-Scope-Fix für Zahlungsziel-Feld in Vorschau und Rechnungssuche */


/* 0.4.73 – Tabellen im Briefkopf transparenter, damit Wasserzeichen sichtbar bleiben */
.preview-panel .invoice-page .invoice-table,
.preview-panel .invoice-page .invoice-table tbody,
.preview-panel .invoice-page .invoice-table tr,
.preview-panel .invoice-page .invoice-table td {
  background: transparent;
}

.preview-panel .invoice-page .invoice-table th {
  background: rgba(243, 244, 246, 0.72);
}

.preview-panel .invoice-page .invoice-table .grand-total-row td {
  background: rgba(255, 255, 255, 0.28);
}

.preview-panel .invoice-page .invoice-table .skonto-row td,
.preview-panel .invoice-page .invoice-table .build-trade-skonto-row td {
  background: rgba(255, 253, 245, 0.75);
}

.preview-panel .invoice-page .invoice-table .skonto-pay-row td,
.preview-panel .invoice-page .invoice-table .build-trade-pay-with-skonto td {
  background: rgba(240, 253, 244, 0.78);
}

.preview-panel .invoice-page .invoice-table .skonto-deduct-row td {
  background: rgba(255, 247, 237, 0.78);
}

.preview-panel .invoice-page .invoice-table .skonto-option-row td {
  background: rgba(248, 250, 252, 0.78);
}

.preview-panel .invoice-page .invoice-table .skonto-option-pay-row td {
  background: rgba(238, 246, 255, 0.82);
}

.preview-panel .invoice-page .invoice-table .skonto-note-row td,
.preview-panel .invoice-page .invoice-table .build-trade-note-row {
  background: transparent;
}


/* 0.4.74 – Transparenz und Textfluss für Bau-/Projekt-Zusammenfassungen */
.preview-panel .invoice-page .progress-details-block,
.preview-panel .invoice-page .build-summary-block,
.preview-panel .invoice-page .final-summary-block,
.preview-panel .invoice-page .continuation-summary-block {
  background: transparent;
}

.preview-panel .invoice-page .progress-summary-card {
  background: rgba(255, 255, 255, 0.18);
}

.preview-panel .invoice-page .progress-summary-row {
  background: transparent;
}

.preview-panel .invoice-page .progress-summary-header {
  background: rgba(248, 250, 252, 0.72);
}

.preview-panel .invoice-page .progress-summary-total,
.preview-panel .invoice-page .final-subtotal-row,
.preview-panel .invoice-page .build-trade-gross-before-discount {
  background: rgba(255, 255, 255, 0.28);
}

.preview-panel .invoice-page .progress-summary-row.skonto-row,
.preview-panel .invoice-page .progress-summary-row.build-trade-skonto-row,
.preview-panel .invoice-page .progress-summary-row.skonto-deduct-row,
.preview-panel .invoice-page .progress-summary-row.skonto-option-row {
  background: rgba(255, 253, 245, 0.72);
}

.preview-panel .invoice-page .progress-summary-row.skonto-pay-row,
.preview-panel .invoice-page .progress-summary-row.skonto-option-pay-row,
.preview-panel .invoice-page .progress-summary-row.build-trade-pay-with-skonto {
  background: rgba(240, 253, 244, 0.74);
}

.preview-panel .invoice-page .progress-summary-row.build-trade-note-row {
  background: transparent;
}


/* 0.4.79 – Kompakte Umsatzübersicht mit Monatsfilter und offenen Posten */
.revenue-overview-card {
  border: 1px solid #d7e0ec;
  border-radius: 14px;
  background: #f8fbff;
  padding: 0.9rem;
  margin: 0.85rem 0 1.2rem;
}

.revenue-overview-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(160px, 0.8fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.revenue-overview-controls .field-group {
  margin-bottom: 0;
}

.revenue-overview-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.revenue-summary-pill {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.65rem 0.7rem;
  min-width: 0;
}

.revenue-summary-pill span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.revenue-summary-pill strong {
  display: block;
  margin-top: 0.2rem;
  color: #0f172a;
  font-size: 0.98rem;
  white-space: nowrap;
}

.revenue-summary-pill.is-paid {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.revenue-summary-pill.is-open {
  background: #fffbeb;
  border-color: #fde68a;
}

.revenue-table-wrap {
  max-height: 440px;
  overflow: auto;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #ffffff;
}

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

.revenue-overview-table th,
.revenue-overview-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.48rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.revenue-overview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  color: #0f2f6e;
  font-weight: 900;
}

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

.revenue-overview-row {
  cursor: pointer;
}

.revenue-overview-row:hover,
.revenue-overview-row:focus {
  background: #eff6ff;
  outline: none;
}

.revenue-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.48rem;
  font-size: 0.74rem;
  font-weight: 900;
}

.revenue-status.is-paid {
  background: #dcfce7;
  color: #166534;
}

.revenue-status.is-open {
  background: #fef3c7;
  color: #92400e;
}

.open-items-subtitle {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.05rem;
  color: #0f172a;
}

@media (max-width: 1180px) {
  .revenue-overview-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .revenue-overview-controls {
    grid-template-columns: 1fr;
  }
  .revenue-overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* 0.4.80 – Umsatzliste einzeilig und ohne horizontale Scroll-Leiste */
.revenue-table-wrap {
  overflow-x: hidden;
}

.revenue-overview-table {
  table-layout: fixed;
  min-width: 0;
}

.revenue-overview-table th,
.revenue-overview-table td {
  padding: 0.42rem 0.45rem;
  vertical-align: middle;
}

.revenue-overview-table th:nth-child(1),
.revenue-overview-table td:nth-child(1) { width: 15%; }
.revenue-overview-table th:nth-child(2),
.revenue-overview-table td:nth-child(2) { width: 18%; }
.revenue-overview-table th:nth-child(3),
.revenue-overview-table td:nth-child(3) { width: 12%; }
.revenue-overview-table th:nth-child(4),
.revenue-overview-table td:nth-child(4) { width: 15%; }
.revenue-overview-table th:nth-child(5),
.revenue-overview-table td:nth-child(5) { width: 14%; }
.revenue-overview-table th:nth-child(6),
.revenue-overview-table td:nth-child(6) { width: 16%; }
.revenue-overview-table th:nth-child(7),
.revenue-overview-table td:nth-child(7) { width: 10%; }

.revenue-overview-table .revenue-date,
.revenue-overview-table .revenue-number,
.revenue-overview-table .revenue-status-cell,
.revenue-overview-table .num,
.revenue-overview-table .revenue-action {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.revenue-overview-table .revenue-action,
.revenue-overview-table .revenue-action-head {
  text-align: right;
}

.revenue-open-btn {
  padding: 0.28rem 0.45rem;
  min-height: 0;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .revenue-overview-table {
    font-size: 0.78rem;
  }
  .revenue-open-btn {
    padding: 0.24rem 0.35rem;
  }
}


/* 0.4.81 – Offene-Posten-Ansicht: mehr Platz links, kleinere Vorschau, kompakter Aktionsbutton */
.app-shell.is-open-items-layout {
  grid-template-columns: minmax(0, 790px) minmax(0, 620px);
}

.app-shell.is-open-items-layout .preview-panel .invoice-page {
  transform: scale(0.72);
  transform-origin: top center;
  margin-bottom: -315px;
}

.app-shell.is-open-items-layout .revenue-overview-card {
  padding: 0.78rem;
}

.app-shell.is-open-items-layout .revenue-overview-table {
  font-size: 0.8rem;
}

.app-shell.is-open-items-layout .revenue-overview-table th,
.app-shell.is-open-items-layout .revenue-overview-table td {
  padding: 0.34rem 0.34rem;
}

.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(1),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(1) { width: 14%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(2),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(2) { width: 19%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(3),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(3) { width: 11%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(4),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(4) { width: 14%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(5),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(5) { width: 13%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(6),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(6) { width: 17%; }
.app-shell.is-open-items-layout .revenue-overview-table th:nth-child(7),
.app-shell.is-open-items-layout .revenue-overview-table td:nth-child(7) { width: 12%; }

.app-shell.is-open-items-layout .revenue-action-head {
  font-size: 0;
}

.app-shell.is-open-items-layout .revenue-open-btn {
  padding: 0.22rem 0.34rem;
  font-size: 0.74rem;
  border-radius: 8px;
}

@media (max-width: 1320px) {
  .app-shell.is-open-items-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .app-shell.is-open-items-layout .preview-panel .invoice-page {
    transform: scale(0.84);
    margin-bottom: -180px;
  }
}
