/* work-order-view.quote.css -- v33 Quote mode styles (SPD-2344)

   Part 7 of 7 (CSS). SEPARABLE ON PURPOSE, same contract as discounts.js:
   every rule is scoped to body.ent-quote or to elements that only
   work-order-view.quote.js injects (#entSeg, #quoteSeg, #quoteStatusMenu,
   .lv-oq, .q-convert). Drop this <link> together with the quote.js <script>
   and the prototype is the v32 Work Order view, untouched.
   Load order: last stylesheet -- it must override ledger.css under the
   .ent-quote scope.
   v33.1: Labor card hidden in quote mode; second header row (.q-row2) for
   the status chip + Convert button; cart affordances hidden (purchasing is
   a WO concept). */

/* ---------- proto bar: entity seg + quote scenarios ---------- */
/* #entSeg / #quoteSeg reuse .proto-seg styling wholesale; nothing needed. */
/* Decision (v33 scope Q1): Quote mode is ledger-only -- the Classic/Ledger
   seg is HIDDEN, not disabled, while entity = Quote. */
body.ent-quote #viewSeg{display:none;}
body.ent-quote #exampleSeg{display:none;}
body:not(.ent-quote) #quoteSeg{display:none !important;}

/* ---------- tabs: a quote has Details + Audit only (ERP useQuoteNavigation).
   WO tab order is fixed markup: 1 Details, 2 Time Logs, 3 Payments,
   4 Part/Labor Request, 5 Checklists, 6 Audit -- hide 2-5. ---------- */
body.ent-quote .lv-tabs .lv-tab:nth-child(2),
body.ent-quote .lv-tabs .lv-tab:nth-child(3),
body.ent-quote .lv-tabs .lv-tab:nth-child(4),
body.ent-quote .lv-tabs .lv-tab:nth-child(5){display:none;}

/* ---------- anything quote.js tagged .q-hide (rail WO-only rows,
   Create Invoice menu item) disappears in quote mode only ---------- */
body.ent-quote .q-hide{display:none !important;}

/* ---------- v33.1: WO-only affordances hidden in quote mode.
   The Labor card (quotes have no shop timer / clocked labor -- Tim cut it
   from the quote header entirely); the group-header cart icon and the
   bulk bar's Add to Cart (purchasing is a WO concept -- there is no cart
   on a quote). All hidden rather than un-rendered so the WO view and the
   separable contract stay untouched. ---------- */
body.ent-quote .lv-id-right .lv-labor{display:none;}
/* v36: the Total card goes the same way as the Labor card - Online Quote is
   the only card in the quote idbar now, and takes the footprint all three
   used. Quote money still reads in the Totals card under the rail and in the
   persistent money bar; the "Edit Totals" cue went with the card. */
body.ent-quote #lvPay{display:none;}
/* v48: THE HEADER IS THREE COLUMNS (Tim's mockup) - title block, the
   accepted-quote settings as their own column, then the Online Quote card.
   This is the answer v42-v46 kept missing: the settings were being nested
   INSIDE the card, so every attempt was a box in a box in the idbar. As a PEER
   of the card they need no border of their own, which is how the mockup draws
   them - and the header stops being a container problem.
   Injected by quote.js between .lv-id-left and .lv-id-right, removed on the
   way back to WO, so the WO idbar is untouched. */
body.ent-quote .lv-id-mid{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;margin-left:30px;align-self:center;}
body.ent-quote .lv-id-mid.dis{opacity:.55;}
/* v47: the v46 stretch is GONE. The card holds three lines now - the settings
   live behind the gear - and a full-width card with three lines in it is the
   empty card again, just wider. The void v46 was fixed was a TALL empty card;
   a short one pinned right is the v36-v41 shape, which never drew a complaint. */
/* v34: the WO's own second header row - quote mode injects #qRow2 instead.
   v59: both rows live in the ADD BAR now, not the header card. This rule is
   unchanged and still correct - it hides #woRow2 wherever it is. */
