/* ==========================================================
   DUFV Rechnungen
   Version: 0.2.5
   Frontend-Grundlayout im Stil des Mitgliederverzeichnisses
   ========================================================== */

.dufv-rechnungen {
    max-width: 1120px;
    margin: 0 auto;
    font-size: 1rem;
}

/* Einleitung */

.dufv-rechnungen-intro {
    margin-bottom: 1.5rem;
}

.dufv-rechnungen-intro p {
    margin: 0;
    max-width: 820px;
    color: #1d2b33;
}

/* Meldungen */

.dufv-rechnungen-success {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 6px solid #6f8793;
    background: #ffffff;
    border-radius: 7px;
    color: #1d2b33;
    font-weight: 700;
    animation: dufvRechnungenFadeOutNotice 6s ease forwards;
    overflow: hidden;
}

@keyframes dufvRechnungenFadeOutNotice {
    0% {
        opacity: 1;
        max-height: 220px;
        margin-bottom: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    75% {
        opacity: 1;
        max-height: 220px;
        margin-bottom: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    100% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
    }
}

.dufv-rechnungen-notice {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    border-left: 6px solid #c85a2e;
    background: #ffffff;
    border-radius: 7px;
    color: #1d2b33;
    font-weight: 600;
}

/* Workflow-Hinweis */

.dufv-rechnungen-workflow-box {
    margin: 0 0 1.5rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 6px solid #6f8793;
    background: #ffffff;
    border-radius: 7px;
    color: #1d2b33;
    font-size: 0.97rem;
    line-height: 1.4;
}

.dufv-rechnungen-workflow-box strong {
    color: #1d2b33;
}

/* Aktionen / Buttons */

.dufv-rechnungen-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1.2rem 0 1.6rem 0;
}

.dufv-rechnungen-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 1rem;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none !important;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out, transform 0.15s ease-in-out;
    box-sizing: border-box;
}

.dufv-rechnungen-button:hover,
.dufv-rechnungen-button:focus {
    text-decoration: none !important;
    transform: translateY(-1px);
}

.dufv-rechnungen-button-primary {
    background: #6f8793;
    color: #ffffff !important;
    border-color: #6f8793;
}

.dufv-rechnungen-button-primary:hover,
.dufv-rechnungen-button-primary:focus {
    background: #5f7680;
    border-color: #5f7680;
    color: #ffffff !important;
}

.dufv-rechnungen-button-secondary {
    background: #c85a2e;
    color: #ffffff !important;
    border-color: #c85a2e;
}

.dufv-rechnungen-button-secondary:hover,
.dufv-rechnungen-button-secondary:focus {
    background: #b34f28;
    border-color: #b34f28;
    color: #ffffff !important;
}

.dufv-rechnungen-button-small {
    min-height: 34px;
    padding: 0.32rem 0.55rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* Karten / Bereiche */

.dufv-rechnungen-card {
    margin-top: 1.5rem;
    border: 3px solid #6f8793;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.dufv-rechnungen-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #6f8793;
    color: #ffffff;
}

.dufv-rechnungen-card-header h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
}

.dufv-rechnungen-version {
    font-size: 0.95rem;
    color: #ffffff;
    opacity: 0.9;
    white-space: nowrap;
}

.dufv-rechnungen-empty {
    padding: 1.5rem;
    background: #ffffff;
}

.dufv-rechnungen-empty p {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #1d2b33;
}

.dufv-rechnungen-muted {
    color: #6f8793 !important;
    font-size: 0.95rem;
}

/* Tabellen */

.dufv-rechnungen-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.dufv-rechnungen-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
}

