/* ===== Components for orders, suppliers and quote tabs =====
   Uses only the planner's existing tokens, so dark mode works too. */

/* Status chips: two new variants beside .warn / .good / .accent */
.chip.info{background:var(--blue);color:var(--ink)}
.chip.solid{background:var(--head);color:var(--accent-ink)}
.chip.draft{background:transparent;border:1px dashed var(--muted);color:var(--muted)}

/* Supplier swatch: the florist picks one of five palette colours per supplier */
.sup{display:inline-flex;align-items:center;gap:7px;font-weight:600;white-space:nowrap}
.sup i{width:10px;height:10px;border-radius:50%;flex:none;box-shadow:0 0 0 1px rgba(59,31,26,.25)}
:root{--sup-blue:#3D6AA8}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--sup-blue:#7FA3D6}}
:root[data-theme="dark"]{--sup-blue:#7FA3D6}
.sup-blue i,.sup-blue.fill{background:var(--sup-blue)}
.sup-olive i,.sup-olive.fill{background:var(--olive)}
.sup-salmon i,.sup-salmon.fill{background:var(--salmon)}
.sup-butter i,.sup-butter.fill{background:var(--butter)}
.sup-rust i,.sup-rust.fill{background:var(--rust)}

/* Stat tiles across the top of the Orders tab */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}
.stat .v{font-family:var(--display);font-weight:700;font-size:28px;line-height:1.1;color:var(--head);font-variant-numeric:tabular-nums}
.stat.hl{background:var(--butter)}

/* A stacked meter (by supplier, budget vs actual) */
.meter.stack{display:flex;gap:2px;height:12px}
.meter.stack>span{height:100%}

/* Status steps: Draft → Sent → Confirmed → Received → Paid */
.steps{list-style:none;margin:0;padding:0;display:flex;gap:4px;font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.steps li{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
.steps li::before{content:"";height:6px;border-radius:99px;background:var(--surface-2)}
.steps li.done{color:var(--head)}.steps li.done::before{background:var(--head)}
.steps li.now{color:var(--head)}.steps li.now::before{background:var(--butter);box-shadow:inset 0 0 0 1.5px var(--head)}

/* Tabs inside a quote (Pieces / Proposal / Flowers & orders / Notes): the journal underline tabs */
.subtabs{display:flex;gap:2px;box-shadow:inset 0 -1px 0 var(--line);overflow-x:auto;scrollbar-width:none}
.subtabs a,.subtabs button{flex:0 0 auto;border:0;background:transparent;padding:10px 14px;font:700 11px var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--muted);border-bottom:2px solid transparent;text-decoration:none;cursor:pointer}
.wrap .subtabs a{color:var(--muted)}
.wrap .subtabs a[aria-current="page"],.subtabs button[aria-selected="true"]{color:var(--head);border-bottom-color:var(--head)}

/* Segmented choice (buy from: United Floral / River & Sea / Ask rep) */
.seg{display:inline-flex;border:1px solid var(--head);border-radius:999px;overflow:hidden}
.seg button{border:0;background:transparent;color:var(--head);font:600 12px var(--body);padding:6px 11px;cursor:pointer;white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--head);color:var(--accent-ink)}

/* Rows that need a look */
tr.attn td{background:var(--pinktint)}

/* Photo placeholder / thumbnail */
.thumb{width:44px;height:44px;border-radius:8px;flex:none;background:var(--surface-2);object-fit:cover}
.thumb.lg{width:60px;height:60px}
.drop{border:1px dashed var(--head);border-radius:10px;padding:14px;text-align:center;font-size:13px;color:var(--head);background:var(--bg)}

/* Quote header */
.qhead{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:flex-end;justify-content:space-between}
.qhead h2{font-size:32px;line-height:1.05}
.qmeta{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;font-size:14px;margin-top:6px}

/* No supplier yet: an empty ring */
.sup-none i,.sup-none.fill{background:transparent;box-shadow:inset 0 0 0 1.5px var(--muted)}
/* Status steps you can click */
.steps button{all:unset;cursor:pointer;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;padding:2px 0}
.steps button:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}

/* Quote title doubles as the rename field: looks like a heading, shows a pencil and a dashed underline on hover */
.qhead>div:first-child{flex:1 1 320px;min-width:0}
.qtitle-wrap{display:inline-flex;align-items:center;gap:10px;max-width:100%;cursor:text;border-radius:8px}
.qhead input.qtitle-in{font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;border-bottom:2px dashed transparent;border-radius:0;padding:0 0 2px;margin:0;min-height:0;width:100%;min-width:4ch;max-width:100%;field-sizing:content;text-overflow:ellipsis}
.qhead input.qtitle-in::placeholder{color:var(--muted);opacity:.7}
.qtitle-wrap:hover input.qtitle-in{border-bottom-color:var(--line)}
.qhead input.qtitle-in:focus,.qhead input.qtitle-in:focus-visible{outline:none;border-bottom-color:var(--accent)}
.qtitle-pen{flex:none;width:22px;height:22px;color:var(--muted);opacity:.55;transition:opacity .15s}
.qtitle-hint{flex:none;font:600 11px/1 var(--body,inherit);letter-spacing:.1em;text-transform:uppercase;color:var(--muted);opacity:0;transition:opacity .15s}
.qtitle-wrap:hover .qtitle-pen{opacity:1}
.qtitle-wrap:hover .qtitle-hint{opacity:1}
.qtitle-wrap:focus-within .qtitle-pen,.qtitle-wrap:focus-within .qtitle-hint{opacity:0}
@media (hover:none){.qtitle-pen{opacity:.8}}

/* Count beside each recipe category heading */
.grp .grp-n{font-weight:500;opacity:.7;margin-left:4px}

