* { box-sizing: border-box; }
body { margin: 0; background: #f4f6f8; color: #243945; font-family: 'IBM Plex Sans Arabic', 'Cairo', Tahoma, sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid #174c56; background: #174c56; color: white; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(.96); } button:disabled { opacity: .45; cursor: not-allowed; }
button.quiet { background: white; border-color: #d8e1e4; color: #36555d; }
button.danger { background: #fff3f2; border-color: #ead3d0; color: #9e4033; padding: 7px 10px; font-size: 12px; }
input, select, textarea { border: 1px solid #d5dfe3; border-radius: 7px; padding: 9px; background: white; width: 100%; min-width: 0; color: #243945; }
input:focus, textarea:focus, select:focus { outline: 2px solid #bda06a; outline-offset: 2px; }
input[type=number] { direction: ltr; text-align: right; }
textarea { resize: vertical; min-height: 65px; }
input:disabled, textarea:disabled, select:disabled { color: #3e545e; background: #f3f6f7; opacity: 1; }
.quotation-workspace { max-width: 1650px; margin: auto; padding: 32px; }
.quotation-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.quotation-heading p { color: #8a774c; font-size: 13px; margin: 0; }
h1 { font-size: 30px; margin: 7px 0; letter-spacing: -.5px; }
h2 { font-size: 20px; margin: 8px 0; } h3 { font-size: 16px; margin: 25px 0 10px; }
.quotation-heading span, .muted { color: #74838e; font-size: 13px; line-height: 1.8; }
.quotation-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.quotation-card { background: white; border: 1px solid #e1e7ea; border-radius: 16px; box-shadow: 0 7px 24px #23383f04; }
.quotation-list-panel { padding: 20px; position: sticky; top: 22px; }
.list-heading, .editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-heading h2 { font-size: 16px; } .list-heading button { font-size: 12px; padding: 7px 10px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #4c646f; margin: 14px 0; }
.quotation-list-item { text-align: right; width: 100%; display: flex; flex-direction: column; gap: 7px; border-color: #e3e9eb; background: #fff; color: #36535f; padding: 14px; margin-top: 12px; }
.quotation-list-item.selected { background: #f2f8f7; border-color: #6c9598; }
.quotation-list-item span:not(.status) { font-size: 12px; color: #7d8e96; }
.quotation-list-item small { font-size: 10px; overflow-wrap: anywhere; text-align: right; }
.status { display: inline-flex; width: fit-content; font-size: 11px; padding: 4px 8px; border-radius: 20px; background: #eef1f4; color: #60727d; }
.status-engineer_pending { color: #8a650d; background: #fff5d7; }
.status-management_pending { color: #57518f; background: #f0edff; }
.status-approved { background: #e6f4ec; color: #357550; }
.editor-panel { padding: 26px; min-width: 0; }
.empty-state { padding: 30px 12px; text-align: center; color: #84929a; line-height: 1.9; }
.empty-state h2, .empty-state h3 { color: #58717b; font-size: 16px; }
.quotation-notice { min-height: 0; color: #24605b; line-height: 1.7; font-size: 13px; }
.quotation-notice:not(:empty) { margin-bottom: 18px; padding: 12px 16px; border: 1px solid #cce3dc; background: #edf7f2; border-radius: 10px; }
.quotation-notice.error { color: #9b3a32; border-color: #e9ccc9; background: #fff2f0; }
.workflow-strip { display: flex; gap: 9px; padding: 18px 0; flex-wrap: wrap; border-bottom: 1px solid #e8ecee; }
.workflow-strip span { font-size: 11px; color: #778a93; padding: 7px 10px; background: #f5f7f8; border-radius: 7px; }
.binding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.binding-actions, .item-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.quiet-link { color: #45717c; font-size: 12px; text-decoration: none; border-bottom: 1px dotted #79969f; }
.binding-actions button, .item-controls button { padding: 8px 10px; font-size: 12px; }
.binding-note { background: #f3f8f8; border-right: 3px solid #ae955f; border-radius: 8px; padding: 13px; margin-top: 16px; line-height: 1.8; font-size: 13px; }
.binding-note small { display: block; color: #718b93; }
.empty-note { color: #85969f; font-size: 13px; background: #f7f8f9; padding: 14px; border-radius: 8px; }
.confidential-note { font-size: 12px; color: #8e6741; background: #fff8ed; padding: 11px 14px; border-radius: 8px; line-height: 1.8; }
.item-controls select { flex: 1 1 210px; font-size: 12px; }
.line-table { overflow-x: auto; margin: 18px 0; border: 1px solid #e0e6e9; border-radius: 9px; }
table { border-collapse: collapse; width: 100%; min-width: 910px; table-layout: fixed; }
th { font-size: 11px; background: #f2f5f7; color: #607a84; padding: 12px 8px; text-align: right; }
th:first-child { width: 28%; } th:nth-child(2) { width: 10%; } th:nth-child(3) { width: 9%; } th:last-child { width: 7%; }
th.internal-head { background: #faf0df; color: #9b733d; }
td { padding: 10px 7px; border-bottom: 1px solid #e5ebed; vertical-align: top; font-size: 12px; }
td input, td select, td textarea { font-size: 12px; padding: 7px; } td textarea { min-height: 50px; margin-top: 7px; }
.quotation-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.metric { background: #f3f7f7; border: 1px solid #dce8e8; padding: 14px; border-radius: 10px; display: flex; flex-direction: column; gap: 11px; }
.metric span { font-size: 11px; color: #6b848b; }.metric strong { font-size: 18px; text-align: right; overflow-wrap: anywhere; }
.internal-metric { background: #fff9ef; border-color: #eee0c9; }.negative strong { color: #b14334; }
.payment-section, .followup-section { margin-top: 25px; padding-top: 4px; border-top: 1px solid #e5ebee; }
.payment-section>.field { max-width: 330px; }
.payment-rows>div { display: grid; grid-template-columns: 1fr 160px 35px 65px; align-items: center; gap: 9px; margin-bottom: 10px; }
.payment-rows span { font-size: 12px; color: #7d9099; }
.validation { font-size: 12px; color: #357c62; line-height: 1.9; padding: 12px; background: #f3f8f5; border-radius: 7px; }.validation.error { color: #9a4034; background: #fff5f1; }
.term-rows>div { display: flex; align-items: start; gap: 10px; margin-bottom: 10px; }
.internal-notes textarea { border-color: #e8d7ba; background: #fffaf3; }
.approval-history { background: #f7f9fa; border-radius: 10px; padding: 16px; margin-top: 24px; }
.approval-history h3 { margin-top: 0; }.approval-history>div { padding: 8px 0; border-bottom: 1px solid #e3e9eb; font-size: 13px; }.approval-history p, .approval-history small { color: #80929b; font-size: 11px; line-height: 1.8; }
.approval-history img { width: 160px; height: 45px; object-fit: contain; background: white; border: 1px solid #e2e8eb; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }.sticky-actions { margin-top: 25px; position: sticky; bottom: 0; background: #fffffff5; border-top: 1px solid #e4e9ed; padding: 16px 0 2px; }
.unsaved-note { color: #967137; font-size: 12px; }
dialog { border: 1px solid #d5e0e3; border-radius: 16px; width: min(550px, 95vw); padding: 26px; color: #243945; } dialog::backdrop { background: #142d3a80; }
#approvalSignaturePreview { width: 100%; max-height: 120px; object-fit: contain; border: 1px solid #dce5e9; background: #fff; margin: 12px 0; }
.consent { display: flex; gap: 10px; align-items: start; font-size: 13px; line-height: 1.8; margin: 18px 0; }.consent input { width: auto; margin-top: 6px; }
#approvalError { color: #a13c32; font-size: 13px; }
.quotation-print-frame { position: fixed; left: -10000px; width: 210mm; height: 297mm; border: 0; }
@media (max-width: 1250px) { .quotation-layout { grid-template-columns: 230px minmax(0, 1fr); }.quotation-workspace { padding: 22px; }.editor-panel { padding: 20px; }.quotation-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) { .quotation-layout { grid-template-columns: 1fr; }.quotation-list-panel { position: static; }#quotationList { display: flex; gap: 10px; overflow-x: auto; }.quotation-list-item { flex: 0 0 210px; }.quotation-heading { align-items: start; }.quotation-workspace { padding: 18px; } }
@media (max-width: 560px) { .quotation-workspace { padding: 12px; }.editor-panel { padding: 16px; }h1 { font-size: 24px; }.binding-grid { grid-template-columns: 1fr; gap: 0; }.payment-rows>div { grid-template-columns: 1fr 82px 20px 50px; gap: 6px; }.metric strong { font-size: 15px; }.metric { padding: 11px; }.sticky-actions button { flex: 1 1 45%; font-size: 12px; }.quotation-heading button { padding: 10px; white-space: nowrap; } }

.commercial-scope, .commercial-official { border-top: 2px solid #bd9a52; margin-top: 24px; padding-top: 12px; }
.commercial-not-ready { background: #fff8e9; border-inline-start: 4px solid #bd9a52; padding: 16px; color: #26364d; line-height: 1.9; border-radius: 8px; }
.commercial-spec { background: #f5f7fa; padding: 12px; margin-block: 12px; border-radius: 8px; }
.commercial-spec textarea { margin-block: 8px; }
#newQuotation { background: #192e49; border-color: #bd9a52; }