.dufv-rechnungen-table th {
    background: #6f8793;
    color: #ffffff;
    font-weight: 700;
    text-align: left;
    padding: 0.8rem 0.65rem;
    border-right: 3px solid #e5e8ea;
    font-size: 0.93rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dufv-rechnungen-table th:last-child {
    border-right: none;
}

.dufv-rechnungen-table td {
    padding: 0.72rem 0.65rem;
    border-top: 3px solid #e5e8ea;
    border-right: 3px solid #e5e8ea;
    color: #1d2b33;
    vertical-align: top;
    font-size: 0.95rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dufv-rechnungen-table td:last-child {
    border-right: none;
}

.dufv-rechnungen-table tbody tr:nth-child(even) td {
    background: #f3f6f7;
}

.dufv-rechnungen-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

/* Kompakte Spaltenbreiten der Rechnungsliste */
.dufv-rechnungen-table th:nth-child(1),
.dufv-rechnungen-table td:nth-child(1) {
    width: 12%;
}

.dufv-rechnungen-table th:nth-child(2),
.dufv-rechnungen-table td:nth-child(2) {
    width: 10%;
}

.dufv-rechnungen-table th:nth-child(3),
.dufv-rechnungen-table td:nth-child(3) {
    width: 14%;
}

.dufv-rechnungen-table th:nth-child(4),
.dufv-rechnungen-table td:nth-child(4) {
    width: 12%;
}

.dufv-rechnungen-table th:nth-child(5),
.dufv-rechnungen-table td:nth-child(5) {
    width: 8%;
}

.dufv-rechnungen-table th:nth-child(6),
.dufv-rechnungen-table td:nth-child(6) {
    width: 20%;
}

.dufv-rechnungen-table th:nth-child(7),
.dufv-rechnungen-table td:nth-child(7) {
    width: 9%;
}

.dufv-rechnungen-table th:nth-child(8),
.dufv-rechnungen-table td:nth-child(8) {
    width: 15%;
}

/* Betrag */
.dufv-rechnungen-table td:nth-child(7) strong {
    display: inline-block;
    white-space: normal;
}

/* Formular */

.dufv-rechnungen-form {
    padding: 0;
}

.dufv-rechnungen-form-section {
    padding: 1.5rem;
    border-bottom: 3px solid #e5e8ea;
}

.dufv-rechnungen-form-section:last-of-type {
    border-bottom: none;
}

.dufv-rechnungen-form-section h4 {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    color: #6f8793;
}

.dufv-rechnungen-grid {
    display: grid;
    gap: 1rem;
}

.dufv-rechnungen-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dufv-rechnungen-field {
    margin-bottom: 1rem;
}

.dufv-rechnungen-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: #6f8793;
}

.dufv-rechnungen-field input,
.dufv-rechnungen-field select,
.dufv-rechnungen-field textarea,
.dufv-rechnungen-form-table input {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    border: 1px solid #9db0b8;
    border-radius: 6px;
    background: #ffffff;
    color: #1d2b33;
    font-size: 1rem;
    box-sizing: border-box;
}

.dufv-rechnungen-field textarea {
    min-height: 120px;
}

.dufv-rechnungen-check {
    margin: 0.75rem 0 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid #9db0b8;
    border-radius: 7px;
    background: #f3f6f7;
    font-weight: 700;
    color: #1d2b33;
}

.dufv-rechnungen-check input {
    margin-right: 0.5rem;
}

.dufv-rechnungen-form-table {
    table-layout: auto;
}

.dufv-rechnungen-form-table input {
    min-width: 90px;
}

.dufv-rechnungen-form-table td:first-child input {
    min-width: 220px;
}

/* Statusverwaltung */

.dufv-rechnungen-status-badge {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
}

.dufv-rechnungen-status-draft {
    background: #eef3f5;
    color: #1d2b33;
    border: 1px solid #9db0b8;
}

.dufv-rechnungen-status-sent {
    background: #e8f1f5;
    color: #315d70;
    border: 1px solid #6f8793;
}

.dufv-rechnungen-status-paid {
    background: #e8f5ec;
    color: #1f6b36;
    border: 1px solid #7ab58a;
}

.dufv-rechnungen-status-cancelled {
    background: #f6e8e4;
    color: #8f341f;
    border: 1px solid #c85a2e;
}

.dufv-rechnungen-row-cancelled td {
    opacity: 0.75;
}

.dufv-rechnungen-status-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0;
}

.dufv-rechnungen-status-form select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    max-width: none;
    padding: 0.3rem 0.4rem;
    border: 1px solid #9db0b8;
    border-radius: 6px;
    background: #ffffff;
    color: #1d2b33;
    font-size: 0.86rem;
}

.dufv-rechnungen-mini-button {
    min-height: 34px;
    padding: 0.3rem 0.55rem;
    border: 0;
    border-radius: 6px;
    background: #6f8793;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.dufv-rechnungen-mini-button:hover,
.dufv-rechnungen-mini-button:focus {
    background: #5f7680;
}

/* Bearbeiten */

.dufv-rechnungen-edit-hint {
    padding: 1rem 1.5rem;
    background: #f3f6f7;
    border-bottom: 3px solid #e5e8ea;
    color: #1d2b33;
    font-weight: 700;
}

/* Aktionsspalte */

.dufv-rechnungen-action-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    align-items: stretch;
    width: 100%;
}

.dufv-rechnungen-action-stack .dufv-rechnungen-button {
    width: auto;
    min-width: 0;
    min-height: 34px;
    padding: 0.3rem 0.55rem;
    font-size: 0.82rem;
    line-height: 1.15;
    border-radius: 6px;
    white-space: normal;
    text-align: center;
    justify-self: stretch;
    box-sizing: border-box;
}

/* Mobile Optimierung */

@media (max-width: 900px) {
    .dufv-rechnungen-table-wrap {
        overflow-x: auto;
    }

    .dufv-rechnungen-table {
        min-width: 900px;
    }

    .dufv-rechnungen-status-form {
        grid-template-columns: 1fr;
    }

    .dufv-rechnungen-mini-button {
        width: 100%;
    }

    .dufv-rechnungen-action-stack {
        width: 100%;
    }

    .dufv-rechnungen-action-stack .dufv-rechnungen-button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .dufv-rechnungen {
        max-width: 100%;
    }

    .dufv-rechnungen-actions {
        flex-direction: column;
    }

    .dufv-rechnungen-button {
        width: 100%;
    }

    .dufv-rechnungen-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dufv-rechnungen-version {
        white-space: normal;
    }

    .dufv-rechnungen-grid-2 {
        grid-template-columns: 1fr;
    }
}


/* Admin-Werkzeuge */

.dufv-rechnungen-admin-box {
    margin-top: 1.5rem;
    padding: 1.2rem 1.25rem;
    border: 3px dashed #c85a2e;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2b33;
}

.dufv-rechnungen-admin-box h3 {
    margin: 0 0 0.5rem 0;
    color: #c85a2e;
    font-size: 1.15rem;
}

.dufv-rechnungen-admin-box p {
    max-width: 760px;
    margin: 0 0 1rem 0;
    line-height: 1.45;
}

.dufv-rechnungen-button-danger {
    background: #c85a2e;
    border-color: #c85a2e;
    color: #ffffff !important;
}

.dufv-rechnungen-button-danger:hover,
.dufv-rechnungen-button-danger:focus {
    background: #a94322;
    border-color: #a94322;
    color: #ffffff !important;
}