/* Flower prices: explanation + actions on one line, search above the table, sample prices drawn as dashed boxes */
.fl-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px;margin-bottom:12px}
.fl-bar .hint{margin:0;flex:1 1 320px;max-width:62ch}
.fl-acts{display:flex;flex-wrap:wrap;gap:8px}
.fl-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;margin:14px 0 8px}
.fl-tools #fFilter{max-width:260px}
.fl-sample-note{margin:0;display:flex;align-items:center;gap:8px}
.fl-sample-key{flex:none;width:26px;height:16px;border:1.5px dashed var(--muted);border-radius:5px}
input.money.sample{border-style:dashed;border-color:var(--muted);color:var(--muted);font-style:italic;background:transparent}

/* Order pickup date: the event date and quick picks sit under the field */
.pickup-f{display:flex;flex-direction:column;gap:6px;min-width:0}
@media (min-width:700px){.pickup-f{grid-column:span 2}.pickup-f label.f{max-width:calc(50% - 6px)}}
.pickup-hint{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:0}
.pickup-hint .picks{display:flex;gap:6px}
.pickup-hint .pick{font:600 12px/1 var(--body,inherit);padding:6px 10px;border-radius:99px;white-space:nowrap;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.pickup-hint .pick:hover{border-color:var(--accent)}
.pickup-hint .pick.on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}
.pickup-hint .late{color:var(--warn);font-weight:600}

/* Quote timeline: hours-before setting under the list */
.tl-set{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:12px;color:var(--muted)}
.tl-set input.qty{width:60px;min-height:0;padding:4px 8px;flex:none}

/* Flowers & orders tab: what each number means; timeline and orders move below when the panel is narrow */
.qstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.qstats .stat .s{font-size:12.5px;line-height:1.4;color:var(--muted)}
.qstats .stat .s .link{font-size:inherit;color:var(--accent-text)}
.split.qflow{grid-template-columns:minmax(0,1fr) 300px}
@media (max-width:1280px){.split.qflow{grid-template-columns:minmax(0,1fr)}.split.qflow>aside{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));align-items:start}}
@media (max-width:1500px){html[data-size="comfortable"] .split.qflow{grid-template-columns:minmax(0,1fr)} html[data-size="comfortable"] .split.qflow>aside{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));align-items:start}}

/* Order: the next step under the status bar, and step labels that look clickable */
.ord-next{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:12px 14px;border-radius:12px;background:var(--surface)}
.ord-next p{margin:0;flex:1 1 280px;max-width:62ch}
.steps button:hover{text-decoration:underline;text-underline-offset:3px;color:var(--ink)}

/* Timeline rows: pickup and making times read as text with a pencil; clicking opens date + time boxes in place */
.tl-edit{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:5px;border-radius:4px}
.tl-edit svg{width:12px;height:12px;opacity:.45}
.tl-edit:hover strong{text-decoration:underline;text-underline-offset:3px}.tl-edit:hover svg{opacity:1}
.tl-edit:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tl-row.editing{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;text-transform:none;letter-spacing:0;font-size:13px;font-weight:500}
.tl-when{display:inline-flex;flex-wrap:wrap;gap:6px}
.steps input.tl-in{font:500 13px var(--body,inherit);text-transform:none;letter-spacing:0;min-height:34px;padding:4px 8px;width:auto}
.tl-row.editing .tl-l{font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
.tl-row.editing .btn.txt{font-size:12px;padding:4px 6px;min-height:0}
.date-time{display:flex;gap:6px}.date-time input[type=time]{max-width:8.5em}

/* Price-first quoting: editable piece prices (dashed until you set one), item names, budget lines */
input.line-price{width:88px;text-align:right}
.qpanel td:first-child{min-width:170px}
/* Pieces tab: the price card moves under the pieces when there isn't room for both side by side */
/* (the display size scales the app to 90% on laptop screens, which leaves room side by side down to ~1280px) */
@media (max-width:1280px){.split.qpieces{grid-template-columns:minmax(0,1fr)}.split.qpieces>aside.sticky{position:static}}
@media (max-width:1500px){html[data-size="comfortable"] .split.qpieces{grid-template-columns:minmax(0,1fr)} html[data-size="comfortable"] .split.qpieces>aside.sticky{position:static}}
input.line-price:not(.set){border-style:dashed}
input.line-price.set{border-color:var(--accent);background:var(--accent-soft)}
input.line-name{min-width:170px;width:100%;max-width:280px;font-weight:600}
.line-sub{margin-top:3px;line-height:1.45}
.line-sub .link.small{font-size:12px;font-weight:600}
.warn-t{color:var(--warn)}.good-t{color:var(--good,#3d6b2a)}
/* Event budget: the number is typed right in the stat */
.ebudget{display:flex;align-items:baseline;gap:2px}
.stat .ebudget input{font:inherit;box-shadow:none;color:inherit;letter-spacing:inherit;background:transparent;border:0;border-bottom:1.5px dashed var(--line);border-radius:0;padding:0;min-height:0;width:100%;max-width:7em}
.stat .ebudget input:focus{outline:none;border-bottom-color:var(--accent)}
.stat .ebudget input::placeholder{color:inherit;opacity:1}
.exp-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.exp-row{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;gap:8px;align-items:center}
/* Event recipes */
.ev-note{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 14px;padding:10px 14px;margin-bottom:14px;border-radius:12px;background:var(--accent-soft);font-size:14px}
.grp.grp-big{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}

/* Booking goals */
.goal-meter{height:12px}
.goal-list{display:flex;flex-direction:column}
.goal-row{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:12px;padding:10px 4px;border-bottom:1px solid var(--line)}
.goal-row:last-child{border-bottom:0}
.goal-row:hover strong{text-decoration:underline;text-underline-offset:3px}
.goal-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
