/* Compact workspace layout, using the original blue-and-white palette. */
#detail-screen .right{background:#fff;padding:20px 22px 30px;color:#18212c}
#detail-screen .right .sub,#detail-screen .right .muted{font-size:13px;line-height:1.6}
#detail-screen .review-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
#detail-screen .review-heading h2{font-size:20px;letter-spacing:0;color:#18212c}
#detail-screen .review-heading .btn{font-size:13px}
#detail-screen .right>.sub{margin:7px 0 14px}
#detail-screen .contract-person{display:grid;grid-template-columns:90px minmax(0,1fr);gap:6px 10px;align-items:center;margin:0 0 14px;font-size:13px}
#detail-screen .contract-person label{color:#52647b}
#detail-screen .contract-person input{width:100%;min-width:0;padding:8px 10px;border:1px solid #ccd6e1;border-radius:7px;font-size:14px;color:#18212c;background:#fff}
#detail-screen .contract-person input:disabled{background:#f4f7fb;color:#64748b}
#detail-screen .contract-person .muted{grid-column:2;margin:0;font-size:12px}
#detail-screen .right .sticky-review{padding:4px 0 8px;background:#fff;box-shadow:none}
#detail-screen .right .sticky-review .summary{position:static;margin:0;padding:12px 16px;background:#edf5ff;border:1px solid #c9ddfb;border-radius:10px;box-shadow:0 2px 8px #24324408;backdrop-filter:none}
#detail-screen .summary-main{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:4px 12px;margin-bottom:9px}
#detail-screen .summary-main>.muted{font-weight:600}
#detail-screen .right .summary .big{font-size:26px;font-weight:700;line-height:1.2;letter-spacing:-.3px;margin:0;color:#18212c;min-width:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#detail-screen .summary-status{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:4px 12px}
#detail-screen .right .sticky-review .review-progress{padding:0;margin:0;background:none;border:0;border-radius:0;font-size:13px;color:#42526a}
#detail-screen .summary-status #pending{font-size:13px}
#detail-screen .summary .progress-track{height:5px;margin-top:9px;background:#e5eaf0}
#detail-screen .summary .progress-fill{background:#16a36a}
#detail-screen .section-caption{margin:18px 0 10px;font-size:15px;font-weight:650;color:#18212c}
#detail-screen .right .item{margin:12px 0 16px;background:#fff;border:1px solid #93a9c9;border-radius:10px;box-shadow:0 3px 10px #284c8020}
#detail-screen .itemhead{padding:12px 14px;background:#edf3fc;border-bottom:1px solid #bfd0e7;flex-wrap:wrap;gap:8px;border-radius:10px 10px 0 0}
#detail-screen .item-heading{display:flex;align-items:baseline;gap:8px;flex:1;min-width:120px}
#detail-screen .item-heading strong{font-size:16px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
#detail-screen .item-number{font-size:12px;color:#8895a6;font-variant-numeric:tabular-nums}
#detail-screen .itemhead .badge{font-size:12px;font-weight:600;padding:4px 8px;border-radius:6px;line-height:1.5}
#detail-screen .itemhead .badge.needs-price,#detail-screen .itemhead .badge.awaiting-review{background:#fff0d6;color:#835400}
#detail-screen .itemhead .badge.ok{background:#e5f5ea;color:#236b3c}
#detail-screen .item-menu{margin-left:0}
#detail-screen .item-menu summary{font-size:18px;color:#748092;padding:4px 6px}
#detail-screen .delete-item-btn{border:0;background:#fff;color:#b42318;font-size:12px;font-weight:500;padding:6px}
#detail-screen .item-body{padding:14px}
#detail-screen .source{padding:0;background:#f4f7fa;border:1px solid #edf0f4;border-radius:7px;font-size:13px;color:#64748b;line-height:1.65}
#detail-screen .source-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0;padding:9px 11px;font-weight:500;font-size:13px;list-style:none;cursor:pointer;color:#465569;overflow-wrap:anywhere}
#detail-screen .source-title::-webkit-details-marker{display:none}
#detail-screen .source-title::after{content:'展开';flex-shrink:0;font-size:12px;color:#64748b}
#detail-screen .source[open]>.source-title::after{content:'收起'}
#detail-screen .source-detail{padding:0 11px 11px;white-space:pre-line;overflow-wrap:anywhere}
#detail-screen .item-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
#detail-screen .field-group label,#detail-screen .note-wrap label{font-size:13px;font-weight:500;line-height:1.5}
#detail-screen .field-group input{padding:10px 11px;font-size:16px;font-weight:600;border-color:#ccd6e1;border-radius:7px;color:#1e293b;font-variant-numeric:tabular-nums}
#detail-screen .field-group.price input{color:#1262cc}
#detail-screen .subtotal-row{padding:10px 0;margin-top:12px;border-top:1px solid #edf0f4;border-bottom:1px solid #edf0f4;border-radius:0;background:#f2f7ff;gap:12px}
#detail-screen .subtotal-row span{font-size:13px;color:#52647b}
#detail-screen .subtotal-row strong{font-size:19px;font-weight:650;color:#135ec0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#detail-screen .note-wrap{margin-top:12px}
#detail-screen .note-input{font-size:14px;padding:10px 11px;border-color:#d7e0ea;border-radius:7px}
#detail-screen .item-actions{grid-template-columns:minmax(0,1fr) auto;gap:10px;margin-top:14px}
#detail-screen .confirm-btn{min-height:42px;padding:10px 12px;background:#1668df;border-color:#1668df;border-radius:7px;font-size:14px;font-weight:600;line-height:1.5}
#detail-screen .confirm-btn.confirmed{background:#e9f8ef;border-color:#a5dec0;color:#187144}
#detail-screen .item-actions .jump-btn{min-height:42px;padding:10px;font-size:13px;width:auto;line-height:1.5}
#detail-screen .right .btn{border-radius:7px;line-height:1.5}
#detail-screen .right .btn.primary{background:#1769e0;border-color:#1769e0}
#detail-screen .right button:disabled{cursor:not-allowed}
#detail-screen .commission-panel{background:#f0f6ff;border-color:#d5e4ff;border-radius:10px;padding:18px}
#detail-screen .commission-panel h3{font-size:15px;font-weight:650;color:#273e5c}
#detail-screen .commission-figures{border-color:#cedff5;color:#516783;font-size:13px}
#detail-screen .commission-figures strong{color:#273e5c}
#detail-screen .commission-calculation label,#detail-screen .commission-result>span{font-size:13px;font-weight:500;color:#516783}
#detail-screen .percent-input input{border-color:#b4cce9;border-radius:7px;color:#204b83}
#detail-screen .commission-result strong{font-size:24px;font-weight:650;color:#135ec0}
#detail-screen .right .commission-hint.warning{color:#925800}
#detail-screen .right .review-actions{position:static;bottom:auto;z-index:auto;background:transparent;border-color:#edf0f4;padding:12px 0;gap:9px}
#detail-screen .review-actions .btn{font-size:14px;padding:10px 12px;font-weight:600}
#detail-screen .review-actions .action-row:last-child .btn{font-size:13px;padding:8px 10px;font-weight:500}
#detail-screen .right .save-status{font-size:13px;color:#64748b}
#detail-screen .right .save-status.dirty{color:#926000}
#detail-screen .right :is(button,input,summary):focus-visible{outline:2px solid #3181e8;outline-offset:2px}
@media(max-width:1100px){#detail-screen .right{padding:16px}#detail-screen .item-actions{grid-template-columns:1fr}#detail-screen .item-actions .jump-btn{width:100%}}
@media(max-width:420px){#detail-screen .right{padding:14px}#detail-screen .summary-main .big{font-size:24px}#detail-screen .itemhead{gap:6px}#detail-screen .item-heading{flex-basis:100%}}
@media(max-height:650px){#detail-screen .right .sticky-review{position:static}}
.contract-facts{margin:18px 0;background:#f5f9ff;border:1px solid #d5e4ff;border-radius:10px;padding:4px 16px}
.contract-facts>div{display:grid;grid-template-columns:85px minmax(0,1fr);gap:12px;padding:12px 0;border-bottom:1px solid #e1e8f1;font-size:14px}
.contract-facts>div:last-child{border-bottom:0}.contract-facts dt{color:#64748b}.contract-facts dd{margin:0;overflow-wrap:anywhere;line-height:1.5;color:#18212c}
.manager-decisions{display:flex;gap:12px;margin:20px 0}.manager-decisions .btn{min-width:120px;padding:13px 18px;font-size:16px}
.workflow-form{margin:20px 0;padding:16px;border:1px solid #dce3eb;border-radius:10px;background:#fff}
.workflow-form h3{font-size:15px;margin:0 0 12px}.workflow-form label{display:block;font-size:13px;color:#52647b;margin:12px 0}
.workflow-form input,.workflow-form select{display:block;width:100%;min-width:0;padding:9px 10px;margin-top:6px;border:1px solid #ccd6e1;border-radius:7px;font-size:14px;background:#fff;color:#18212c}
.workflow-form+.btn{margin-bottom:20px}.people-card{width:min(800px,95vw)}.people-table{border-collapse:collapse;width:100%;min-width:530px;font-size:14px}
.people-table th,.people-table td{text-align:left;padding:12px 10px;border-bottom:1px solid #edf1f6}.people-table th{background:#f5f9ff;color:#52647b}
.pdf-version-badge{font-size:12px;color:#315780;background:#eaf3ff;border:1px solid #c9def8;border-radius:6px;padding:7px 9px;white-space:nowrap}
#pdf-version-toggle{white-space:nowrap;font-size:13px}
@media(max-width:650px){#detail-screen header{height:auto;min-height:65px;padding:12px;flex-wrap:wrap;gap:10px}.layout{height:auto}.manager-decisions{flex-wrap:wrap}}
/* Full audit history remains readable when a contract has many changes. */
.history-card{width:min(760px,calc(100vw - 32px));max-height:min(85vh,900px);display:flex;flex-direction:column}
.history-rows{overflow:auto;min-height:0;padding:4px 2px}
.history-entry{border:1px solid #d7e3f0;border-radius:10px;background:#f8fbff;padding:12px 14px;margin:0 0 10px}
.history-entry-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#23395d}
.history-entry time,.history-entry p{color:#52627a;font-size:13px}
.history-entry p{margin:7px 0 0;overflow-wrap:anywhere}
.history-entry details{margin-top:10px}.history-entry summary{cursor:pointer;color:#235384}
.history-entry pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;font-size:12px}
.queue-tabs{display:flex;gap:8px;padding:14px 22px 0;border-bottom:1px solid #e8edf3}
.queue-tabs button{border:1px solid #d7e3f0;border-bottom:0;background:#f5f8fc;color:#52647b;padding:11px 20px;border-radius:10px 10px 0 0;font-weight:700;cursor:pointer}
.queue-tabs button.active{background:#fff;color:#155ca8;box-shadow:inset 0 3px #2573c5}
.queue-your-turn{display:flex;align-items:center;gap:4px;font-size:10px;font-weight:700;color:#97534e;margin-top:4px}
.queue-your-turn::before{content:"";display:inline-block;width:6px;height:6px;flex:none;border-radius:50%;background:#dc827c}
.ai-status{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;padding:12px 14px;background:#f3f8ff;border:1px solid #d6e5f7;border-radius:9px;font-size:13px;color:#315780}
.ai-status[hidden]{display:none}.ai-status p{margin:4px 0 0;color:#52647b;line-height:1.5}.ai-status button{flex:none}
.btn.danger{border-color:#edc9c9;color:#a52d2d;background:#fff8f8}
.btn.danger:hover{background:#ffecec}

/* Increase card separation in the right workspace while keeping the blue palette. */
#detail-screen .right{background:#f1f5fa}
#detail-screen .right .sticky-review{background:#f1f5fa}
#detail-screen .right .deduction-text-section,
#detail-screen .right .production-notes-view,
#detail-screen .right .commission-panel,
#detail-screen .right .contract-facts{border:1px solid #8fa8c8;box-shadow:0 3px 12px rgba(40,76,128,.1)}
#detail-screen .right .deduction-text-section{background:#fff;border-left:4px solid #879fbe}
#detail-screen .right .production-notes-section,
#detail-screen .right .production-notes-view{background:#eaf3ff;border-left:4px solid #5685ba}
#detail-screen .right .deduction-text-section h3,
#detail-screen .right .production-notes-view h3{color:#234b78}
#detail-screen .right .commission-panel{background:#edf4fc}
#detail-screen .right .contract-facts{background:#fff}
#detail-screen .right .item{border-color:#7897bd;box-shadow:0 3px 12px rgba(40,76,128,.15)}
#detail-screen .right .itemhead{background:#dfeafa;border-bottom-color:#a2b8d6}
#detail-screen .right .source{background:#eff3f8;border-color:#d4deea}
#detail-screen .right .deduction-text-section textarea,
#detail-screen .right .field-group input,
#detail-screen .right .note-input{border-color:#a5b6ce}

/* Keep field labels distinct from their values in the approval details. */
.contract-facts>div{grid-template-columns:112px minmax(0,1fr);gap:16px;align-items:baseline}.contract-facts dt{font-size:13px;font-weight:400;line-height:1.6;color:#64758b;letter-spacing:.02em}.contract-facts dd{font-size:15px;font-weight:500;line-height:1.65;color:#162c46;font-variant-numeric:tabular-nums}@media(max-width:480px){.contract-facts>div{grid-template-columns:94px minmax(0,1fr);gap:12px}.contract-facts dt{font-size:12px}.contract-facts dd{font-size:14px}}

#deduction-text-section #ai-review-status{margin:12px 0 0;padding:12px 0 0;border:0;border-top:1px solid #dce6f2;border-radius:0;background:transparent;box-shadow:none}#deduction-text-section #ai-review-status .ai-status-message{margin:6px 0 0}