body.ent-quote #woRow2{display:none;}
body.ent-quote .lg-gtools iconify-icon[icon="mdi:cart-plus"]{display:none;}
body.ent-quote .sb-btn[data-sba="cart"]{display:none;}

/* ---------- v33.1: second header row -- the quote options (status chip +
   Convert to Work Order) under the client / vehicle / labels line.
   Reuses .lv-id-sub type styling; this only spaces and aligns it. ---------- */
/* v59: margin-top gone - this row moved out of the stacked header into the
   add bar, where .lv-status-row (ledger.css) sets the flex context. What is
   left here is quote-only: the tighter gap and the Convert button. */
.q-row2{display:flex;align-items:center;gap:4px;}
.q-row2 .q-convert{margin-left:8px;}

/* v59: A 37-LINE COMMENT STOOD HERE AND ITS RULE IS GONE. It was one stack
   (v38 -> v39 -> v40 -> v41 -> v45 -> v47) explaining the position of the
   quote status row inside the idbar: how tall the controls should be, how a
   negative bottom margin cancelled the row's growth so the idbar's centring
   would not lift the title, and how the bottom edge was measured off a marked
   -up screenshot against the Online Quote card.
   Every word of it was about a row that lived in the IDBAR. #qRow2 is in the
   add bar now (Tim), which is a flex row that centres its children and has no
   feedback into the header's height at all - so the constraint the whole
   stack was navigating no longer exists, and the rule it justified went with
   it.
   Deleted rather than left in place. A comment that reasons carefully about a
   constraint that has stopped applying is worse than no comment: it reads as
   current, and the next person has to reconstruct the whole situation to work
   out that it is not. The reasoning is preserved in CHANGES.md v38-v47 if it
   is ever needed again - which is what that file is for. */

/* ---------- quote status chip colors (ERP QuoteStatusButton):
   Draft = secondary, Accepted = green (reachable only via convert),
   Declined = red, Removed = amber. Base .chip-status is blue/16. ---------- */
.chip-status.q-draft{background:var(--secondary-15);color:var(--secondary);}
.chip-status.q-accepted{background:var(--green-15);color:var(--green);}
.chip-status.q-declined{background:var(--red-15);color:var(--red);}
.chip-status.q-removed{background:var(--amber-15);color:var(--amber);}
/* v35: the row-2 chip is SOLID (see .chip-status.lg in ledger.css), so the
   quote statuses need solid twins - the tinted pairs above still serve the
   small rail badge. Three classes, so these out-specify both. */
