/* Rechnungsmodul – Premium SaaS + Business-Dokumenten-Feeling */
.inv-page {
    min-height: 100vh;
    background: #f6f7f9;
    padding-bottom: 3rem;
}
.inv-page.main,
main.inv-page {
    max-width: min(96vw, 1560px);
    margin: 0 auto;
    padding: 2rem 1.75rem 3rem;
    width: 100%;
    box-sizing: border-box;
}

/* Rechnungsseite: Nav & Inhalt gleich breit */
html.app-warm-canvas:has(main.inv-page) .v-nav-inner {
    max-width: min(96vw, 1560px) !important;
}

@media (min-width: 1200px) {
    main.inv-page {
        padding-left: 2.25rem;
        padding-right: 2.25rem;
    }
    .inv-toolbar #filterQuery {
        flex: 1 1 240px;
        max-width: 360px;
    }
}
.inv-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.inv-hero h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #0c1222;
    line-height: 1.2;
}
.inv-hero-lead {
    margin: 0.5rem 0 0;
    max-width: 40rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #5c6578;
}
.inv-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0 1.2rem;
    border-radius: 12px;
    border: none;
    background: #0c1222;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(12, 18, 34, 0.1), 0 2px 8px rgba(12, 18, 34, 0.06);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.inv-btn-primary:hover {
    background: #1a2332;
    box-shadow: 0 2px 4px rgba(12, 18, 34, 0.12);
}
.inv-toolbar {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 0.55rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(12, 18, 34, 0.03);
    border: 1px solid rgba(12, 18, 34, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.inv-toolbar input,
.inv-toolbar select {
    min-height: 38px;
    padding: 0 0.8rem;
    border: 1px solid rgba(12, 18, 34, 0.07);
    border-radius: 9px;
    font-size: 0.8125rem;
    font-weight: 400;
    min-width: 156px;
    background: #f8fafc;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}
.inv-toolbar select {
    padding-right: 1.85rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23a1aab4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-color: #f8fafc;
}
.inv-toolbar input::placeholder {
    color: #a8b0bc;
    font-weight: 400;
}
.inv-toolbar input:hover,
.inv-toolbar select:hover {
    background-color: #fff;
    border-color: rgba(12, 18, 34, 0.11);
}
.inv-toolbar input:focus,
.inv-toolbar select:focus {
    outline: none;
    background-color: #fff;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.07);
}
.inv-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(12, 18, 34, 0.06);
    border: 1px solid rgba(12, 18, 34, 0.06);
    overflow: visible;
}
.inv-table-card table {
    width: 100%;
    border-collapse: collapse;
}
.inv-table-card th,
.inv-table-card td {
    padding: 0.72rem 1rem;
    border-bottom: 1px solid #eef1f6;
    font-size: 0.8125rem;
    text-align: left;
    color: #334155;
}
.inv-table-card th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.065em;
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
}
.inv-table-card tr:last-child td {
    border-bottom: none;
}
.inv-status {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.48rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    line-height: 1.25;
}
.inv-s-DRAFT { background: rgba(100, 116, 139, 0.07); color: #64748b; }
.inv-s-SENT { background: rgba(59, 130, 246, 0.07); color: #3b6fd4; }
.inv-s-OVERDUE { background: rgba(185, 28, 28, 0.06); color: #b45353; }
.inv-s-PAID { background: rgba(5, 150, 105, 0.07); color: #059669; }
.inv-s-MAHNUNG { background: rgba(234, 88, 12, 0.07); color: #c2710c; }
.inv-s-VOID { background: rgba(148, 163, 184, 0.08); color: #94a3b8; text-decoration: line-through; }

/* —— Modal: geführter Prozess —— */
.inv-modal-overlay.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem 0.75rem 2rem;
    overflow-y: auto;
}
.inv-create-sheet {
    max-width: 600px;
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(12, 18, 34, 0.1);
    box-shadow: 0 20px 50px rgba(12, 18, 34, 0.14), 0 0 1px rgba(12, 18, 34, 0.08);
    background: #eef1f6;
    max-height: none;
}
.inv-create-sheet .modal-head {
    background: #fff;
    border-bottom: 1px solid #e8ecf2;
    padding: 1.125rem 1.35rem;
    border-radius: 18px 18px 0 0;
}
.inv-create-sheet .modal-head h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #0c1222;
}
.inv-create-sheet .modal-head .btn {
    min-height: 38px;
    padding: 0 0.85rem;
    border-radius: 10px;
    border: 1px solid #d8dee8;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
}
.inv-create-sheet .modal-head .btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.inv-sheet-body {
    padding: 1rem 1.125rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    counter-reset: inv-step;
}

/* Prozess-Schritte: dezente Nummer, klare Card */
.inv-sheet-body > .inv-card {
    position: relative;
    padding: 1rem 1.15rem 1.05rem 2.75rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(12, 18, 34, 0.07);
    box-shadow: 0 1px 3px rgba(12, 18, 34, 0.04);
}
.inv-sheet-body > .inv-card::before {
    counter-increment: inv-step;
    content: counter(inv-step);
    position: absolute;
    left: 0.95rem;
    top: 1.05rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.inv-sheet-body > .inv-summary-card::before {
    background: #e8ecf4;
    color: #334155;
}

.inv-card h3 {
    margin: 0 0 0.25rem;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3d4d66;
    line-height: 1.3;
}
.inv-card-lead {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #64748b;
    max-width: 42em;
}

.inv-field {
    margin-bottom: 0;
}
.inv-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: #64748b;
    margin-bottom: 0.4rem;
}
.inv-field select,
.inv-field input[type="text"],
.inv-field input[type="number"],
.inv-field input[type="date"] {
    width: 100%;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid #d1d9e4;
    border-radius: 10px;
    font-size: 0.875rem;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.inv-field select:hover,
.inv-field input:hover {
    border-color: #b8c4d4;
}
.inv-field select:focus,
.inv-field input:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
    background: #fff;
}
.inv-field input::placeholder {
    color: #94a3b8;
}

.inv-info-card {
    margin-top: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 11px;
    background: #f8fafc;
    border: 1px solid #e8ecf2;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #334155;
}
.inv-info-card strong {
    color: #0c1222;
    font-weight: 600;
}
.inv-info-card .inv-muted {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
}
.inv-warn {
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.8125rem;
    line-height: 1.45;
}

/* Positions-Zeilen als Cards (kein Tabellen-Look) */
#invLineItems {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.inv-line-card {
    background: #fafbfd;
    border: 1px solid #e4e9f0;
    border-radius: 12px;
    padding: 0.85rem 0.95rem 0.95rem;
    box-shadow: 0 1px 2px rgba(12, 18, 34, 0.03);
}
.inv-line-card-head {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}
.inv-line-card-head .inv-line-desc-wrap {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.inv-line-remove {
    flex-shrink: 0;
    align-self: flex-end;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin-bottom: 0.125rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}
.inv-line-remove:hover:not(:disabled) {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.08);
}
.inv-line-remove:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
.inv-line-remove:disabled {
    display: none;
}
.inv-line-grid {
    display: grid;
    grid-template-columns: minmax(72px, 0.9fr) minmax(100px, 1.1fr) minmax(100px, 1.2fr) minmax(108px, 1fr);
    gap: 0.55rem 0.65rem;
    align-items: end;
}
.inv-line-total-field .inv-line-line-total {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0c1222;
    box-sizing: border-box;
}
.inv-line-total-field label {
    color: #64748b;
}
@media (max-width: 620px) {
    .inv-line-grid {
        grid-template-columns: 1fr 1fr;
    }
    .inv-line-total-field {
        grid-column: 1 / -1;
    }
}
@media (max-width: 400px) {
    .inv-line-grid {
        grid-template-columns: 1fr;
    }
}
.inv-btn-ghost {
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px dashed #c5cdd8;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 0.15rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.inv-btn-ghost:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

/* MWST: ruhig, ausgewogen */
.inv-vat-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.15rem;
}
@media (min-width: 420px) {
    .inv-vat-row {
        grid-template-columns: minmax(0, 1.15fr) minmax(140px, 1fr);
        align-items: end;
        gap: 1rem 1.25rem;
    }
}
.inv-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.15rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
    line-height: 1.35;
}
.inv-toggle input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    flex-shrink: 0;
    accent-color: #0c1222;
    border-radius: 4px;
}
.inv-vat-select-wrap {
    min-width: 0;
}
.inv-vat-select-wrap label {
    margin-bottom: 0.4rem;
}
.inv-vat-select-wrap .inv-field {
    margin: 0;
}

/* Vorschau / Summen – Vertrauens-Anker */
.inv-summary-card {
    background: linear-gradient(165deg, #fff 0%, #f6f8fc 55%, #eef2f9 100%);
    border: 1px solid #d8e0ec;
    box-shadow: 0 4px 14px rgba(12, 18, 34, 0.06);
}
.inv-summary {
    text-align: right;
    padding: 0.35rem 0.15rem 0.15rem;
}
.inv-sum-lbl {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-align: right;
}
.inv-summary-row {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 1.35rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}
.inv-summary-row .inv-sum-val {
    min-width: 7.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #334155;
    letter-spacing: -0.015em;
    text-align: right;
}
.inv-summary-total {
    margin-top: 1.05rem;
    padding-top: 1.15rem;
    border-top: 1px solid #c5cdd8;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 1.35rem;
}
.inv-sum-lbl-total {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: #64748b;
    padding-top: 0.2rem;
}
.inv-summary-total .inv-sum-val-total {
    min-width: 7.25rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #0c1222;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    text-align: right;
}

.inv-form-errors {
    padding: 0.65rem 0.85rem;
    border-radius: 11px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.8125rem;
    line-height: 1.45;
}
.inv-form-errors:empty {
    display: none;
}

/* Aktionen: klare Priorität */
.inv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.35rem;
    padding-top: 0.25rem;
}
.inv-actions .inv-btn-secondary {
    min-height: 42px;
    padding: 0 0.95rem;
    border-radius: 10px;
    border: 1px solid #d8dee8;
    background: #fff;
    color: #5c6578;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.inv-actions .inv-btn-secondary:hover {
    background: #f8fafc;
    border-color: #c5cdd8;
    color: #334155;
}
.inv-actions .inv-btn-primary {
    min-height: 44px;
    padding: 0 1.15rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(12, 18, 34, 0.15);
}
.inv-actions .inv-btn-primary:hover {
    box-shadow: 0 3px 12px rgba(12, 18, 34, 0.18);
}

.inv-details-more {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #eef1f6;
    font-size: 0.8125rem;
    color: #64748b;
}
.inv-details-more summary {
    font-weight: 500;
    color: #475569;
}

.inv-net-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.35rem 0 0;
}

/* Toasts */
.inv-toast-root {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 10200;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    pointer-events: none;
}
.inv-toast {
    max-width: 320px;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.45;
    box-shadow: 0 8px 30px rgba(12, 18, 34, 0.18);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
    background: #0c1222;
    color: #fff;
}
.inv-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.inv-toast--error {
    background: #7f1d1d;
}

/* —— PDF: Dokument-Ansicht (kein Admin-Viewer) —— */
.inv-doc-modal[hidden] {
    display: none !important;
}

.inv-doc-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.inv-doc-modal.open {
    display: block;
}

.inv-doc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(245, 245, 246, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.inv-doc-scroll {
    position: relative;
    z-index: 1;
    min-height: 100%;
    padding: 72px 1.5rem 96px;
    box-sizing: border-box;
    background-color: #f4f4f5;
    background-image: none;
}

.inv-doc-shell {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.inv-doc-modal.open .inv-doc-shell {
    animation: inv-doc-enter 0.18s ease forwards;
}

@keyframes inv-doc-enter {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.inv-doc-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0 0.85rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, rgba(244, 244, 245, 0.97) 0%, rgba(244, 244, 245, 0.88) 65%, rgba(244, 244, 245, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.inv-doc-bar-main {
    min-width: 0;
}

.inv-doc-acc {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
}

.inv-doc-journal-link {
    color: #3b5998;
    text-decoration: none;
    font-weight: 550;
}

.inv-doc-journal-link:hover {
    text-decoration: underline;
}

.inv-doc-acc-warn {
    color: #b45309;
}

.inv-doc-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.inv-doc-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.inv-doc-textbtn {
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.inv-doc-textbtn:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.05);
}

.inv-doc-close {
    margin-left: 0.25rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.inv-doc-close:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
}

.inv-doc-paper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.08);
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.inv-doc-frame {
    display: block;
    width: 100%;
    min-height: calc(100vh - 176px);
    height: min(1200px, calc(100vh - 168px));
    border: 0;
    background: #fafafa;
}

@media (max-width: 640px) {
    .inv-doc-scroll {
        padding: 52px 0.75rem 64px;
    }

    .inv-doc-paper {
        max-width: none;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
        border-radius: 0;
    }

    .inv-doc-frame {
        min-height: 75vh;
        height: min(100vh, calc(100vh - 140px));
    }

    .inv-doc-textbtn {
        padding: 0.4rem 0.45rem;
        font-size: 0.75rem;
    }

    .inv-doc-bar {
        flex-wrap: wrap;
        padding-bottom: 0.65rem;
    }
}

/* ── Rechnungs-Workspace (Premium Accordion – Final) ── */
.inv-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 0.5rem;
    padding: 0.28rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(12, 18, 34, 0.04);
}
.inv-chip {
    min-height: 28px;
    padding: 0 0.65rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.inv-chip:hover {
    background: rgba(12, 18, 34, 0.06);
    color: #334155;
}
.inv-chip.is-active {
    background: rgba(12, 18, 34, 0.07);
    color: #0c1222;
    box-shadow: inset 0 0 0 1px rgba(12, 18, 34, 0.12);
    font-weight: 600;
}
.inv-workspace-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(12, 18, 34, 0.04);
    border-radius: 13px;
    padding: 0.28rem 0.35rem 0.4rem;
    box-shadow: 0 1px 4px rgba(12, 18, 34, 0.03);
}
.inv-workspace {
    min-height: 68px;
}
.inv-ws-tree {
    display: flex;
    flex-direction: column;
    gap: 0.26rem;
}
.inv-ws-property {
    border-radius: 11px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 0 1px 2px rgba(12, 18, 34, 0.03);
    border: 1px solid rgba(12, 18, 34, 0.04);
    transition: box-shadow 0.26s ease, transform 0.26s ease, background 0.26s ease;
    overflow: hidden;
}
.inv-ws-property.has-overdue {
    background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
}
.inv-ws-property.all-paid {
    background: linear-gradient(180deg, #fafffe 0%, #ffffff 100%);
}
.inv-ws-property:not(.is-open):hover {
    box-shadow: 0 3px 10px rgba(12, 18, 34, 0.05);
    border-color: rgba(12, 18, 34, 0.06);
    transform: translateY(-0.5px);
}
.inv-ws-property.is-open {
    background: #fff;
    box-shadow: 0 3px 14px rgba(12, 18, 34, 0.05);
    border-color: rgba(12, 18, 34, 0.05);
}
.inv-ws-tenant {
    margin: 0.06rem 0.25rem 0.06rem 0.6rem;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid rgba(12, 18, 34, 0.03);
    box-shadow: 0 1px 2px rgba(12, 18, 34, 0.02);
    transition: background 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease, border-color 0.24s ease;
    cursor: pointer;
}
.inv-ws-tenant.has-overdue {
    background: rgba(255, 251, 251, 0.85);
}
.inv-ws-tenant:not(.is-open):hover {
    background: #fff;
    border-color: rgba(12, 18, 34, 0.06);
    box-shadow: 0 2px 8px rgba(12, 18, 34, 0.04);
    transform: translateY(-0.5px);
}
.inv-ws-tenant.is-open {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(12, 18, 34, 0.05);
    box-shadow: 0 1px 4px rgba(12, 18, 34, 0.03);
}
.inv-ws-property-btn,
.inv-ws-tenant-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    width: 100%;
    padding: 0.68rem 0.82rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.22s ease;
}
.inv-ws-property-btn:hover,
.inv-ws-tenant-btn:hover {
    background: rgba(12, 18, 34, 0.022);
}
.inv-ws-property.is-open > .inv-ws-property-btn {
    background: rgba(59, 130, 246, 0.03);
}
.inv-ws-tenant.is-open > .inv-ws-tenant-btn {
    background: rgba(12, 18, 34, 0.02);
}
.inv-ws-tenant-btn {
    padding: 0.52rem 0.6rem;
    border-radius: 8px;
}
.inv-ws-chevron {
    flex-shrink: 0;
    width: 0.4rem;
    height: 0.4rem;
    margin-top: 0.42rem;
    border-right: 1.5px solid #94a3b8;
    border-bottom: 1.5px solid #94a3b8;
    transform: rotate(-45deg);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}
.inv-ws-chevron--sm {
    width: 0.34rem;
    height: 0.34rem;
    margin-top: 0.36rem;
}
.is-open > .inv-ws-property-btn .inv-ws-chevron,
.is-open > .inv-ws-tenant-btn .inv-ws-chevron {
    transform: rotate(45deg);
    border-color: #64748b;
}
.inv-ws-property-btn:hover .inv-ws-chevron,
.inv-ws-tenant-btn:hover .inv-ws-chevron {
    border-color: #64748b;
}
.inv-ws-property-text,
.inv-ws-tenant-text {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
    flex: 1;
}
.inv-ws-property-text strong {
    font-size: 1.0625rem;
    font-weight: 650;
    color: #0c1222;
    letter-spacing: -0.03em;
    line-height: 1.25;
    word-break: break-word;
}
.inv-ws-tenant-text strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a2332;
    letter-spacing: -0.018em;
    word-break: break-word;
}
.inv-ws-property-sub {
    display: block;
}
.inv-ws-property-stats {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}
.inv-ws-stat-line--primary {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0c1222;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.inv-ws-stat-amount {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #0c1222;
    font-variant-numeric: tabular-nums;
}
.inv-ws-stat-open-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: -0.01em;
}
.inv-ws-stat-line--has-overdue .inv-ws-stat-amount {
    color: #b45353;
}
.inv-ws-stat-line--has-overdue .inv-ws-stat-open-label {
    color: #c47070;
}
.inv-ws-stat-line--all-paid {
    color: #059669;
    font-weight: 600;
    font-size: 0.9375rem;
}
.inv-ws-stat-line--meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem 0.28rem;
    font-size: 0.6875rem;
    color: #a8b0bc;
    font-weight: 400;
    letter-spacing: 0.005em;
}
.inv-ws-stat--count {
    color: #a8b0bc;
}
.inv-ws-tenant-sub {
    font-size: 0.6875rem;
    color: #a8b0bc;
    line-height: 1.35;
}
.inv-ws-stat-sep {
    color: #cbd5e1;
    font-weight: 400;
    opacity: 0.7;
}
.inv-ws-stat--overdue {
    color: #c47070;
    font-weight: 500;
}
.inv-ws-stat--paid-count {
    color: #6db89a;
    font-weight: 400;
}
.inv-ws-tenant-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
}
.inv-ws-tenant-stat-primary {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}
.inv-ws-tenant-stat-amt {
    font-weight: 700;
    font-size: 0.8125rem;
    color: #0c1222;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.inv-ws-tenant.has-overdue .inv-ws-tenant-stat-amt {
    color: #b45353;
}
.inv-ws-tenant.has-overdue .inv-ws-tenant-stat-primary {
    color: #64748b;
}
.inv-ws-tenant-stat-paid {
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
}
.inv-ws-tenant-stat-meta {
    font-size: 0.6875rem;
    color: #a8b0bc;
    font-weight: 400;
}
.inv-ws-loading,
.inv-ws-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 140px;
    padding: 2rem 1.25rem;
    text-align: center;
}
.inv-ws-loading {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 500;
}
.inv-ws-empty-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: -0.02em;
}
.inv-ws-empty-sub {
    margin: 0;
    max-width: 22rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #94a3b8;
}
.inv-ws-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.inv-ws-property.is-open > .inv-ws-collapse,
.inv-ws-tenant.is-open > .inv-ws-collapse {
    grid-template-rows: 1fr;
}
.inv-ws-collapse-inner {
    overflow: hidden;
    min-height: 0;
}
.inv-ws-collapse-inner > .inv-ws-property-body,
.inv-ws-collapse-inner > .inv-ws-tenant-body {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.inv-ws-property.is-open > .inv-ws-collapse .inv-ws-collapse-inner > .inv-ws-property-body,
.inv-ws-tenant.is-open > .inv-ws-collapse .inv-ws-collapse-inner > .inv-ws-tenant-body {
    opacity: 1;
    transform: translateY(0);
}
.inv-ws-property-body {
    padding: 0 0.2rem 0.28rem;
}
.inv-ws-tenant-body {
    padding: 0 0 0.28rem;
}
.inv-ws-invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.1rem 0.3rem 0.1rem 0.55rem;
}
.inv-ws-invoice {
    border: 1px solid rgba(12, 18, 34, 0.03);
    border-radius: 10px;
    padding: 0.58rem 0.72rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 1px 2px rgba(12, 18, 34, 0.02);
    transition: box-shadow 0.22s ease, background 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}
