/* ==========================================================================
   MoveFlow – Rechnungen
   ========================================================================== */
.inv-kpi--red:hover { border-color: color-mix(in srgb, var(--c-red) 35%, var(--c-border)); }
.inv-charts { align-items: stretch; }
.inv-charts .card { display: flex; flex-direction: column; }
.inv-row--overdue td:first-child { box-shadow: inset 3px 0 0 var(--c-red); }
.inv-table td, .inv-table th { padding-left: 12px; padding-right: 12px; }
.inv-quickpay .chip { height: 28px; font-size: 12px; }

/* Formular: Positionen */
.inv-form { display: flex; flex-direction: column; gap: 18px; }
.inv-term { height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r-sm); background: var(--c-surface-2); border: 1px dashed var(--c-border-2); font-weight: 600; color: var(--c-text-2); }
.inv-items { border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; }
.inv-items__head, .inv-item { display: grid; grid-template-columns: minmax(0, 1fr) 80px 110px 110px 110px 34px; gap: 8px; align-items: center; }
.inv-items__head { padding: 9px 12px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-3); }
.inv-item { padding: 8px 12px; border-bottom: 1px solid var(--c-border); }
.inv-item:last-child { border-bottom: 0; }
.inv-item__qty, .inv-item__price { text-align: right; }
.inv-item__sum { text-align: right; font-weight: 650; font-size: 13.5px; }
.inv-items__foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px; background: var(--c-surface-2); border-top: 1px solid var(--c-border); flex-wrap: wrap; }
.inv-totals { display: flex; flex-direction: column; gap: 4px; min-width: 240px; font-variant-numeric: tabular-nums; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; color: var(--c-text-2); }
.inv-totals strong { color: var(--c-text); font-weight: 600; }
.inv-totals__grand { padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--c-border-2); font-size: 15px !important; }
.inv-totals__grand strong { font-size: 18px; font-weight: 800; }

/* Mahnstufen */
.inv-remind-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-remind-steps span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-full); background: var(--c-surface-3); font-size: 12px; font-weight: 600; color: var(--c-text-3); }
.inv-remind-steps svg { width: 13px; height: 13px; }
.inv-remind-steps .is-done { background: var(--c-green-bg); color: var(--c-green-text); }
.inv-remind-steps .is-current { background: var(--c-red-bg); color: var(--c-red-text); }

/* Detail */
.inv-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inv-detail { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.inv-stage { background: #e9edf2; border-radius: var(--r-lg); padding: 24px; display: flex; justify-content: center; min-width: 0; overflow-x: auto; }
.inv-stage .paper { min-height: 0; }
.inv-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.inv-amount { display: flex; flex-direction: column; }
.inv-amount span { font-size: 12.5px; color: var(--c-text-3); font-weight: 550; }
.inv-amount strong { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; }
.inv-amount small { font-size: 12.5px; }
.inv-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 20px; }
.inv-actions__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.inv-actions__grid .btn { padding: 0 8px; }
.inv-paid { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--r-md); background: var(--c-green-bg); color: var(--c-green-text); font-weight: 650; }
.inv-paid svg { width: 18px; height: 18px; }
.inv-steps { display: flex; flex-direction: column; }
.inv-step { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.inv-step:last-child { padding-bottom: 0; }
.inv-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--c-border); }
.inv-step:last-child::before { display: none; }
.inv-step.is-done::before { background: var(--c-green); }
.inv-step__dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--c-surface); border: 2px solid var(--c-border-2); color: var(--c-text-3); flex-shrink: 0; }
.inv-step__dot svg { width: 13px; height: 13px; stroke-width: 2.6; }
.inv-step.is-done .inv-step__dot { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.inv-step.is-current .inv-step__dot { border-color: var(--c-primary); color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-100); }
.inv-step.is-warn .inv-step__dot { border-color: var(--c-red); background: var(--c-red); color: #fff; box-shadow: 0 0 0 4px var(--c-red-bg); }
.inv-step__body { display: flex; flex-direction: column; padding-top: 3px; }
.inv-step__label { font-size: 13.5px; font-weight: 600; }
.inv-step.is-warn .inv-step__label { color: var(--c-red-text); }
.inv-step__date { font-size: 12px; color: var(--c-text-3); }
.inv-link { color: inherit; }
.inv-link:hover .person__name { color: var(--c-primary); }
.inv-joblink { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-text-2); font-size: 13px; }
.inv-joblink:hover { border-color: var(--c-border-2); color: var(--c-text); }
.inv-joblink > svg { width: 16px; height: 16px; flex-shrink: 0; }
.inv-joblink span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1180px) {
  .inv-detail { grid-template-columns: minmax(0, 1fr); }
  .inv-side { position: static; order: -1; }
}
@media (max-width: 680px) {
  .inv-items__head { display: none; }
  .inv-item { grid-template-columns: 1fr 1fr 1fr; }
  .inv-item__label { grid-column: 1 / -1; }
  .inv-item__sum { grid-column: 1 / 3; text-align: left; }
  .inv-stage { padding: 10px; margin: 0 -16px; border-radius: 0; }
}
