.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: left;
    font-variant-numeric: tabular-nums;
}

.qa-wo-items-sub {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

.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-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;
    }
}

.qa-wo-item-image {
    display: block;
    margin-top: 6px;
    max-width: 130px;
    max-height: 100px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    object-fit: contain;
}

.qa-wo-toolbar-style {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.qa-wo-toolbar-style-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qa-wo-toolbar-style-btn {
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 999px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.qa-wo-toolbar-style-btn--active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.qa-wo-toolbar-docs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.qa-wo-export {
    position: relative;
    display: inline-flex;
}

.qa-wo-export-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qa-wo-export-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.qa-wo-export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qa-wo-export-item {
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #0f172a;
    cursor: pointer;
}

.qa-wo-export-item:hover {
    background: #f1f5f9;
}

.qa-wo-page-break {
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    padding: 12px 0;
    border-top: 1px dashed #cbd5e1;
    border-bottom: 1px dashed #cbd5e1;
    margin: 16px 0;
    page-break-before: always;
    break-before: page;
}

.qa-wo-terms {
    font-size: 12px;
    line-height: 1.5;
}

.qa-wo-terms h1, .qa-wo-terms h2, .qa-wo-terms h3 {
    font-weight: 700;
    margin: 12px 0 6px;
}

.qa-wo-terms p { margin: 6px 0; }

.qa-wo-terms ol, .qa-wo-terms ul {
    margin: 6px 0 6px 24px;
}

.qa-wo-legaldoc-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.qa-wob-page {
    width: 210mm;
    min-height: 297mm;
    margin: 12px auto;
    background: #ffffff;
    color: #0f172a;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.qa-wob-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e3a8a;
    padding: 18px 28px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.qa-wob-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qa-wob-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.qa-wob-company {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.qa-wob-tagline {
    color: #60a5fa;
    font-size: 10px;
}

.qa-wob-headmeta {
    text-align: right;
}

.qa-wob-headtitle {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.qa-wob-headnumber {
    color: #fbbf24;
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

.qa-wob-body {
    padding: 24px 32px;
}

.qa-wob-twocol {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 24px;
    margin-bottom: 16px;
}

.qa-wob-label {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.1em;
}

.qa-wob-prepared-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
}

.qa-wob-muted {
    font-size: 11px;
    color: #475569;
}

.qa-wob-details .qa-wob-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    margin-top: 4px;
    font-size: 11px;
}

.qa-wob-detail-row span:first-child {
    color: #475569;
}

.qa-wob-detail-row span:last-child {
    color: #0f172a;
    font-weight: 600;
}

.qa-wob-notes {
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px;
}

.qa-wob-notes-body {
    margin-top: 6px;
    font-size: 11px;
    color: #0f172a;
    line-height: 1.5;
}

.qa-wob-table {
    width: 100%;
    border-collapse: collapse;
}

.qa-wob-table thead th {
    background: #1e3a8a;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 8px;
    text-align: left;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.qa-wob-th-img {
    width: 96px;
}

.qa-wob-table thead th.qa-wob-th-right {
    text-align: right;
}

.qa-wob-table tbody td {
    padding: 10px 8px;
    vertical-align: top;
    border: none;
}

.qa-wob-td-img {
    width: 96px;
    vertical-align: middle;
}

.qa-wob-row-alt td {
    background: #f8fafc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.qa-wob-td-right {
    text-align: right;
}

.qa-wob-td-bold {
    font-weight: 700;
}

.qa-wob-li-name {
    font-weight: 600;
    color: #0f172a;
}

.qa-wob-li-detail {
    font-size: 9px;
    color: #475569;
    margin-top: 2px;
}

.qa-wob-li-image {
    display: block;
    max-width: 90px;
    max-height: 90px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    object-fit: contain;
}

.qa-wob-totals-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.qa-wob-totals {
    width: 280px;
    border: 1px solid #e2e8f0;
    padding: 14px;
}

.qa-wob-total-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 11px;
}

.qa-wob-total-row span:first-child {
    color: #475569;
}

.qa-wob-total-row span:last-child {
    color: #0f172a;
    font-weight: 700;
}

.qa-wob-total-grand {
    border-top: 2px solid #1e3a8a;
    margin-top: 6px;
    padding-top: 8px;
}

.qa-wob-total-grand span {
    font-size: 14px !important;
}

.qa-wob-signatures {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.qa-wob-sig {
    display: flex;
    flex-direction: column;
}

.qa-wob-sig-body {
    border: 1px solid #e2e8f0;
    min-height: 18mm;
    margin-top: 6px;
    background: #ffffff;
}

.qa-wob-sig-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    font-size: 11px;
    color: #0f172a;
}

.qa-wob-sig-underline {
    flex: 1 1 auto;
    border-bottom: 1px solid #94a3b8;
    height: 14px;
}

@media print {
    .qa-wob-page {
        width: 100%;
        min-height: 0;
        margin: 0;
        box-shadow: none;
    }

    .qa-wo-page-break {
        border: none;
        color: transparent;
        padding: 0;
        height: 0;
        margin: 0;
    }
}
