.third-party-page { --report-accent: var(--primary); }
.desktop-ledger-page { width: min(1780px, calc(100% - 32px)); min-width: 1180px; }
.third-party-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 20px; padding: 30px 32px 34px; border-radius: 12px; background: var(--surface-dark); color: #fff; box-shadow: var(--shadow-strong); }
.third-party-hero h1 { margin: 11px 0 8px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.third-party-hero p { max-width: 820px; margin: 0; color: rgba(255,255,255,.7); }
.third-party-hero .eyebrow-row { color: rgba(255,255,255,.65); }
.third-party-hero .demo-flag { background: rgba(37,99,166,.2); color: #D7EEEA; }
.third-party-hero .button.secondary { flex: 0 0 auto; border-color: rgba(255,255,255,.3); background: transparent; color: #fff; }
.third-party-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.third-party-metrics article { position: relative; overflow: hidden; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.third-party-metrics article::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--report-accent); content: ""; }
.third-party-metrics span,.third-party-metrics small { display: block; color: var(--muted); font-size: 11px; }
.third-party-metrics strong { display: block; margin: 4px 0; color: var(--ink); font-family: var(--font-mono); font-size: 30px; line-height: 1; }
.third-party-library { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.invoice-summary-section { margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.invoice-summary-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 23px 26px 19px; }
.invoice-summary-heading > div:first-child { max-width: 760px; }
.invoice-summary-heading > div:first-child > span { color: var(--primary); font-family: var(--font-mono); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.invoice-summary-heading h2 { margin: 4px 0 5px; font-size: 23px; }
.invoice-summary-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.summary-legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.summary-legend span { display: inline-flex; align-items: center; gap: 6px; }
.summary-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--primary); }
.summary-legend .legend-no-order { background: var(--warning); }
.summary-legend .legend-shengjin { background: var(--surface-dark); }
.invoice-summary-table-wrap { border-top: 1px solid var(--line); }
.invoice-summary-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.invoice-summary-table th,.invoice-summary-table td { padding: 12px 18px; border-bottom: 1px solid #edf0f2; text-align: right; }
.invoice-summary-table thead th { background: #f3f5f7; color: #17324D; font-size: 12px; font-weight: 750; white-space: nowrap; }
.invoice-summary-table th:first-child { text-align: left; }
.invoice-summary-table tbody th { color: var(--ink); font-family: var(--font-mono); font-size: 12px; }
.invoice-summary-table tbody td { color: #343a45; font-family: var(--font-mono); font-size: 13px; }
.invoice-summary-table tbody tr:hover { background: #EAF5F2; }
.invoice-summary-table .summary-total { color: var(--primary); font-weight: 850; }
.invoice-summary-table .is-future { background: var(--surface-soft); }
.invoice-summary-table .is-future th,.invoice-summary-table .is-future td { color: #a1a7b0; }
.invoice-summary-table td span { font-family: var(--font-sans); font-size: 11px; }
.third-party-library-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 26px 20px; }
.third-party-library-heading > div:first-child { max-width: 820px; }
.third-party-library-heading span { color: var(--report-accent); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.third-party-library-heading h2 { margin: 4px 0 5px; font-size: 23px; }
.third-party-library-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.record-count { min-width: 110px; text-align: right; }
.record-count strong,.record-count span { display: block; }
.record-count strong { color: var(--ink); font-family: var(--font-mono); font-size: 30px; }
.record-count span { color: var(--muted); letter-spacing: 0; }
.third-party-filters { display: grid; grid-template-columns: minmax(300px,1fr) 170px 220px 150px auto; align-items: end; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.third-party-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.third-party-filters input,.third-party-filters select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.third-party-filters input:focus,.third-party-filters select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,166,.13); outline: 0; }
.table-save-state { min-height: 31px; padding: 7px 26px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; text-align: right; }
.table-save-state[data-state="saving"] { color: var(--warning); }
.table-save-state[data-state="saved"] { color: var(--success); }
.table-save-state[data-state="error"] { color: var(--danger); }
.third-party-table-wrap { max-width: 100%; max-height: 720px; overflow: auto; border-top: 1px solid var(--line); scrollbar-color: #c9ced6 transparent; }
.third-party-table { width: 100%; min-width: 1320px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.third-party-table th { position: sticky; top: 0; z-index: 3; padding: 10px 5px; border-bottom: 1px solid var(--line); background: #f3f5f7; color: #17324D; text-align: left; white-space: normal; line-height: 1.3; }
.third-party-table td { height: 48px; padding: 6px 5px; border-bottom: 1px solid #edf0f2; background: #fff; color: #303642; vertical-align: middle; overflow-wrap: anywhere; }
.third-party-table th:nth-child(1) { width: 84px; }
.third-party-table th:nth-child(2),
.third-party-table th:nth-child(9),
.third-party-table th:nth-child(15) { width: 112px; }
.third-party-table th:nth-child(3) { width: 88px; }
.third-party-table th:nth-child(4) { width: 96px; }
.third-party-table th:nth-child(5) { width: 104px; }
.third-party-table th:nth-child(6) { width: 108px; }
.third-party-table th:nth-child(7) { width: 42px; }
.third-party-table th:nth-child(8) { width: 96px; }
.third-party-table th:nth-child(10) { width: 72px; }
.third-party-table th:nth-child(11),
.third-party-table th:nth-child(16) { width: 68px; }
.third-party-table th:nth-child(12),
.third-party-table th:nth-child(13) { width: 88px; }
.third-party-table th:nth-child(14) { width: 100px; }
.third-party-table tbody tr:hover td { background: #EAF5F2; }
.third-party-table .sticky-party { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.party-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 8px; border-radius: 5px; background: var(--accent-soft); color: var(--primary); font-family: var(--font-mono); font-size: 11px; font-weight: 800; }
.date-cell,.code-cell,.money-cell,.number-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table-editor { height: 34px; border: 1px solid #d7dbe1; border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px; transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.table-editor:hover { border-color: #aeb5bf; }
.table-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,166,.12); outline: 0; }
.table-editor:disabled { cursor: wait; background: #f2f4f6; opacity: .7; }
.laboratory-editor,.invoice-editor,.date-editor { width: 100%; min-width: 0; padding: 0 4px; }
.laboratory-editor { font-weight: 700; }
.date-editor { font-family: var(--font-mono); font-size: 10px; }
.wide-cell { white-space: normal; }
.number-cell { text-align: center; white-space: nowrap; }
.report-cell { line-height: 1.35; }
.report-cell a { display: inline-block; color: var(--primary); font-family: var(--font-mono); font-weight: 750; line-height: 1.5; text-decoration: underline; text-decoration-color: rgba(37,99,166,.32); text-underline-offset: 3px; }
.report-cell a:hover { color: var(--secondary); text-decoration-color: currentColor; }
.pending-report { color: var(--muted); }
.result-badge { display: inline-flex; max-width: 190px; min-height: 25px; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 750; line-height: 1.35; }
.result-badge.is-pass { background: var(--success-soft); color: var(--success); }
.result-badge.is-fail { background: var(--danger-soft); color: var(--danger); }
.result-badge.is-pending { background: var(--warning-soft); color: var(--warning); }
.third-party-empty { padding: 28px; color: var(--muted); text-align: center; }
.detail-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.detail-breadcrumb a { color: var(--primary); font-weight: 700; }
.report-detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 28px 30px; border-radius: 12px; background: var(--surface-dark); color: #fff; box-shadow: var(--shadow-strong); }
.report-detail-hero h1 { margin: 10px 0 5px; font-family: var(--font-mono); font-size: clamp(26px,3vw,40px); }
.report-detail-hero p { margin: 0; color: rgba(255,255,255,.68); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.report-link-pending { padding: 10px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; color: rgba(255,255,255,.65); font-size: 12px; }
.report-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.report-detail-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.report-detail-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.report-detail-card header span:first-child { color: var(--primary); font-family: var(--font-mono); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.report-detail-card h2 { margin: 3px 0 0; font-size: 19px; }
.report-detail-card dl { margin: 0; }
.report-detail-card dl div { display: grid; grid-template-columns: minmax(120px,.35fr) 1fr; gap: 18px; padding: 11px 0; border-top: 1px solid #edf0f2; }
.report-detail-card dt { color: var(--muted); font-size: 12px; }
.report-detail-card dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.source-link { display: inline-flex; margin-top: 14px; color: var(--primary); font-size: 12px; font-weight: 750; }
@media (max-width: 1100px) { .report-detail-page { min-width: 0; } .report-detail-grid { grid-template-columns: 1fr; } }
