﻿.pcv3 {
    --pcv3-bg: var(--bs-body-bg, #f4f5f7);
    --pcv3-card: var(--bs-body-bg, #ffffff);
    --pcv3-ink: var(--bs-body-color, #0f172a);
    --pcv3-ink-2: var(--bs-secondary-color, #475569);
    --pcv3-ink-3: #94a3b8;
    --pcv3-line: var(--bs-border-color, #e6e8eb);
    --pcv3-line-soft: #eef0f2;
    --pcv3-primary: var(--bs-primary, #0d6efd);
    --pcv3-primary-soft: #eef2ff;
    --pcv3-success: var(--bs-success, #198754);
    --pcv3-success-soft: #dcfce7;
    --pcv3-warn: #b45309;
    --pcv3-warn-soft: #fef3c7;
    --pcv3-danger: var(--bs-danger, #dc3545);
    --pcv3-radius: 10px;
    --pcv3-radius-lg: 14px;
    --pcv3-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    color: var(--pcv3-ink);
    background: var(--pcv3-bg);
    font-feature-settings: "tnum";
}

/* ===== Header ===== */
.pcv3-header {
    background: var(--pcv3-card);
    border: 1px solid var(--pcv3-line);
    border-radius: var(--pcv3-radius-lg);
    padding: 24px 28px;
    box-shadow: var(--pcv3-shadow-sm);
}

.pcv3-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pcv3-ink-3);
    margin-bottom: 6px;
}

.pcv3-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    text-wrap: pretty;
    max-width: 560px;
}

.pcv3-summary-line {
    color: var(--pcv3-ink-2);
    font-size: 15px;
}

    .pcv3-summary-line strong {
        color: var(--pcv3-ink);
    }

.pcv3-netto {
    text-align: right;
    border-left: 1px solid var(--pcv3-line);
    padding-left: 24px;
    min-width: 240px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pcv3-netto-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pcv3-ink-3);
    margin-bottom: 6px;
}

.pcv3-netto-value {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--pcv3-success);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.pcv3-netto-break {
    color: var(--pcv3-ink-2);
    font-size: 13px;
    margin-top: 6px;
}

/* ===== Stepper ===== */
.pcv3-stepper {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--pcv3-card);
    border: 1px solid var(--pcv3-line);
    border-radius: var(--pcv3-radius-lg);
    padding: 12px;
    box-shadow: var(--pcv3-shadow-sm);
}

.pcv3-step {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--pcv3-ink-2);
    transition: background-color .15s ease, color .15s ease;
}

    .pcv3-step:hover {
        background: var(--pcv3-bg);
    }

    .pcv3-step.is-current {
        background: var(--pcv3-primary-soft);
        color: var(--pcv3-ink);
    }

.pcv3-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--pcv3-ink-2);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.pcv3-step.is-current .pcv3-step-num {
    background: var(--pcv3-primary);
    color: #fff;
}

.pcv3-step.is-done .pcv3-step-num {
    background: var(--pcv3-success);
    color: #fff;
}

.pcv3-step-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.pcv3-step-name {
    font-weight: 500;
    font-size: 14px;
}

.pcv3-step-count {
    font-size: 12px;
    color: var(--pcv3-ink-3);
    margin-top: 2px;
}

    .pcv3-step-count.is-done {
        color: var(--pcv3-success);
    }

.pcv3-progress {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    background: var(--pcv3-line);
    border-radius: 999px;
    overflow: hidden;
}

.pcv3-progress-bar {
    height: 100%;
    background: var(--pcv3-success);
    transition: width .3s ease;
}

/* ===== Step body ===== */
.pcv3-card {
    background: var(--pcv3-card);
    border: 1px solid var(--pcv3-line);
    border-radius: var(--pcv3-radius-lg);
    padding: 24px 28px;
    box-shadow: var(--pcv3-shadow-sm);
}

.pcv3-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.pcv3-card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.pcv3-card-sub {
    color: var(--pcv3-ink-2);
    margin: 0;
    font-size: 14px;
    max-width: 640px;
}

/* ===== Lists / Rows ===== */
.pcv3-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pcv3-list--muted .pcv3-row {
    background: var(--pcv3-bg);
}

.pcv3-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--pcv3-line);
    border-radius: 10px;
    transition: border-color .12s ease;
}

    .pcv3-row:hover {
        border-color: #cbd5e1;
    }

