/* css/rfq-panel.css — THE RFQ PANEL: Factory Quotes' slide-over, its generic
   modal and the image lightbox (step 1 of the one-panel plan, 9/26).

   Every rule below was moved out of sourceiq.html's inline <style> VERBATIM —
   same selectors, same declarations, same order — so the panel draws exactly
   as it did. The one addition is the first block: the palette tokens the
   panel reads, re-declared on the panel roots with the SAME values the page's
   :root carries, so a host page with a different --rust / --gold / --blue
   still draws the panel as Factory Quotes does. Nothing here is scoped to the
   panel root on purpose: .comparison-table / .factory-col / .mono are also
   drawn list-side by js/program-compare.js, and .modal-* by #appr-modal. */

.panel-overlay, .modal-overlay, #rfq-img-lightbox{
  --cream:#f1efed;--warm:#e8e5e1;--border:#d4d0cb;--border2:#c9c3b8;
  --ink:#254859;--ink2:#4a7485;--ink3:#6b8a96;
  --rust:#b3a169;--clay-text:#73663a;--rust-soft:rgba(179,161,105,0.10);--rust-mid:rgba(179,161,105,0.18);
  --sage:#5A8C6E;--sage-soft:rgba(90,140,110,0.10);
  --gold:#d97706;--gold-soft:rgba(217,119,6,0.10);
  --blue:#185FA5;--blue-soft:rgba(24,95,165,0.08);
  --purple:#6C3FC5;--purple-soft:rgba(108,63,197,0.08);
  --shadow:0 2px 16px rgba(37,72,89,0.08);
  --shadow-lg:0 8px 40px rgba(37,72,89,0.12);
}

/* ── QUOTES-TAB COMPARISON ── */
/* The per-RFQ comparison, at the top of the panel's QUOTES tab (9/14). The
   table classes (factory-col, best-val, row-label, mono) were drawn unstyled
   for as long as the table lived under the list — nothing ever defined them. */
