.qa-wo-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface-base);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
}

.qa-wo-toolbar-spacer {
    flex: 1 1 auto;
}

.qa-wo-toolbar-btn {
    background: var(--color-surface-base);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--color-text-base);
    cursor: pointer;
}

.qa-wo-toolbar-btn:hover {
    background: var(--color-surface-muted);
}

.qa-wo-toolbar-btn--primary {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

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

.qa-wo-loading {
    padding: 40px;
    text-align: center;
    color: var(--color-text-muted);
}

.qa-wo-page {
    width: 210mm;
    min-height: 297mm;
    margin: 12px auto;
    padding: 12mm 10mm;
    background: white;
    color: #1f2937;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.qa-wo-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10mm;
    align-items: start;
    margin-bottom: 6mm;
}

.qa-wo-company {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4mm;
}

.qa-wo-logo {
    max-width: 40mm;
    max-height: 30mm;
    object-fit: contain;
}

.qa-wo-company-info {
    font-size: 11px;
    color: #1f2937;
    line-height: 1.5;
}

.qa-wo-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.qa-wo-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    text-align: right;
    margin-bottom: 4mm;
}

.qa-wo-meta-grid {
    display: grid;
    grid-template-columns: 30mm minmax(0, 1fr);
    border: 1px solid #d1d5db;
    background: #e5e7eb;
}

.qa-wo-meta-label {
    padding: 3px 10px;
    background: #d1d5db;
    border-right: 1px solid #d1d5db;
    border-bottom: 1px solid #f3f4f6;
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    text-align: right;
}

.qa-wo-meta-value {
    padding: 3px 10px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    color: #1f2937;
}

.qa-wo-meta-grid > :nth-last-child(-n+2) {
    border-bottom: 0;
}

.qa-wo-twocol {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border: 1px solid #d1d5db;
    margin-bottom: 4mm;
}

.qa-wo-section + .qa-wo-section {
    border-left: 1px solid #d1d5db;
}

.qa-wo-section-header {
    background: #e5e7eb;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    color: #1f2937;
    border-bottom: 1px solid #d1d5db;
}

.qa-wo-section-body {
    padding: 6px 10px;
    min-height: 22mm;
}

.qa-wo-center {
    text-align: center;
}

.qa-wo-row {
    display: grid;
    grid-template-columns: 38mm minmax(0, 1fr);
    border: 1px solid #d1d5db;
    border-bottom: 0;
}

.qa-wo-row:last-of-type {
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 4mm;
}

.qa-wo-row-label {
    background: #e5e7eb;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
    color: #1f2937;
    border-right: 1px solid #d1d5db;
}

.qa-wo-row-body {
    padding: 4px 10px;
    background: white;
    min-height: 8mm;
}

.qa-wo-items {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d1d5db;
    margin-bottom: 0;
}

.qa-wo-items thead th {
    background: white;
    border-bottom: 1px solid #d1d5db;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
    text-align: left;
    color: #1f2937;
}

.qa-wo-items tbody td {
    padding: 4px 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    font-size: 11px;
}

.qa-wo-items-qty,
.qa-wo-items-rate,
.qa-wo-items-total {
    width: 24mm;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.qa-wo-totals {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-top: 0;
    margin-bottom: 4mm;
}

.qa-wo-total-cell {
    padding: 4px 10px;
    border-right: 1px solid #d1d5db;
}

.qa-wo-total-cell:last-child {
    border-right: 0;
}

.qa-wo-total-label {
    font-size: 10px;
    font-weight: 700;
    color: #1f2937;
}

.qa-wo-total-value {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.qa-wo-total-cell--final .qa-wo-total-value {
    font-weight: 700;
}

.qa-wo-financing {
    display: grid;
    grid-template-columns: 24mm minmax(0, 1fr) auto;
    gap: 6mm;
    align-items: center;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    padding: 4mm;
    margin-bottom: 6mm;
    margin-left: auto;
    width: 50%;
}

.qa-wo-qr {
    width: 22mm;
    height: 22mm;
    background: repeating-conic-gradient(#1f2937 0 25%, white 0 50%) 0 0 / 4mm 4mm;
    border: 1px solid #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-wo-qr-placeholder {
    background: white;
    padding: 1px 4px;
    font-size: 8px;
    font-weight: 700;
    color: #1f2937;
}

.qa-wo-fin-text {
    font-size: 11px;
    color: #4b5563;
}

.qa-wo-fin-amount {
    text-align: right;
    color: #4b5563;
}

.qa-wo-fin-amount strong {
    color: #1f2937;
    font-size: 14px;
}

.qa-wo-fin-fineprint {
    font-size: 8px;
    color: #6b7280;
    margin-top: 2px;
}

.qa-wo-signatures {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 4mm;
    margin-top: 4mm;
}

.qa-wo-sig {
    display: flex;
    flex-direction: column;
}

.qa-wo-sig-header {
    background: white;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    color: #1f2937;
    border-bottom: 1px solid #d1d5db;
}

.qa-wo-sig-body {
    border: 1px solid #d1d5db;
    border-top: 0;
    min-height: 18mm;
    background: white;
}

.qa-wo-sig-line {
    display: flex;
    align-items: center;
    gap: 4mm;
    padding: 3mm 0 0 0;
    font-size: 11px;
    color: #1f2937;
}

.qa-wo-sig-underline {
    flex: 1 1 auto;
    border-bottom: 1px solid #1f2937;
    height: 14px;
}

@media print {
    body {
        background: white !important;
    }
    .qa-wo-toolbar,
    nav,
    header,
    aside,
    .qa-app-shell-side,
    .qa-app-shell-header {
        display: none !important;
    }
    .qa-wo-page {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    @page {
        size: A4 portrait;
        margin: 12mm 10mm;
    }
}