.pcv3-row-main {
    flex: 1;
    min-width: 0;
}

.pcv3-row-title {
    font-weight: 500;
}

.pcv3-row-meta {
    font-size: 13px;
    color: var(--pcv3-ink-2);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pcv3-row-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    white-space: nowrap;
}

.pcv3-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pcv3-warn-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pcv3-warn-soft);
    color: var(--pcv3-warn);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== Success banner (Step 1 done) ===== */
.pcv3-success {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--pcv3-success-soft);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.pcv3-success-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pcv3-success);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== Empty / muted ===== */
.pcv3-empty {
    border: 1px dashed var(--pcv3-line);
    background: #fafbfc;
    color: var(--pcv3-ink-3);
    padding: 24px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.pcv3-muted {
    color: var(--pcv3-ink-3);
}

/* ===== Details accordion ===== */
.pcv3-details {
    margin-top: 20px;
}

    .pcv3-details summary {
        cursor: pointer;
        color: var(--pcv3-ink-2);
        font-size: 13px;
        padding: 8px 0;
        list-style: none;
    }

        .pcv3-details summary::-webkit-details-marker {
            display: none;
        }

        .pcv3-details summary::before {
            content: "▸";
            display: inline-block;
            margin-right: 6px;
            transition: transform .15s ease;
            color: var(--pcv3-ink-3);
        }

    .pcv3-details[open] summary::before {
        transform: rotate(90deg);
    }

    .pcv3-details summary:hover {
        color: var(--pcv3-ink);
    }

/* ===== Tables (Schritt 2 + Endabrechnung) ===== */
.pcv3-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .pcv3-table th,
    .pcv3-table td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--pcv3-line-soft);
        text-align: left;
        vertical-align: middle;
    }

    .pcv3-table thead th {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--pcv3-ink-3);
        font-weight: 500;
        background: #fafbfc;
    }

    .pcv3-table tr.is-warn {
        background: #fffbeb;
    }

    .pcv3-table tfoot td {
        border-top: 2px solid var(--pcv3-ink);
        border-bottom: 0;
        padding-top: 16px;
        font-size: 15px;
    }

    .pcv3-table th.num,
    .pcv3-table td.num {
        text-align: right;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .pcv3-table td.actions {
        width: 1%;
        white-space: nowrap;
        text-align: right;
    }

    .pcv3-table .strong {
        font-weight: 600;
    }

/* ===== Deductions (Schritt 3) ===== */
.pcv3-deduction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
    gap: 12px;
}

.pcv3-deduction {
    position: relative;
    border: 1px solid var(--pcv3-line);
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}

    .pcv3-deduction.is-warn {
        border-color: #fcd34d;
        background: #fffbeb;
    }

.pcv3-deduction-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 12px;
}