.qcmp{background:#fff;border:1px solid var(--border);border-radius:10px;overflow:hidden;margin-bottom:12px;flex-shrink:0}
.qcmp-head{padding:10px 14px;border-bottom:1px solid var(--border);background:var(--warm);display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.qcmp-title{font-family:'Fraunces',serif;font-size:15px;font-weight:500;color:var(--ink)}
.qcmp-sub{font-family:'DM Mono',monospace;font-size:10px;color:var(--ink3)}
.qcmp-scroll{overflow-x:auto}
.comparison-table{width:100%;border-collapse:collapse;font-size:12px}
.comparison-table th,.comparison-table td{padding:7px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
.comparison-table th{background:var(--warm);font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--ink3);font-weight:600;white-space:nowrap}
.comparison-table th.factory-col{color:var(--ink);font-family:'DM Sans',sans-serif;font-size:12px;text-transform:none;letter-spacing:0;min-width:140px}
.comparison-table th.factory-col.selected{background:var(--sage-soft);color:var(--sage)}
.comparison-table .winner-badge{font-family:'DM Mono',monospace;font-size:9px;font-weight:600;background:var(--sage);color:#fff;padding:1px 6px;border-radius:8px;margin-left:4px;white-space:nowrap}
.comparison-table td.row-label{font-family:'DM Mono',monospace;font-size:10px;color:var(--ink3);text-transform:uppercase;letter-spacing:.4px;white-space:nowrap;background:#fff}
.comparison-table td.mono{font-family:'DM Mono',monospace;font-size:12px;color:var(--ink)}
.comparison-table .best-val{color:var(--sage);font-weight:600;background:var(--sage-soft);padding:1px 6px;border-radius:5px}
/* Context rows (9/15): the RFQ's own ask under the label, % vs goal chips, source marks */
.comparison-table td.row-label.qcmp-ctx{white-space:normal;max-width:220px;vertical-align:top}
.comparison-table .qcmp-ours{font-family:'DM Sans',sans-serif;font-size:10.5px;color:var(--ink);text-transform:none;letter-spacing:0;margin-top:3px;line-height:1.35;font-weight:400}
.comparison-table .qcmp-goal{font-family:'DM Mono',monospace;font-size:9px;font-weight:600;padding:1px 5px;border-radius:8px;white-space:nowrap;margin-left:4px}
/* price options (10/21): every further price a factory gave for one line, with its own % vs goal and its note */
.comparison-table .qcmp-opts{margin-top:4px;display:flex;flex-direction:column;gap:2px;font-family:"DM Sans",sans-serif}
.comparison-table .qcmp-opt{font-size:10.5px;color:var(--ink2);white-space:normal}
.comparison-table .qcmp-opt.low .qcmp-optn{color:var(--sage);font-weight:700}
.comparison-table .qcmp-optn{font-family:"DM Mono",monospace;font-size:9px;color:var(--ink3);text-transform:uppercase;letter-spacing:.4px}
.comparison-table .qcmp-optnote{color:var(--ink2)}
.comparison-table .qcmp-opt.picked{background:#f1f8f3;border-radius:4px;padding:0 3px}
.comparison-table .qcmp-optpk{font-family:"DM Mono",monospace;font-size:9px;font-weight:700;color:#2f6b48}
.comparison-table .qcmp-src{font-family:'DM Mono',monospace;font-size:9px;color:var(--ink3);font-weight:400}
/* The merchandiser's note above the comparison (mig 428, 9/15) — internal only */
.qcmp-note{background:var(--gold-soft);border:1px solid var(--gold);border-radius:10px;padding:10px 14px;margin-bottom:12px}
.qcmp-note-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.qcmp-note-title{font-family:'Fraunces',serif;font-size:14px;color:var(--ink)}
.qcmp-note-sub{font-family:'DM Mono',monospace;font-size:9.5px;color:var(--ink3);text-transform:uppercase;letter-spacing:.8px}
.qcmp-note-status{margin-left:auto;font-family:'DM Mono',monospace;font-size:10px;color:var(--ink3)}
.qcmp-note textarea{width:100%;min-height:58px;resize:vertical;border:1px solid var(--border);border-radius:6px;padding:8px 10px;font-family:inherit;font-size:12.5px;line-height:1.45;color:var(--ink);background:#fff;outline:none;box-sizing:border-box}
.qcmp-note textarea:focus{border-color:var(--gold)}
.qcmp-note textarea:disabled{background:var(--warm);color:var(--ink3)}
/* Compare-table actions (9/15): invite another factory, ask one for a revised quote */
.qcmp-act{margin-left:auto;font-family:'DM Mono',monospace;font-size:10.5px;font-weight:600;padding:5px 11px;border-radius:6px;border:1px solid var(--border);background:#fff;color:var(--ink);cursor:pointer}
.qcmp-act:hover{border-color:var(--rust);color:var(--rust)}
.comparison-table th .qcmp-revise{font-family:'DM Mono',monospace;font-size:9px;font-weight:600;letter-spacing:.2px;margin-top:4px;padding:2px 7px;border-radius:8px;border:1px solid var(--border);background:#fff;color:var(--ink3);cursor:pointer;text-transform:none}
.comparison-table th .qcmp-revise:hover{border-color:var(--gold);color:var(--gold)}
.comparison-table th .qcmp-revise.on{display:inline-block;cursor:default;border-color:var(--gold);background:var(--gold-soft);color:var(--gold)}
.comparison-table tr:last-child td{border-bottom:0}

/* ── PANEL ── */
.panel-overlay{position:fixed;inset:0;top:0;background:rgba(28,26,23,0.45);z-index:1500;display:none;justify-content:flex-end;backdrop-filter:blur(2px)}
.panel-overlay.open{display:flex}
.side-panel{width:100vw;max-width:100vw;background:var(--cream);height:100%;display:flex;flex-direction:column;box-shadow:var(--shadow-lg);animation:slideIn .25s ease;overflow-y:auto}
/* ONE PAGE SCROLL (9/29, Renee: "can the rfq take up the whole page, why do we have to
   still scroll"). The panel itself is the scroller: the head, strips and banner scroll
   away, the tab strip sticks to the top, and a pane is as tall as its content. Before,
   the head stayed put and only the pane scrolled, so the sheet read through a slot. */
.side-panel>*{flex-shrink:0}
@keyframes slideIn{from{transform:translateX(40px);opacity:.5}to{transform:translateX(0);opacity:1}}
.panel-head{padding:10px 22px 8px;border-bottom:1px solid var(--border);display:flex;align-items:flex-start;gap:12px}
.panel-head-title{font-family:'Fraunces',serif;font-size:20px;font-weight:500;color:var(--ink)}
.panel-head-sub{font-size:12px;color:var(--ink3);margin-top:3px}
.panel-head-links{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.panel-head-row{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.panel-head-row .panel-head-sub{margin-top:0}
/* RFQ # and the owners share one line */
.panel-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 28px;padding:6px 22px;border-bottom:1px solid var(--border);background:#fff}
#panel-assign{display:flex;align-items:center;flex-wrap:wrap;gap:6px 28px}
#panel-assign #panel-assign-cs{margin-top:0!important}
#panel-status-banner button,#panel-status-banner .btn-primary{margin-top:0!important}
.basecamp-link{font-family:'DM Mono',monospace;font-size:10px;color:var(--blue);text-decoration:none;background:var(--blue-soft);border:1px solid rgba(42,74,122,0.2);padding:3px 9px;border-radius:6px}
.panel-close{background:none;border:none;font-size:20px;color:var(--ink3);cursor:pointer;padding:0 4px;margin-left:auto}
.panel-tabs{display:flex;gap:2px;padding:0 16px;border-bottom:1px solid var(--border);overflow-x:auto;background:var(--cream);position:sticky;top:0;z-index:6}
.ptab{padding:11px 13px;font-family:'DM Mono',monospace;font-size:10.5px;letter-spacing:.3px;color:var(--ink3);background:none;border:none;border-bottom:2px solid transparent;cursor:pointer;white-space:nowrap;transition:all .15s}
.ptab:hover{color:var(--ink2)}
.ptab.active{color:var(--clay-text);border-bottom-color:var(--clay-text)}
.ptab-content{display:none;flex-direction:column;flex:1 0 auto;padding:14px 22px}
/* the two conversations keep a window of their own: the list scrolls to the
   newest message and the composer stays under it */
#ptab-content-internal,#ptab-content-factory{flex:none;height:calc(100vh - 42px);overflow:hidden}
.ptab-content.active{display:flex}
.escalation-card{background:#fff;border:1px solid var(--border);border-radius:10px;padding:14px 16px;margin-bottom:14px}
.esc-options{display:flex;gap:8px;margin-top:10px}
.esc-opt{flex:1;text-align:center;padding:9px;border:1px solid var(--border);border-radius:8px;font-size:12px;font-weight:600;color:var(--ink2);cursor:pointer;transition:all .15s}
.esc-opt:hover{border-color:var(--clay-text);color:var(--clay-text);background:var(--rust-soft)}
.version-history-item{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid rgba(216,210,200,0.5)}
.vh-dot{width:9px;height:9px;border-radius:50%;background:var(--rust);margin-top:4px;flex-shrink:0}
.vh-dot.old{background:var(--border2)}
.vh-meta{font-family:'DM Mono',monospace;font-size:9px;color:var(--ink3);margin-bottom:2px}

/* ── MSG THREAD ── */
.msg-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.msg-row{display:flex;gap:9px}
.msg-row.right{flex-direction:row-reverse}
.msg-avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff;flex-shrink:0}
.msg-body{max-width:78%}
.msg-meta{font-size:10px;color:var(--ink3);margin-bottom:3px}
.msg-bubble{background:#fff;border:1px solid var(--border);border-radius:11px;padding:9px 13px;font-size:13px;color:var(--ink2);line-height:1.45}
.msg-row.right .msg-bubble{background:var(--sage-soft);border-color:rgba(58,107,82,0.2)}
.msg-timestamp{font-family:'DM Mono',monospace;font-size:8px;color:var(--ink3);margin-top:3px}
.msg-attach-chip{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:4px 9px;background:var(--blue-soft);border:1px solid rgba(42,74,122,0.18);border-radius:6px;font-size:11px;color:var(--blue)}
.msg-input-row{display:flex;gap:8px;align-items:center;background:#fff;border:1px solid var(--border);border-radius:10px;padding:6px 8px}
.msg-attach-btn{background:none;border:none;font-size:17px;cursor:pointer;padding:3px;color:var(--ink3)}
.msg-input{flex:1;border:none;outline:none;font-family:'DM Sans',sans-serif;font-size:13px;color:var(--ink);background:transparent}
.msg-send{padding:6px 15px;border-radius:7px;border:none;color:#fff;font-size:12px;font-weight:600;cursor:pointer}
.scope-banner{border-radius:8px;padding:8px 12px;margin-bottom:12px;font-size:11px;display:flex;align-items:center;gap:6px;flex-shrink:0}
.scope-internal{background:var(--rust-soft);border:1px solid rgba(184,74,42,0.15);color:var(--clay-text)}
.scope-shared{background:var(--sage-soft);border:1px solid rgba(58,107,82,0.15);color:var(--sage)}

/* ── MODAL (the generic #siq-modal-overlay; #appr-modal list-side shares the shape) ── */
.modal-overlay{position:fixed;inset:0;top:0;background:rgba(28,26,23,0.5);z-index:2200;display:none;align-items:center;justify-content:center;padding:24px;backdrop-filter:blur(3px)}
.modal-overlay.open{display:flex}
.modal-card{width:min(680px,100%);max-height:88vh;overflow-y:auto;background:var(--cream);border-radius:14px;box-shadow:var(--shadow-lg)}
.modal-head{padding:18px 22px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--cream);z-index:2}
.modal-title{font-family:'Fraunces',serif;font-size:19px;font-weight:500}
.modal-body{padding:20px 22px}

/* ── LIGHTBOX: #rfq-img-lightbox and its children are fully inline-styled in the
   template (sourceiq-data.js panelHtml); no class rules. ── */

/* ── SPEC-CELL ATTACHMENTS (drawn by js/rfq-view.js inside the panel and the edit modal) ── */
/* Attachments carried by a flexible spec cell, on the sheet the FACTORY
   answers the RFQ on. Same classes and shape as /rfq and pm-queue — the three
   surfaces have to look the same, not just carry the same data. */
/* One entry per line. Side by side, two noted photos in a narrow spec-table
   cell squeezed each note to 45px and eight lines tall — unreadable, which for
   an instruction to a factory is the same as absent. */
.sf-att{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-top:5px}
.sf-a{display:inline-flex;flex-wrap:wrap;align-items:center;gap:7px;max-width:100%;padding:3px 7px 3px 4px;border:1px solid var(--border);border-radius:6px;background:#fff;text-decoration:none;color:var(--ink2)}
.sf-a:hover{border-color:var(--blue);background:var(--blue-soft)}
.sf-thumb{width:30px;height:30px;object-fit:cover;border-radius:3px;flex:0 0 auto;display:block}
.sf-side{flex:1 1 130px;min-width:0;display:flex;flex-direction:column;gap:1px}
.sf-note{font-size:10.5px;line-height:1.25;color:var(--ink2);font-weight:600;white-space:normal}
.sf-nm{font-size:9px;line-height:1.2;color:var(--ink3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sf-a.has-note{width:100%}

/* ── THE CS ACTION BAR (step 3 of the one-panel plan, 9/28) ── */
/* Under the status banner, on every tab, for internal seats only (a factory's
   panel has no #panel-actions host). The queue's review panel, on the panel:
   a mode row, a reason box for the verbs that need one, the submit button in
   the verb's colour, and Retire / Restore on the right. */
.siq-actions{padding:6px 22px;border-bottom:1px solid var(--border);background:#fff;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
/* Your call and Retire on ONE row; the reason box and screenshots open under it */
.siq-actions .siq-act-row{flex:1 1 auto;order:0}
.siq-actions .siq-act-life{order:1;margin-left:auto}
.siq-actions .siq-act-notes,.siq-actions #siq-act-shots{order:2;flex:1 1 100%}
.siq-actions #siq-act-shots:empty{display:none}
.siq-act-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.siq-act-label{font-family:'DM Mono',monospace;font-size:9.5px;text-transform:uppercase;letter-spacing:.1em;color:var(--ink3);margin-right:2px}
.siq-act-modes{display:flex;gap:4px;flex-wrap:wrap}
.siq-act-mode{font-family:'DM Mono',monospace;font-size:10.5px;padding:6px 11px;border-radius:6px;border:1px solid var(--border);background:#fff;color:var(--ink2);cursor:pointer;transition:all .15s}
.siq-act-mode:hover{border-color:var(--ink2)}
.siq-act-mode.active{border-color:var(--ink);background:var(--ink);color:#fff}
.siq-act-submit{margin-left:auto;font-family:'DM Mono',monospace;font-size:11px;font-weight:600;padding:8px 16px;border-radius:6px;border:none;background:var(--ink);color:#fff;cursor:pointer}
.siq-act-submit:disabled{opacity:.6;cursor:wait}
.siq-act-submit.siq-act-go{background:var(--sage)}
.siq-act-submit.siq-act-gold{background:var(--gold)}
.siq-act-submit.siq-act-rust{background:#A32D2D}
.siq-act-submit.siq-act-mute{background:var(--ink3)}
.siq-act-notes{display:none;width:100%;box-sizing:border-box;font-family:'DM Sans',sans-serif;font-size:12.5px;line-height:1.45;padding:8px 10px;border:1px solid var(--border);border-radius:6px;background:var(--warm);color:var(--ink);resize:vertical;outline:none}
.siq-act-notes.show{display:block}
.siq-act-notes:focus{border-color:var(--gold)}
.siq-act-life{display:flex;align-items:center;justify-content:flex-end;gap:10px;font-size:11px;color:var(--ink3)}
.siq-act-lifebtn{font-family:'DM Mono',monospace;font-size:10.5px;padding:5px 11px;border-radius:6px;border:1px solid rgba(226,75,74,0.35);background:#fff;color:#A32D2D;cursor:pointer}
.siq-act-lifebtn:hover{background:rgba(226,75,74,0.06)}
.siq-act-archived{font-family:'DM Mono',monospace;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#A32D2D}
/* The required-field refusal the sheet draws beside Approve (RfqSheet.banner) */
.siq-actions #pm-req-banner{width:100%;order:3}

/* ── THE RFQ TAB IS THE SHEET (step 3): the bar above js/rfq-sheet.js ── */
.siq-sheet-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:8px 12px;margin:0 0 12px;border-radius:8px;background:#fff;border:1px solid var(--border)}
.siq-sheet-bar.siq-sheet-edit{background:var(--gold-soft);border-color:rgba(217,119,6,0.35)}
.siq-sheet-bar.siq-sheet-draft{background:#FDF6E3;border-color:#E8D49A;flex-direction:column;align-items:stretch}
.siq-sheet-hint{font-size:12px;color:var(--ink2);flex:1;min-width:240px}
.siq-sheet-draft{font-size:12px;line-height:1.5;color:var(--ink)}
.siq-sheet-draftrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.siq-sheet-note{flex:1;min-width:220px;font-family:inherit;font-size:12px;padding:7px 10px;border:1px solid var(--border);border-radius:6px;background:#fff;color:var(--ink);outline:none}
.siq-sheet-save{font-family:'DM Mono',monospace;font-size:11px;font-weight:600;padding:8px 16px;border-radius:6px;border:none;background:var(--rust);color:#fff;cursor:pointer;white-space:nowrap}
.siq-sheet-save:disabled{opacity:.6;cursor:wait}
.siq-sheet-revise,.siq-sheet-cancel{font-family:'DM Mono',monospace;font-size:11px;padding:8px 14px;border-radius:6px;border:1px solid var(--border);background:#fff;color:var(--ink);cursor:pointer;white-space:nowrap}
.siq-sheet-revise:hover,.siq-sheet-cancel:hover{border-color:var(--ink2)}
.siq-sheet-host{min-height:0}
/* the canvas-driven spec sheet inside the panel (pm-queue.html carries the same rule inline) */
.siq-sheet-host .sc-host{display:flex;flex-direction:column;align-items:center;gap:18px;overflow-x:auto;padding:6px 0 12px}
.siq-sheet-host .sc-host .sc-page{flex:0 0 auto}
/* Assigned-merchandiser picker (mig 420) - a quiet select that reads as a name until hovered.
   Moved here VERBATIM from sourceiq.html's inline <style> (9/28, R4): the
   panel's head strip draws it on /pm-queue too, where those rules never
   reached and it rendered as a bare native select. Page-wide on purpose, as
   they were there — Factory Quotes' list-row picker wears the same class. */
.assign-sel{font-family:'DM Sans',sans-serif;font-size:12px;color:var(--ink);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 22px 3px 6px;max-width:150px;cursor:pointer;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' fill='none' stroke-width='1.4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 7px center}
.assign-sel:hover,.assign-sel:focus{border-color:var(--border);background-color:#fff;outline:none}
.assign-sel.unassigned{color:var(--ink3);font-style:italic}
.assign-sel:disabled{cursor:default;background-image:none;padding-right:6px}
/* the head strip's STRATEGIST picker (step 3). Scoped to .assign-cs and
   background-COLOR only: the Merchandiser picker beside it is the .assign-sel
   above, whose chevron is a background-image and whose right padding makes
   room for it — a `background` shorthand or a padding here wiped both. */
#panel-assign .assign-sel.assign-cs{font-family:'DM Sans',sans-serif;font-size:12px;border:1px solid var(--border);border-radius:5px;background-color:#fff;color:var(--ink);max-width:240px}
#panel-assign .assign-sel.assign-cs.unassigned{color:var(--ink3);font-style:italic}