.inv-ws-invoice--st-PAID {
    background: rgba(240, 253, 249, 0.55);
    border-color: rgba(5, 150, 105, 0.06);
}
.inv-ws-invoice--st-OVERDUE,
.inv-ws-invoice--st-MAHNUNG {
    background: rgba(255, 251, 251, 0.7);
    border-color: rgba(185, 28, 28, 0.05);
}
.inv-ws-invoice--clickable {
    cursor: pointer;
}
.inv-ws-invoice--clickable:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 0 0 1px rgba(12, 18, 34, 0.04);
}
.inv-ws-invoice:hover {
    background: #fff;
    border-color: rgba(12, 18, 34, 0.06);
    box-shadow: 0 2px 8px rgba(12, 18, 34, 0.04);
    transform: translateY(-0.5px);
}
.inv-ws-invoice-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.inv-ws-invoice-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0c1222;
    letter-spacing: -0.015em;
}
.inv-ws-invoice-meta {
    margin-top: 0.14rem;
    font-size: 0.6875rem;
    color: #a8b0bc;
    font-weight: 400;
}
.inv-ws-dot {
    margin: 0 0.2rem;
    opacity: 0.5;
}
.inv-ws-acc-badge {
    font-size: 0.625rem;
    font-weight: 550;
    letter-spacing: 0.01em;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    background: #f1f3f6;
    color: #6b7280;
}
.inv-ws-acc-badge--charged {
    background: #eef4ff;
    color: #3b5998;
}
.inv-ws-acc-badge--paid {
    background: #ecfdf3;
    color: #047857;
}
.inv-ws-acc-badge--reversed {
    background: #f3f4f6;
    color: #6b7280;
}
.inv-ws-acc-badge--partial,
.inv-ws-acc-badge--error {
    background: #fef3c7;
    color: #b45309;
}
.inv-ws-invoice-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
}
.inv-ws-amount {
    font-size: 0.9375rem;
    font-weight: 650;
    color: #0c1222;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}
.inv-ws-invoice--st-OVERDUE .inv-ws-amount,
.inv-ws-invoice--st-MAHNUNG .inv-ws-amount {
    color: #b45353;
    font-weight: 700;
}
.inv-ws-invoice--st-PAID .inv-ws-amount {
    color: #059669;
    font-weight: 600;
    font-size: 0.875rem;
}
.inv-ws-invoice--st-VOID .inv-ws-amount {
    color: #94a3b8;
    font-weight: 500;
    text-decoration: line-through;
}
.inv-ws-invoice-side .inv-status {
    font-size: 0.625rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.inv-ws-inv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.42rem;
    padding-top: 0.42rem;
    border-top: 1px solid rgba(12, 18, 34, 0.04);
    opacity: 0.72;
    transition: opacity 0.2s ease;
}
.inv-ws-invoice:hover .inv-ws-inv-actions,
.inv-ws-invoice:focus-within .inv-ws-inv-actions {
    opacity: 1;
}
.inv-ws-act {
    min-height: 26px;
    padding: 0 0.5rem;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.inv-ws-act--link {
    color: #3b82f6;
    padding-left: 0;
}
.inv-ws-act--link:hover {
    color: #2563eb;
}
.inv-ws-act--ghost {
    border: 1px solid rgba(12, 18, 34, 0.08);
    background: rgba(255, 255, 255, 0.8);
    color: #475569;
    padding: 0 0.55rem;
}
.inv-ws-act--ghost:hover {
    background: #fff;
    border-color: rgba(12, 18, 34, 0.12);
    color: #0c1222;
}
.inv-ws-more {
    position: relative;
    margin-left: auto;
}
.inv-ws-more-btn {
    min-width: 26px;
    min-height: 26px;
    padding: 0 0.35rem;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.15s ease, color 0.15s ease;
}
.inv-ws-more-btn:hover,
.inv-ws-more.is-open .inv-ws-more-btn {
    background: rgba(12, 18, 34, 0.05);
    color: #475569;
}
.inv-ws-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 3px);
    min-width: 184px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(12, 18, 34, 0.06);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(12, 18, 34, 0.08);
    padding: 0.28rem;
    z-index: 20;
    animation: inv-ws-menu-in 0.18s ease;
}
@keyframes inv-ws-menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.inv-ws-more-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.42rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.inv-ws-more-item:hover {
    background: rgba(12, 18, 34, 0.04);
}
.inv-ws-more-item--danger {
    color: #dc2626;
}
.inv-ws-more-item--danger:hover {
    background: rgba(239, 68, 68, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    .inv-ws-collapse,
    .inv-ws-collapse-inner > .inv-ws-property-body,
    .inv-ws-collapse-inner > .inv-ws-tenant-body,
    .inv-ws-chevron,
    .inv-ws-property,
    .inv-ws-tenant,
    .inv-ws-invoice,
    .inv-ws-more-menu,
    .inv-chip {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
    .inv-ws-collapse-inner > .inv-ws-property-body,
    .inv-ws-collapse-inner > .inv-ws-tenant-body {
        opacity: 1;
    }
}
.inv-ws-embed-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.inv-ws-embed-list li {
    margin: 0;
}
.inv-ws-embed-link {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(12, 18, 34, 0.06);
    text-decoration: none;
    color: inherit;
    font-size: 0.8125rem;
}
.inv-ws-embed-link:hover {
    color: #0c1222;
}
.inv-ws-embed-amt {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.inv-ws-embed-more a {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #2563eb;
    text-decoration: none;
}
.inv-ws-embed-more a:hover {
    text-decoration: underline;
}
.inv-ws-embed-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: #94a3b8;
}
.pd-drawer-invoices {
    margin-top: 0.5rem;
}
.pd-drawer-invoices-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.pd-drawer-invoices-head h4 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0c1222;
}
.mt-invoices-embed {
    margin-top: 0.25rem;
}

@media (max-width: 640px) {
    main.inv-page {
        padding: 1.25rem 1rem 2.5rem;
    }
    .inv-filter-chips {
        gap: 0.25rem;
        padding: 0.25rem;
    }
    .inv-chip {
        min-height: 32px;
        padding: 0 0.75rem;
        font-size: 0.8125rem;
    }
    .inv-ws-property-btn,
    .inv-ws-tenant-btn {
        padding: 0.62rem 0.7rem;
    }
    .inv-ws-stat-amount {
        font-size: 1.0625rem;
    }
    .inv-ws-property-text strong,
    .inv-ws-tenant-text strong {
        overflow-wrap: anywhere;
    }
    .inv-ws-invoice-list {
        padding-left: 0.45rem;
    }
    .inv-ws-tenant {
        margin-left: 0.35rem;
    }
    .inv-ws-invoice-top {
        flex-direction: column;
        gap: 0.45rem;
    }
    .inv-ws-invoice-side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    .inv-ws-amount {
        font-size: 1rem;
    }
    .inv-ws-inv-actions {
        opacity: 1;
        gap: 0.35rem;
    }
    .inv-ws-act,
    .inv-ws-more-btn {
        min-height: 32px;
    }
    .inv-ws-more-menu {
        right: auto;
        left: 0;
    }
    .inv-toolbar {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    .inv-toolbar input,
    .inv-toolbar select {
        min-width: 100%;
        flex: 1 1 100%;
        min-height: 40px;
    }
}
