/* E-commerce tab, Orders part: the list on the left and the open order on the right. Copied from cloneQ's
   static/css/panel-orders.css, in Party Villa's colours (style.css). The estimate on A4 has its own styles in orders.js. */
.eo { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: .9rem; background: var(--bg); }
.eo svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eo-top { padding: 10px 14px 9px; border-bottom: 1px solid var(--line); background: var(--panel); }
.eo-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eo-title h2 { font-size: 1rem; font-weight: 600; }
.eo-newc { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: #fff; }
.eo-newc[hidden] { display: none; }
.eo-search { position: relative; display: flex; align-items: center; margin-left: 6px; width: min(280px, 100%); }
.eo-search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.eo-search input { width: 100%; height: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 0 10px 0 32px; }
.eo-search input:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(14, 122, 107, .18); }
.eo-addorder { margin-left: auto; font-weight: 600; }
.eo-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 9px; }
.eo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.eo-types { padding-left: 14px; border-left: 1px solid var(--line); }
.eo-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; min-height: 28px; border: 1px solid var(--line); border-radius: 999px; background: #f6f7f5; color: var(--ink);
  font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
.eo-chip svg { width: 14px; height: 14px; }
.eo-chip:hover { background: var(--soft); }
.eo-chip.on { background: #fff; border-color: var(--brand-2); color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.eo-panes { flex: 1; min-height: 0; display: flex; }

/* order type: Website = placed by the buyer, Self = typed in by staff */
.eo-ch { display: inline-block; border-radius: 999px; padding: 0 8px; font-size: .72rem; font-weight: 600; line-height: 18px; white-space: nowrap; }
.eo-ch.ch-website { background: #e3eefc; color: #1d4f91; }
.eo-ch.ch-self { background: #fdf0d9; color: #8a5300; }
.eo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.eo-dot.ch-website { background: #3b7ddd; }
.eo-dot.ch-self { background: #e3a33b; }

/* order list */
.eo-list { position: relative; width: clamp(290px, 32%, 400px); flex: none; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); }
.eo-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "num total" "name total" "meta total" "tags tags"; column-gap: 10px; row-gap: 1px;
  padding: 9px 14px 10px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; position: relative; }
.eo-row:hover { background: #f7faf9; }
.eo-row.on { background: var(--soft); }
.eo-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-2); }
.eo-num { grid-area: num; color: var(--brand-2); font-size: .78rem; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eo-badge-new { font-size: .66rem; padding: 0 5px; line-height: 15px; border-radius: 3px; background: var(--accent); color: #fff; }
.eo-name { grid-area: name; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eo-meta { grid-area: meta; color: var(--muted); font-size: .78rem; }
.eo-total { grid-area: total; align-self: center; font-weight: 600; white-space: nowrap; }
.eo-tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.eo-tags .tag { font-size: .68rem; }
.eo .tag.plain { background: #f1f2f0; color: var(--muted); }
.eo .tag.done { background: #e2f3e7; color: var(--ok); }
.eo-row.is-new { background: #fffaf2; }
.eo-row.is-new .eo-name, .eo-row.is-new .eo-total { font-weight: 700; }
.eo-row.is-new.on { background: var(--soft); }
.eo-more { display: block; width: calc(100% - 28px); margin: 12px 14px 4px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.eo-more:hover { background: var(--soft); }
.eo-more.busy { opacity: .6; pointer-events: none; }
.eo-count { text-align: center; margin: 6px 0 14px; }
.eo-empty-list { padding: 30px 16px; color: var(--muted); text-align: center; }

/* the open order */
.eo-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fbfcfb; }
.eo-nopane { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 30px; text-align: center; }
.eo-nopane svg { width: 42px; height: 42px; stroke-width: 1.2; }
.eo-in { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.eo-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.eo-head h2 { font-size: 1rem; font-weight: 600; }
.eo-back { display: none; align-items: center; gap: 4px; color: var(--ink); font-weight: 600; text-decoration: none; width: 100%; }
.eo-back svg { width: 16px; height: 16px; }
.eo-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eo-btn { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.eo-btn svg { width: 16px; height: 16px; }
.eo-dots { padding: 4px 7px; }
.eo-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 20px; position: relative; }
.eo-warn { margin: 10px 0 0; padding: 7px 10px; border-radius: 6px; background: #fbe6e4; color: var(--bad); font-size: .85rem; }
.eo-info { margin: 6px 0; padding: 7px 10px; border-radius: 6px; background: #fdf0d9; color: var(--warn); font-size: .85rem; }
.eo-sec { padding: 12px 0; border-bottom: 1px solid #edf0ee; }
.eo-sec:last-child { border-bottom: 0; }
.eo-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.eo-label { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.eo-hint { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.eo-val { margin: 0 0 4px; }
.eo-sub { margin: 0; color: var(--muted); font-size: .82rem; }
.eo-cust { font-weight: 600; }
.eo-status { display: flex; align-items: center; gap: 12px; }
.eo-status-val { font-weight: 600; letter-spacing: .02em; }
.eo-link { background: none; border: 0; padding: 0; font: inherit; color: #1d63c4; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.eo-primary { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.eo-primary .btn { padding: 7px 18px; font-weight: 600; }
.eo-phone { display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 6px; padding: 3px 10px 3px 11px; border-radius: 999px; background: var(--brand-2); color: #fff; font-weight: 600; font-size: .82rem; text-decoration: none; }
.eo-phone:hover { background: var(--brand); }
.eo-phone svg { width: 14px; height: 14px; stroke-width: 1.9; }
.eo-dl { margin: 8px 0 0; display: grid; gap: 4px; }
.eo-dl div { display: flex; gap: 8px; flex-wrap: wrap; }
.eo-dl dt { color: var(--muted); }
.eo-dl dt::after { content: ":"; }
.eo-dl dd { margin: 0; }
.eo-coupon { display: inline-block; padding: 0 6px; border: 1px dashed var(--brand-2); border-radius: 3px; color: var(--brand-2); font-size: .78rem; font-weight: 600; }
.eo-bnote { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid #e3a33b; background: #fdf6ea; white-space: pre-line; }
.eo-bnote span { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); }
.eo-note:not(.has) { display: none; }
.eo-note-form { display: flex; gap: 10px; align-items: flex-end; }
.eo-note-form textarea { flex: 1; resize: vertical; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }

/* items */
.eo-items { padding-bottom: 0; }
.eo-items-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.eo-items-head .eo-label { margin: 0; }
.eo-addbtn { font-weight: 600; }
.eo-add-panel { margin: 6px 0 10px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.eo-add-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eo-add-search input { flex: 1; min-width: 160px; height: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; }
.eo-add-search select { max-width: 200px; min-width: 0; height: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; }
.eo-add-results { max-height: 360px; overflow: auto; margin-top: 8px; }
.eo-add-hint { color: var(--muted); margin: 8px 2px; }
.eo-add-count { color: var(--muted); font-size: .78rem; margin: 2px 2px 4px; }
.eo-results { list-style: none; margin: 0; padding: 0; }
.eo-results li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid #edf0ee; }
.eo-results img, .eo-results .eo-noimg { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex: none; background: #eef1ef; }
.eo .r-main { flex: 1; min-width: 0; }
.eo .r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eo .r-sub { color: var(--muted); font-size: .78rem; }
.eo .r-price { white-space: nowrap; font-weight: 600; }
.eo .r-note { font-size: .78rem; color: var(--warn); max-width: 160px; text-align: right; }
.eo .r-add { display: flex; gap: 6px; align-items: center; margin: 0; }
.eo .r-add input { width: 70px; height: 32px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; text-align: right; }
.eo-showmore { display: block; margin: 8px auto 2px; }
.eo-select-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 7px 12px; border: 1px solid #e0b4b0; background: #fbe6e4; border-radius: 6px; flex-wrap: wrap; }
.eo-select-bar span { flex: 1; color: var(--bad); }
.eo-table-wrap { overflow-x: auto; }
.eo-tbl { width: 100%; min-width: 720px; border-collapse: collapse; }
.eo-tbl th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.eo-tbl td { padding: 9px 8px; vertical-align: top; border-bottom: 1px solid #edf0ee; }
.eo-tbl .c-sel { width: 30px; }
.eo-tbl .c-sel input { width: auto; min-height: 0; }
.eo-tbl .c-pic { width: 56px; }
.eo-tbl .c-pic img, .eo-tbl .eo-noimg { display: block; width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: #eef1ef; }
.eo-tbl .c-title { min-width: 170px; }
.eo-ltitle { font-weight: 600; }
.eo-opt { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.eo-tbl .c-sku { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; min-width: 80px; max-width: 150px; }
.eo-tbl .c-note { min-width: 110px; max-width: 220px; }
.eo-snote { color: var(--ink); font-size: .82rem; }
.eo-addnote { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; }
.eo-addmuted { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.eo-was { color: var(--muted); font-size: .76rem; text-decoration: line-through; }
.eo-tbl .c-num { white-space: nowrap; }
.eo-tbl .c-total { font-weight: 600; }
.eo-noitems { text-align: center; color: var(--muted); padding: 24px; }

/* inline edit: a <details> per value, one open at a time */
.eo .ed > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 4px; padding: 1px 3px; }
.eo .ed > summary::-webkit-details-marker { display: none; }
.eo .ed > summary:hover { background: var(--soft); }
.eo .ed > summary:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.eo .pen { display: inline-block; width: 13px; height: 13px; flex: none; background: currentColor; opacity: .6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='m13.5 6.5 4 4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='m13.5 6.5 4 4'/%3E%3C/svg%3E") center/contain no-repeat; }
.eo .ed-form { display: flex; gap: 6px; align-items: center; margin: 6px 0 2px; }
.eo .ed-form input { width: 90px; height: 32px; min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 0 7px; font-size: .9rem; }
.eo .ed-form select { height: 32px; min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; background: #fff; font-size: .85rem; }
.eo .ed-form input.ed-wide { width: 160px; }
.eo .ed-end { text-align: right; }
.eo .ed-end .ed-form { justify-content: flex-end; }

/* totals and the bottom bar */
.eo-totals { margin: 12px 0 0 auto; width: min(380px, 100%); padding: 4px 8px; }
.eo-trow { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 6px 0; color: var(--ink); }
.eo-trow > span:last-child { white-space: nowrap; text-align: right; }
.eo-grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; font-weight: 700; font-size: 1rem; }
.eo-disc { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.eo-disc-ways { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.eo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.eo-bar-total { display: flex; align-items: center; gap: 12px; letter-spacing: .04em; margin-left: auto; }
.eo-bar-total b { background: var(--brand-2); color: #fff; padding: 3px 10px; border-radius: 4px; letter-spacing: 0; }

/* Send order */
.eo-sendtext { white-space: pre-wrap; max-height: 240px; overflow: auto; margin: 0; padding: 10px; background: #f4f6f5; border: 1px solid var(--line); border-radius: 6px; font: .82rem/1.4 Consolas, "Segoe UI", monospace; }
.eo-send-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.eo-send-btns svg { width: 16px; height: 16px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.eo-send-btns .btn.eo-linked { display: inline-flex; align-items: center; background: #1fa855; border-color: #1fa855; color: #fff; font-weight: 600; }
.eo-send-btns .btn.eo-linked:hover { background: #178f47; }
.eo .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A computer under 1100px wide: the list gets narrower. Phones (under 768px): one pane at a time. */
@media (max-width: 1100px) {
  .eo-list { width: clamp(260px, 36%, 330px); }
  .eo-two { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 767px) {
  .eo { height: auto; min-height: calc(100dvh - 110px); }
  .eo-panes { flex-direction: column; }
  .eo-list { width: auto; border-right: 0; overflow: visible; }
  .eo.has-order .eo-list, .eo.has-order .eo-top { display: none; }
  .eo:not(.has-order) .eo-pane { display: none; }
  .eo-in { height: auto; }
  .eo-body { overflow: visible; padding: 4px 12px 16px; }
  .eo-back { display: inline-flex; }
  .eo-actions { margin-left: 0; width: 100%; }
  .eo-bar { position: sticky; bottom: 0; z-index: 5; }
  .eo-search { margin-left: 0; width: 100%; order: 3; }
  .eo-addorder { margin-left: auto; }
  .eo-types { padding-left: 0; border-left: 0; }
  .eo-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .eo-chips::-webkit-scrollbar { display: none; }
  .eo-chip { flex: none; }
  .eo-tbl { min-width: 620px; }
  .eo-totals { width: 100%; }
}