.pcv3-deduction-title {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcv3-deduction-amount {
    color: var(--pcv3-danger);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pcv3-deduction-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .pcv3-deduction-fields label {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 12px;
        color: var(--pcv3-ink-2);
        font-weight: 500;
    }

.pcv3-deduction-remove {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ===== Catalog ===== */
.pcv3-catalog {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.pcv3-catalog-head {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pcv3-ink-3);
    font-weight: 500;
    margin-bottom: 6px;
}

.pcv3-catalog-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--pcv3-line);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: border-color .12s ease, background-color .12s ease;
}

    .pcv3-catalog-item:hover:not(:disabled) {
        border-color: var(--pcv3-primary);
        background: var(--pcv3-primary-soft);
    }

    .pcv3-catalog-item + .pcv3-catalog-item {
        margin-top: 4px;
    }

    .pcv3-catalog-item:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ===== Final / Step 4 ===== */
.pcv3-final {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    align-items: start;
}

.pcv3-final-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

    .pcv3-final-table td {
        padding: 12px 0;
        border-bottom: 1px solid var(--pcv3-line-soft);
    }

    .pcv3-final-table tr.pcv3-subtotal td {
        border-top: 1px solid var(--pcv3-ink);
        padding-top: 14px;
        font-weight: 500;
    }

    .pcv3-final-table tr.pcv3-deduct td {
        color: var(--pcv3-danger);
    }

    .pcv3-final-table tr.pcv3-total td {
        border-top: 2px solid var(--pcv3-ink);
        font-size: 22px;
        font-weight: 600;
        letter-spacing: -0.01em;
        padding-top: 16px;
    }

        .pcv3-final-table tr.pcv3-total td:last-child {
            color: var(--pcv3-success);
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

    .pcv3-final-table td.num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

.pcv3-checks {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

    .pcv3-checks li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px solid var(--pcv3-line-soft);
        font-size: 14px;
        color: var(--pcv3-ink-2);
    }

.pcv3-check-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.pcv3-checks li.ok .pcv3-check-mark {
    background: var(--pcv3-success-soft);
    color: var(--pcv3-success);
}

.pcv3-checks li.warn .pcv3-check-mark {
    background: var(--pcv3-warn-soft);
    color: var(--pcv3-warn);
}

.pcv3-audit {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 16px 20px;
    background: var(--pcv3-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pcv3-audit-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pcv3-ink-3);
}

.pcv3-audit-value {
    flex: 1;
    color: var(--pcv3-ink-2);
    font-size: 14px;
}

/* ===== Buttons ===== */
.pcv3-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.pcv3-btn-primary {
    background: var(--pcv3-primary);
    color: #fff;
}

    .pcv3-btn-primary:hover:not(:disabled) {
        filter: brightness(0.95);
    }

    .pcv3-btn-primary:disabled {
        background: var(--pcv3-ink-3);
        cursor: not-allowed;
    }

.pcv3-btn-secondary {
    background: #fff;
    border-color: var(--pcv3-line);
    color: var(--pcv3-ink);
}

    .pcv3-btn-secondary:hover:not(:disabled) {
        border-color: var(--pcv3-ink-2);
    }

.pcv3-btn-ghost {
    background: #fff;
    border-color: var(--pcv3-line);
    color: var(--pcv3-ink-2);
}

    .pcv3-btn-ghost:hover:not(:disabled) {
        background: var(--pcv3-bg);
    }

.pcv3-btn-link {
    background: transparent;
    color: var(--pcv3-ink-2);
    padding: 8px 6px;
}

    .pcv3-btn-link:hover:not(:disabled) {
        color: var(--pcv3-ink);
        text-decoration: underline;
    }

.pcv3-btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.pcv3-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Inputs ===== */
.pcv3-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--pcv3-line);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    font-variant-numeric: tabular-nums;
    color: var(--pcv3-ink);
}

    .pcv3-input:focus {
        outline: 2px solid var(--pcv3-primary);
        outline-offset: -1px;
        border-color: var(--pcv3-primary);
    }

    .pcv3-input:disabled {
        background: #fafbfc;
        color: var(--pcv3-ink-2);
    }

.pcv3-input--rate {
    width: 90px;
    text-align: right;
}

/* ===== Footer nav ===== */
.pcv3-footer {
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .pcv3-final {
        grid-template-columns: 1fr;
    }

    .pcv3-deduction-fields {
        grid-template-columns: 1fr;
    }

    .pcv3-catalog {
        grid-template-columns: 1fr;
    }

    .pcv3-stepper {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .pcv3-header {
        flex-direction: column;
    }

    .pcv3-netto {
        border-left: 0;
        border-top: 1px solid var(--pcv3-line);
        padding-left: 0;
        padding-top: 16px;
        text-align: left;
    }

    .pcv3-row {
        flex-wrap: wrap;
    }

    .pcv3-row-actions {
        width: 100%;
    }
}
