/* rx-sales.css - Sales and Marketing. Builds on rx-system.css, rx-dtr.css and rx-inv.css. */
#slTools .ux-tools__pick { flex: 0 1 170px; }
#slTools .sl-export { flex: 0 1 112px; }
.sl-wide { grid-column: 1 / -1; }
.sl-optsub { display: block; margin-top: 1px; font-size: 12px; opacity: .72; }
.sl-bad { color: var(--bad); }
.sl-note { margin: 0; font-size: 12.5px; color: var(--ink2); }
.sl-warn { margin: 0; font-size: 13px; color: var(--bad); }

/* amounts: label on the left, amount on the right */
.sl-tot { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); font-size: 13.5px; }
.sl-tot > div { display: flex; justify-content: space-between; gap: 14px; }
.sl-tot b { flex: none; font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.sl-tot .sl-big { font-size: 17px; font-weight: 300; }
.sl-tot .sl-big b { font-weight: 400; }
.sl-tot .sl-dim { font-size: 12.5px; color: var(--ink2); }

/* New sale: customer and items on the left, the cart and payment on the right */
.sl-new { width: min(1120px, 100%) !important; }
.sl-pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.sl-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border-radius: 22px; border: 1px solid var(--line); }
.sl-pane h4 { margin: 0; font-size: 14px; font-weight: 500; }
.sl-add { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto; gap: 8px; align-items: end; }
.sl-add > :first-child { grid-column: 1 / -1; }
.sl-add .sl-addbtns { display: flex; gap: 6px; }
.sl-scan { width: 42px; height: 42px; flex: none; padding: 0; display: flex; align-items: center; justify-content: center; }
.sl-scan svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sl-line { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.sl-line:first-of-type { border-top: 0; padding-top: 0; }
.sl-line__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.sl-line__top span { min-width: 0; overflow-wrap: anywhere; }
.sl-line__top small { display: block; font-size: 12px; color: var(--ink2); }
.sl-line__top b { flex: none; font-weight: 400; font-variant-numeric: tabular-nums; }
.sl-line__row { display: grid; grid-template-columns: auto minmax(70px, 1fr) minmax(70px, 1fr) auto; gap: 8px; align-items: end; }
.sl-qty { display: inline-flex; align-items: center; gap: 4px; }
.sl-qty .ux-in { width: 52px; padding: 0 4px; text-align: center; }
.sl-round { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--ctl-line); background: none; color: var(--ink); font: 400 16px var(--font); cursor: pointer; }
.sl-round:hover, .sl-round:focus-visible { border-color: var(--line-hover); outline: none; }
.sl-pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sl-row > .ux-in { flex: 1 1 140px; width: auto; }
.sl-sub { font-size: 12.5px; color: var(--ink2); margin: 0; overflow-wrap: anywhere; }
.sl-coupon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; }
.sl-sched { display: flex; flex-direction: column; gap: 4px; }
.sl-sched__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; }
.sl-sched__row small { display: block; font-size: 12px; color: var(--ink2); }

/* targets: the month picker needs room for "November 2026" */
#slTools input[type="month"].ux-tools__pick { flex: 0 1 190px; min-width: 180px; }

/* pipeline board: one column per stage, side by side; stacked on phones */
.sl-board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; padding: 12px; min-width: 0; overflow-x: auto; align-items: start; }
.sl-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--tint); }
.sl-col__h b { display: block; font-size: 13.5px; font-weight: 500; }
.sl-col__h small { display: block; font-size: 11.5px; color: var(--ink2); }
.sl-deal { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--ctl-line); background: var(--ctl); color: var(--ink); font: 400 13px var(--font); text-align: left; cursor: pointer; }
.sl-deal:hover, .sl-deal:focus-visible { border-color: var(--line-hover); outline: none; }
.sl-deal b { font-weight: 500; overflow-wrap: anywhere; }
.sl-deal small { font-size: 11.5px; color: var(--ink2); }
.sl-letterhead { margin-bottom: 4px; }