.chip-status.lg.q-draft{background:var(--secondary);color:#fff;}
.chip-status.lg.q-accepted{background:var(--green);color:#fff;}
.chip-status.lg.q-declined{background:var(--red);color:#fff;}
.chip-status.lg.q-removed{background:var(--amber);color:#fff;}

/* ---------- Convert to Work Order: the ERP's contained primary button,
   sitting beside the status chip on the idbar sub line ---------- */
/* v34: grown to match the .lg status chip beside it - the header row has the
   room, and a primary action should not read smaller than the chip. */
/* v41: the ERP spec, same as .chip-status.lg beside it - both are unsized MUI
   contained buttons in the real app (see the note in ledger.css). The startIcon
   is MUI's 20px for a medium button, marginRight 8 (the gap) / marginLeft -4. */
.q-convert{display:inline-flex;align-items:center;gap:8px;background:var(--blue);border:none;border-radius:5px;color:#fff;font-size:14px;font-weight:500;text-transform:none;letter-spacing:.3px;line-height:1.71;padding:8px 20px;margin-left:4px;cursor:pointer;}
.q-convert iconify-icon{font-size:20px;margin-left:-4px;}
.q-convert:hover{filter:brightness(1.1);}
.q-convert[disabled]{opacity:.45;cursor:not-allowed;filter:none;}

/* ---------- Online Quote card (Quick Schedule's slot, decision Q3).
   Joins the idbar card family: .lv-labor / .lv-pay surface, bordered,
   hover-lift, bottom-pinned cue. ---------- */
/* v36: min-width 218 -> 430, roughly the Total card + gap + its own old width,
   so the one remaining card occupies the area the pair did rather than
   collapsing to its content and leaving the header half empty. Eyeball call -
   one number to nudge.
   v37: 430 -> 520. The card's type went up across the board (it was sized for
   a narrow card that no longer exists) and the extra width is what pays for
   it. Still one number. */
.lv-oq{display:flex;flex-direction:column;gap:3px;align-items:flex-start;background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:9px 14px 0;min-width:340px;transition:border-color .12s ease,box-shadow .12s ease,transform .12s ease;}
.lv-oq:hover{border-color:var(--blue);box-shadow:0 3px 10px rgba(0,0,0,.25);transform:translateY(-1px);}
.lv-oq .oq-title{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.3px;}
.lv-oq .oq-title iconify-icon{font-size:16px;color:var(--blue);}
.lv-oq .oq-title .chip-status{margin-left:5px;font-size:10.5px;padding:2px 9px;}
.lv-oq .oq-line{font-size:13px;color:var(--text-secondary);line-height:1.45;}
.lv-oq .oq-line b{color:var(--text);font-weight:600;}
.lv-oq .oq-line .red{color:var(--red);}
.lv-oq .oq-line .link{color:var(--blue);cursor:pointer;}
/* v47: THE CARD IS A SUMMARY AGAIN (Tim: "put the settings in a gear").
   Title + status chip + gear, the two status lines, the cue. Everything
   configurable moved into #oqPop. .oq-main and .oq-right went with it, and
   so did both margin-top:auto gaps - each was pinning content to the bottom
   of a container taller than its content, which is what the two holes in
   the v46 render were. */
.lv-oq .oq-title-row{display:flex;align-items:center;align-self:stretch;gap:6px;margin-bottom:2px;}
.lv-oq .oq-gear{margin-left:auto;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid var(--border-2);border-radius:6px;padding:4px;color:var(--text-secondary);cursor:pointer;}
.lv-oq .oq-gear iconify-icon{font-size:17px;}
.lv-oq .oq-gear:hover,.lv-oq .oq-gear.on{border-color:var(--blue);color:var(--blue);}
.lv-oq .oq-lines{display:flex;flex-direction:column;gap:4px;margin:2px 0 9px;}
.oq-toggles{display:flex;flex-direction:column;gap:10px;}
.oq-tg{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.2px;cursor:pointer;background:none;border:none;padding:0;}
.oq-tg .dot{width:28px;height:16px;border-radius:9px;background:var(--track);position:relative;transition:background .12s ease;flex-shrink:0;}
.oq-tg .dot::after{content:'';position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:left .12s ease;}
.oq-tg.on .dot{background:var(--blue);}
.oq-tg.on .dot::after{left:14px;}
.oq-tg.on{color:var(--text);}
.lv-oq .oq-cue{display:flex;align-items:center;justify-content:center;gap:5px;align-self:stretch;margin:auto -14px 0;padding:9px 14px;border-top:1px solid var(--border);border-radius:0 0 8px 8px;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--blue);background:none;border-left:none;border-right:none;border-bottom:none;cursor:pointer;transition:background .12s ease;}
.lv-oq .oq-cue iconify-icon{font-size:16px;}
.lv-oq:hover .oq-cue{background:var(--blue-16);}

/* ---------- v42: "When online quote is accepted" (Tim, single-select: it
   goes inside the box where the deposit / labor hrs / part #s settings live).
   The three switches were a bare right-hand column; they are now the lower
   half of a real bordered box, with the accepted-quote controls above them -
   which is also the ERP's own order, since AcceptedQuote renders above those
   three switches inside the Online Quote accordion (QuoteDetailsEnhanced).
   Box spec copied from the ERP's AcceptedQuoteContainer: 1px divider, 6px
   radius, 16px padding.
   THE BOX SPANS THE CARD rather than staying in the right column: the ERP's
   radios are row-layout and the two labels alone need ~380px.
   With the switches inside the box, the status lines own the body row, so
   .oq-col turned from a column into a row (above).

   v43: THE BOX IS TWO COLUMNS AND THE CARD IS WIDER (Tim: it grew in height
   when it should have grown in width). v42 stacked four bands - radios, merge
   fields, rule + switches, Save - and the merge branch made that stack tall.
   The accepted-quote controls take the left column, the three switches and
   Save take the right, so the box is now as tall as its TALLER COLUMN rather
   than the sum of both halves. Card min-width 520 -> 640 pays for it, and the
   width is CONSTANT (Tim, single-select) so clicking a radio never resizes the
   card underneath the pointer.
   DELIBERATE DIVERGENCE, layout only: the ERP stacks these - AcceptedQuote
   above the three switches. Side by side is the proposal. ---------- */
/* v47: THE BOX HAS NO BORDER ANY MORE. Inside the popover it would be the
   third nested outline in a row - popover, box, and the dupe warning's own
   fill - which is exactly the box-in-a-box-in-a-box the v46 header had. The
   popover IS the container; the box just groups. */
.oq-set{display:flex;flex-direction:column;gap:10px;min-width:0;}
.oq-set-title{font-size:13.5px;font-weight:600;color:var(--text);line-height:1.5;}
.oq-set.dis{opacity:.55;}
/* radios: MUI Radio geometry - 17px ring, blue when checked, row layout with
   the ERP's columnGap:4 (=32px) trimmed to 26 for a 520px card */
.oq-rds{display:flex;align-items:center;gap:26px;padding-left:2px;flex-wrap:wrap;}
.oq-rd{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-secondary);background:none;border:none;padding:0;cursor:pointer;}
.oq-rd .rdo{width:17px;height:17px;border-radius:50%;border:1.5px solid var(--border-2);flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;}
.oq-rd.on{color:var(--text);}
.oq-rd.on .rdo{border-color:var(--blue);}
.oq-rd.on .rdo::after{content:'';width:9px;height:9px;border-radius:50%;background:var(--blue);}
.oq-rd[disabled]{cursor:not-allowed;}
/* merge branch: WO select, the SPD-1267 search-all checkbox + its helper, upsell */
.oq-merge{display:flex;flex-direction:column;gap:0;}
.oq-merge .sm-field{margin-bottom:0;cursor:pointer;}
.oq-wolist{display:flex;flex-direction:column;border:1px solid var(--border-2);border-top:none;border-radius:0 0 7px 7px;overflow:hidden;}
.oq-wo-opt{text-align:left;background:var(--paper);border:none;border-top:1px solid var(--border);padding:8px 11px;font-size:13px;color:var(--text);cursor:pointer;}
.oq-wo-opt:hover{background:var(--paper-hover);}
.oq-cbrow{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--text-secondary);cursor:pointer;margin-top:10px;}
.oq-cbhelp{font-size:12px;color:var(--text-secondary);line-height:1.45;margin:4px 0 12px 26px;}
.oq-sub{font-size:13px;font-weight:600;color:var(--text);}
.oq-sub + .oq-rds{margin-top:8px;}
/* duplication warning - ERP DuplicationWarning: grey fill, 5px radius, 16px
   pad, warning-coloured text */
.oq-dupe{display:flex;flex-direction:column;justify-content:center;gap:2px;background:var(--fill);border-radius:5px;padding:9px 12px;}
.oq-dupe .t{font-size:14px;font-weight:500;color:var(--amber);}
.oq-dupe .s{font-size:13px;color:var(--amber);}
/* v48: SAVE IS GONE (Tim: the radios persist on click, the way the three
   switches always have). DELIBERATE DIVERGENCE - the ERP's AcceptedQuote has
   an explicit Save gated on isDirty. It is consistent with the switches, which
   the ERP itself patches on toggle, but it is a proposal rather than fidelity.
   OQA.dirty went with it.

   THE SLOT under the radios holds either the duplication warning (Convert) or
   the merge summary (Merge). min-height because the two have different natural
   heights and without it the idbar would resize under the pointer as you pick
   between them - the same class of problem as every v42-v46 height fix. */
.oq-slot{display:flex;min-height:50px;}
.oq-slot .oq-dupe{flex:1;}
/* the merge summary is the RESTING STATE of the overlay: with the fields in a
   popover, closing it would otherwise leave no trace of which WO was chosen */
.oq-mergesum{display:flex;align-items:center;gap:9px;flex:1;background:var(--fill);border:none;border-radius:5px;padding:9px 12px;font-size:13px;color:var(--text-secondary);cursor:pointer;text-align:left;}
.oq-mergesum:hover{background:var(--fill-strong);}
.oq-mergesum .wo{color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.oq-mergesum .up{margin-left:auto;flex-shrink:0;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;color:var(--blue);background:var(--blue-16);border-radius:9px;padding:2px 8px;}
.oq-mergesum > iconify-icon{font-size:16px;color:var(--text-disabled);flex-shrink:0;}

/* ---------- v47: the settings popover. Anchored under the card's gear and
   opened through the shared menu machinery (openMenu / closeMenu /
   positionMenu), so outside-click and the global Escape chain both work
   with no new plumbing and no boot.js change - it carries .menu-pop for
   the open/close contract and .oq-pop for everything visual.
   Sized off .qs-pop, the Quick Schedule form popover, since this is the
   same kind of thing: a small anchored form, not a list of commands.
   ---------- */
/* v48: the gear holds the three switches and NOTHING else (Tim), so it is
   sized for a short list rather than a form. */
.menu-pop.oq-pop{width:230px;padding:13px 15px 12px;display:none;flex-direction:column;gap:11px;}
.menu-pop.oq-pop.open{display:flex;}
/* v48: the merge fields OVERLAY rather than growing the header (Tim: "don't
   grow the header, find a neat way to overlay it"). Anchored under the Merge
   radio through the same shared machinery as the gear, so the header is
   exactly as tall whichever option is selected - which is the thing v42-v46
   could never manage while these fields sat in the flow. */
.menu-pop.oq-mpop{width:390px;padding:14px 16px 13px;display:none;flex-direction:column;gap:0;}
.menu-pop.oq-mpop.open{display:flex;}
.oq-mpop .oq-cbhelp{margin-bottom:14px;}
.oq-pop-h{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text-disabled);}
.oq-pop-h iconify-icon{font-size:15px;}
/* the three switches keep their own label style; only the spacing differs
   from the card, where they used to sit */
.oq-pop .oq-toggles{gap:11px;}

/* v36 CORRECTION: this said "the Labor and Money cards keep their WO shells
   but carry swapped innards". Neither is true any more - v33.1 hid the Labor
   card and v36 hid the Money card, and quote mode writes to neither.
   The qFlash keyframe and .q-flash went with them: their only user was the
   Edit Totals cue's scroll-and-flash, which lived on the Money card. A grep
   across every part finds no other reference. */

/* ============================================================
   v66 SPD-2600 - the notes bar's entity-scoped controls
   The Quote status seg (injected here by quote.js) shows in Quote mode only;
   the Work Order state seg and the merge demo show in Work Order mode only.
   ============================================================ */
body:not(.ent-quote) #ntQWrap{display:none;}
body.ent-quote #ntWoWrap,
body.ent-quote #ntMergeWrap{display:none;}