/* quick sale: big, touch-friendly counter screen */
.sl-quick { width: min(1180px, 100%) !important; }
.sl-qgrid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sl-qscan, .sl-qcash { height: 54px; font-size: 18px; }
/* Quick sale: items found by typing, big enough to tap at the counter */
.sl-qpick .sl-qscan { padding-right: 14px; background-image: none; }
.sl-qsug { max-height: min(360px, 50vh); }
.sl-qopt { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.sl-qopt .sl-optsub { opacity: .75; }
.sl-qlist { display: flex; flex-direction: column; gap: 8px; max-height: 46dvh; overflow-y: auto; }
.sl-qline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); }
.sl-qline__t b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.sl-qline__t small { display: block; font-size: 12px; color: var(--ink2); }
.sl-qround { width: 44px; height: 44px; font-size: 20px; }
.sl-qn { min-width: 28px; text-align: center; font-size: 17px; }
.sl-qamt { font-weight: 400; font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.sl-qtotal { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); }
.sl-qtotal span { font-size: 13px; color: var(--ink2); }
.sl-qtotal b { font-size: 40px; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sl-qtotal small { font-size: 12px; color: var(--ink2); }
.sl-qpads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sl-qbtn { height: 56px; font-size: 16px; }
.sl-qchange { display: flex; justify-content: space-between; align-items: baseline; min-height: 40px; font-size: 15px; }
.sl-qchange b { font-size: 28px; font-weight: 300; font-variant-numeric: tabular-nums; }
.sl-qdone { height: 60px; font-size: 18px; }

/* targets */
.sl-total td { font-weight: 500; border-top: 1px solid var(--line-hover); }
.sl-pad { padding: 10px 14px; }

/* camera scan */
.sl-cam { width: 100%; max-height: 50dvh; border-radius: 16px; background: #111; object-fit: cover; }

/* return rows */
.sl-ret { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.sl-ret small { display: block; font-size: 12px; color: var(--ink2); }
/* serial numbers on a sale line: the ones in stock here as chips to tap, a count, and a warning for one not in stock */
.sl-serials { display: flex; flex-direction: column; gap: 6px; }
.sl-serials__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.sl-snchips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.sl-snchip { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.sl-snchip.is-on { background: var(--accent, #f07c1f); border-color: var(--accent, #f07c1f); color: #fff; font-weight: 600; }
.sl-snchip.is-bad { border-color: #e5484d; color: #ff9b9e; }
.sl-snchip.is-on.is-bad { background: #e5484d; color: #fff; }
.sl-snwarn { margin: 0; font-size: 12.5px; color: #ff9b9e; }
/* phones: bigger chips to tap, and the label on its own line above the count */
@media (max-width: 600px) {
  .sl-snchip { min-height: 40px; padding: 8px 14px; }
  .sl-serials__head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .sl-snchips { max-height: 180px; }
}
/* placeholder rows while a list loads, at about the height of the real rows (phones show rows as taller cards) */
.sl-skel { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sl-skel__row { height: 44px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .11), rgba(255, 255, 255, .05)); background-size: 200% 100%; animation: sl-skel 1.4s ease-in-out infinite; }
@media (max-width: 600px) { .sl-skel__row { height: 132px; border-radius: 16px; } }
@keyframes sl-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sl-skel__row { animation: none; } }
/* "Your cash drawer isn't open" at the till: a notice, not a block */
.sl-drawer-warn { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(240, 124, 31, .55); background: rgba(240, 124, 31, .12); font-size: 13.5px; }
/* a promotion on a sale line */
.sl-promo { margin: 2px 0 0; font-size: 12px; color: var(--ac-text); }
.sl-pmchip { cursor: pointer; }
/* forecast bars: sold (solid), forecast (lighter), target (a tick) */
.sl-fbar { position: relative; height: 10px; min-width: 80px; border-radius: 5px; background: rgba(255, 255, 255, .08); }
.sl-fbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--accent, #f07c1f); }
.sl-fbar i.is-fc { opacity: .45; }
.sl-fbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; }
/* on a phone the count under the title wraps instead of running off the screen (big companies have long totals) */
@media (max-width: 600px) { #slCount { white-space: normal; } }
/* serial numbers to tick on a return: their own full-width row under the item */
.sl-ret__sns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.sl-ret__sns > span { font-size: 12px; color: var(--ink2); width: 100%; }

/* campaign audience */
.sl-checks { display: flex; flex-direction: column; gap: 6px; max-height: 170px; overflow-y: auto; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); }

/* receipt: on paper only the receipt shows */
.sl-receipt { display: flex; flex-direction: column; gap: 8px; }
.sl-receipt h4 { margin: 0; font-size: 20px; font-weight: 300; }
.sl-receipt p { margin: 0; font-size: 13px; }
.sl-receipt__foot { text-align: center; padding-top: 6px; }
@media print {
  body.sl-printing > *:not(.dtr-modal) { display: none !important; }
  body.sl-printing .dtr-modal { position: static; display: block; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.sl-printing .dtr-modal__card { width: 100% !important; max-height: none; overflow: visible; box-shadow: none; padding: 0; background: #fff; }
  body.sl-printing .dtr-modal__foot, body.sl-printing .dtr-modal__card > h3, body.sl-printing .sl-noprint { display: none; }
  body.sl-printing .dtr-modal:not(.sl-print-me) { display: none !important; }
}

@media (orientation: portrait), (max-width: 760px) {
  #slPage .sm-perm__head { flex-wrap: wrap; row-gap: 6px; }
  #slTools .ux-tools__pick, #slTools .ux-btn, #slTools .sl-export { flex: 1 1 40%; }
  .sl-pos { grid-template-columns: minmax(0, 1fr); }
  .sl-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sl-add > :first-child, .sl-add .sl-addbtns { grid-column: 1 / -1; }
  .sl-add .sl-addbtns .ux-btn { flex: 1; }
  .sl-line__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sl-pay { grid-template-columns: minmax(0, 1fr); }
  .sl-form.dtr-form--two { grid-template-columns: minmax(0, 1fr); }
  #slBox .dtr__body > .dtr-t tfoot { display: block; }
  .sl-board { grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
  .sl-qgrid { grid-template-columns: minmax(0, 1fr); }
  .sl-qamt { min-width: 0; }   /* the Collections total becomes a card like the rows above it */
}

/* an empty list: the reason, then its next step as a button */
.sl-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 16px; text-align: center; }
.sl-empty .ux__msg { margin: 0; }


/* first sale on a new company: what to set up, with links */
.sl-first a { color: var(--ac-text); text-decoration: underline; }
/* a line sold by a unit: 2 Box of 12 */
.sl-unit { display: block; }


/* a card's title with its History button */
.sl-histhead { align-items: center; gap: 8px; }
.sl-histhead h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media print { .sl-histhead .rxh-btn { display: none; } }


/* Insights (rx-sales-insights.js): cards in a grid that becomes one column on a phone */
.sl-ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 14px 0; }
.sl-ins-wide { margin: 14px 0; }
.dtr__body > .rxch-kpis { margin-bottom: 14px; }


/* Drop ship tick box on a sale or quotation line (database/154) */
.sl-dropship { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; white-space: nowrap; }


/* Insights > Explore: the totals row of the pivot */
.sl-pv-total td { font-weight: 700; border-top: 1px solid rgba(255,255,255,.25); }


/* Insights tables on desktop: a plain table that scrolls sideways when wide (cards only on a phone) */
.sl-ins-tw { overflow: auto; border-radius: 16px; border: 1px solid var(--line, rgba(255,255,255,.14)); }
.sl-ins-tw .dtr-t { width: 100%; }


/* Staffing hint lines (database/222) */
.sl-hints { margin: 10px 0 0; padding-left: 18px; }
.sl-hints li { margin: 4px 0; }
.sl-hints .is-busy { color: #f2b36b; }

