:root {
  --sa-ink: #14202b;
  --sa-muted: #5d6b78;
  --sa-line: #dde3e9;
  --sa-bg: #f3f5f7;
  --sa-panel: #ffffff;
  --sa-brand: #0f1a14;
  --sa-accent: #e8a317;
  --sa-blue: #1559d0;
  --sa-green: #0c7a32;
  --sa-garment-bg: #eceff2;
}
body { background: var(--sa-bg); color: var(--sa-ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; }
a { color: var(--sa-blue); }

/* ---------- navigation ---------- */
.app-nav { background: var(--sa-brand); }
.app-nav .navbar-brand { letter-spacing: .06em; font-weight: 600; }
.app-nav .navbar-brand b { color: var(--sa-accent); }
.app-nav .nav-link.active { color: #fff; box-shadow: inset 0 -2px 0 var(--sa-accent); }
.crm-subnav { background: #22303c; padding: 6px 0; }
.crm-tab { color: #cfd8e0; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: .95rem; }
.crm-tab:hover { color: #fff; background: #2f404e; }
.crm-tab.active { color: #fff; background: #3a5064; }
.crm-search { flex: 0 1 380px; }
.app-footer { color: var(--sa-muted); font-size: .85rem; padding: 24px 0; border-top: 1px solid var(--sa-line); background: #fff; }

/* ---------- panels ---------- */
.panel { background: var(--sa-panel); border: 1px solid var(--sa-line); border-radius: 10px; padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--sa-muted); }
.stat { background: #fff; border: 1px solid var(--sa-line); border-radius: 10px; padding: 14px 16px; height: 100%; }
.stat .num { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--sa-muted); font-size: .85rem; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table-clickable tbody tr { cursor: pointer; }
.empty { color: var(--sa-muted); text-align: center; padding: 28px 10px; border: 1px dashed var(--sa-line); border-radius: 10px; background: #fafbfc; }

/* ---------- shop ---------- */
.shop-hero { background: linear-gradient(120deg, #0f1a14, #22303c); color: #fff; border-radius: 14px; padding: 28px 28px; margin-bottom: 20px; }
.shop-hero .kicker { color: var(--sa-accent); font-weight: 700; letter-spacing: .08em; font-size: .8rem; }
.shop-hero h1 { font-weight: 800; margin: 6px 0; }
.filters { position: sticky; top: 12px; }
.filters .form-label { font-size: .85rem; font-weight: 600; margin-bottom: 2px; }
.cat-list { max-height: 360px; overflow: auto; }
.cat-list .form-check { font-size: .92rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.product-card { background: #fff; border: 1px solid var(--sa-line); border-radius: 12px; overflow: hidden; text-align: left; padding: 0; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.product-card:hover, .product-card:focus-visible { box-shadow: 0 8px 22px rgba(20, 32, 43, .14); transform: translateY(-2px); }
.product-card .ph { aspect-ratio: 1; background: var(--sa-garment-bg); display: flex; align-items: center; justify-content: center; }
.product-card .ph img { width: 100%; height: 100%; object-fit: contain; }
.product-card .info { padding: 10px 12px 14px; }
.product-card .brand { color: var(--sa-muted); font-size: .8rem; }
.product-card .title { font-size: .95rem; font-weight: 600; margin: 2px 0 6px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price { font-weight: 700; color: var(--sa-green); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { border: 2px solid #cfd6de; border-radius: 8px; padding: 2px; background: #fff; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; overflow: hidden; }
.swatch img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.swatch[aria-pressed="true"] { border-color: var(--sa-blue); box-shadow: 0 0 0 2px rgba(21, 89, 208, .3); }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.size-grid label { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; font-weight: 600; text-align: center; }
.size-grid input { text-align: center; }
.size-grid small { font-weight: 400; color: var(--sa-muted); }
.gallery-main { aspect-ratio: 1; background: var(--sa-garment-bg); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { width: 64px; height: 64px; padding: 3px; border: 2px solid var(--sa-line); border-radius: 8px; background: #fff; }
.thumbs button[aria-pressed="true"] { border-color: var(--sa-blue); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- mockups (product photo with logos) ---------- */
.mockup { margin: 0; }
.mockup-box { position: relative; width: 100%; background: var(--sa-garment-bg); border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.mockup-box.broken { display: flex; align-items: center; justify-content: center; color: var(--sa-muted); font-size: .8rem; }
.mockup-box .mk-photo { position: absolute; left: 0; top: 0; width: 100%; height: auto; display: block; user-select: none; pointer-events: none; }
.mockup-box .mk-viewport { position: absolute; left: 50%; top: 50%; overflow: hidden; }
.mockup-box .mk-viewport img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mockup-box .mk-logo { position: absolute; display: block; height: auto; pointer-events: none; user-select: none; }
.mockup figcaption { font-size: .8rem; color: var(--sa-muted); text-align: center; padding-top: 4px; }
.mockup-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mockup-row.sm { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

/* ---------- order lines ---------- */
.line-card { border: 1px solid var(--sa-line); border-radius: 10px; padding: 14px; background: #fff; }
.line-card + .line-card { margin-top: 12px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.size-chip { border: 1px solid var(--sa-line); border-radius: 6px; padding: 2px 8px; font-size: .85rem; background: #f8fafb; }
.size-chip b { margin-left: 4px; }
.placement-table td, .placement-table th { font-size: .85rem; }
.logo-thumb { width: 48px; height: 48px; object-fit: contain; background: repeating-conic-gradient(#e9edf1 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 1px solid var(--sa-line); border-radius: 6px; }
.logo-tile { background: #fff; border: 1px solid var(--sa-line); border-radius: 10px; padding: 10px; text-align: center; height: 100%; }
.logo-tile .img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#e9edf1 0 25%, #fff 0 50%) 0 0 / 14px 14px; border-radius: 8px; margin-bottom: 6px; }
.logo-tile .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-tile .name { font-size: .8rem; word-break: break-all; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--sa-line); padding: 4px 0 12px 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: #9fb0bf; }
.timeline li.t-call::before { background: var(--sa-green); }
.timeline li.t-email::before { background: var(--sa-blue); }
.timeline li.t-status::before, .timeline li.t-system::before { background: var(--sa-accent); }
.timeline .meta { font-size: .8rem; color: var(--sa-muted); }
.timeline .body { white-space: pre-wrap; }

/* ---------- designer ---------- */
.designer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.designer-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.designer-toolbar .btn { min-width: 38px; }
.designer-toolbar .sep { width: 1px; height: 28px; background: var(--sa-line); margin: 0 4px; }
.stage-wrap { background: #fff; border: 1px solid var(--sa-line); border-radius: 12px; padding: 10px; }
.stage-scroll { overflow: auto; max-height: 76vh; border-radius: 8px; background: var(--sa-garment-bg); }
.stage-sheet { position: relative; margin: 0 auto; touch-action: none; user-select: none; }
.stage-sheet > .photo { position: absolute; left: 0; top: 0; width: 100%; display: block; pointer-events: none; }
.stage-sheet.mirrored > .photo { transform: scaleX(-1); }
.stage-sheet .guide { position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed #e0457b; pointer-events: none; display: none; z-index: 5; }
.stage-sheet .guide.h { top: 50%; bottom: auto; left: 0; right: 0; border-left: 0; border-top: 1px dashed #e0457b; }
.stage-sheet .guide.on { display: block; }
.placed { position: absolute; transform-origin: center; cursor: move; touch-action: none; outline: 1px solid transparent; }
.placed img { display: block; width: 100%; height: auto; pointer-events: none; }
.placed:hover { outline-color: rgba(22, 132, 255, .45); }
.placed.selected { outline: 1.5px solid #1684ff; }
.placed .handle { display: none; position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #1684ff; border-radius: 3px; z-index: 3; }
.placed.selected .handle { display: block; }
.placed .handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.placed .handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.placed .handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.placed .handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.placed .handle.rot { left: calc(50% - 9px); top: -36px; width: 18px; height: 18px; border-radius: 50%; cursor: grab; }
.placed .handle.rot::after { content: '↻'; position: absolute; inset: -3px 0 0; text-align: center; font-size: 13px; color: #1684ff; line-height: 18px; }
.placed .tag { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); background: #1684ff; color: #fff; font-size: 11px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; display: none; }
.placed.selected .tag:not(:empty) { display: block; }
.view-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.view-tab { border: 2px solid var(--sa-line); background: #fff; border-radius: 10px; padding: 4px; width: 88px; text-align: center; font-size: .75rem; position: relative; }
.view-tab img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--sa-garment-bg); border-radius: 6px; }
.view-tab[aria-pressed="true"] { border-color: var(--sa-blue); }
.view-tab .count { position: absolute; top: 2px; right: 2px; background: var(--sa-blue); color: #fff; border-radius: 10px; font-size: 11px; min-width: 18px; padding: 0 5px; }
.side .nav-tabs .nav-link { padding: 6px 10px; font-size: .9rem; }
.side .tab-pane { padding-top: 12px; }
.logo-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.logo-pick button { aspect-ratio: 1; border: 1px solid var(--sa-line); border-radius: 8px; padding: 4px; background: repeating-conic-gradient(#e9edf1 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.logo-pick button:hover, .logo-pick button:focus-visible { border-color: var(--sa-blue); outline: 2px solid rgba(21, 89, 208, .25); }
.logo-pick img { width: 100%; height: 100%; object-fit: contain; }
.dropzone { border: 2px dashed #b8c4cf; border-radius: 10px; padding: 14px; text-align: center; color: var(--sa-muted); font-size: .9rem; cursor: pointer; margin-bottom: 10px; }
.dropzone.drag { border-color: var(--sa-blue); background: #eef4ff; color: var(--sa-blue); }
.designer-status { min-height: 1.4em; font-size: .9rem; }
.kbd-help { font-size: .8rem; color: var(--sa-muted); }

@media (max-width: 991px) {
  .designer { grid-template-columns: 1fr; }
  .filters { position: static; }
}

/* ---------- print (work orders) ---------- */
@media print {
  .app-nav, .crm-subnav, .app-footer, .no-print, .btn, form.no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; }
  .panel, .line-card { border: 1px solid #999; break-inside: avoid; }
  .mockup-row { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- designer pricing (staff) ---------- */
.price-calc { border-top: 1px solid var(--sa-line); margin-top: 14px; padding-top: 12px; }
.pc-qty { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pc-qty input { width: 90px; }
.pc-line { display: grid; grid-template-columns: 82px minmax(0, 1fr) 70px 16px; gap: 6px; align-items: center; margin-bottom: 6px; font-size: .85rem; }
.pc-method { font-weight: 600; }
.pc-price { text-align: right; font-variant-numeric: tabular-nums; }
.pc-extra { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: .8rem; margin: 3px 0; }
.pc-extra .form-check-input { margin: 0 auto; }
.pc-count { padding: 1px 4px; }
.pc-total { background: var(--sa-bg); border-radius: 8px; padding: 8px 10px; }
.size-table input { min-width: 64px; }
.size-table td, .size-table th { font-size: .85rem; }
.price-summary td { font-size: .9rem; font-variant-numeric: tabular-nums; }
.price-summary .ps-fee { width: 70px; display: inline-block; }
.chart-edit input, .chart-edit select { min-width: 72px; }
.chart-edit th { white-space: nowrap; }
.chart-tier { display: flex; align-items: center; gap: 3px; }
.chart-tier input { width: 72px; min-width: 0; }
.card-fee-form { border-top: 1px solid var(--sa-line); padding-top: 10px; }
.card-fee-form input { width: 76px; }

/* ---------- guided flow (steps, action bar, trackers) ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 0 0 14px; counter-reset: none; }
.steps li button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--sa-line); border-radius: 10px; padding: 8px 12px; color: var(--sa-ink); }
.steps li button:hover { border-color: #aebdca; }
.steps .n { flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sa-bg); border: 1px solid var(--sa-line); font-weight: 700; font-size: .85rem; }
.steps b { display: block; font-size: .92rem; line-height: 1.1; }
.steps small { display: block; color: var(--sa-muted); font-size: .75rem; }
.steps li.done .n { background: var(--sa-green); border-color: var(--sa-green); color: #fff; }
.steps li.current button { border-color: var(--sa-accent); box-shadow: 0 0 0 3px rgba(232, 163, 23, .22); }
.steps li.current .n { background: var(--sa-accent); border-color: var(--sa-accent); color: #14202b; }
.action-bar { position: sticky; top: 8px; z-index: 30; padding: 12px 14px; box-shadow: 0 4px 14px rgba(20, 32, 43, .06); }
.action-bar .designer-status { font-size: .85rem; }
.place-list { display: flex; flex-direction: column; gap: 4px; }
.place-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--sa-line); background: #fff; border-radius: 8px; padding: 4px 8px; font-size: .8rem; }
.place-item img { width: 30px; height: 30px; object-fit: contain; background: repeating-conic-gradient(#e9edf1 0 25%, #fff 0 50%) 0 0 / 8px 8px; border-radius: 4px; }
.place-item.active { border-color: var(--sa-blue); box-shadow: 0 0 0 2px rgba(21, 89, 208, .2); }
.hero-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 4px 0 10px; counter-reset: hs; font-weight: 600; }
.hero-steps li { counter-increment: hs; }
.hero-steps li::before { content: counter(hs); display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--sa-accent); color: #14202b; align-items: center; justify-content: center; font-size: .8rem; margin-right: 6px; }
.mini-steps { padding-left: 1.2rem; margin-bottom: 12px; color: var(--sa-muted); }
.gs-step { display: flex; gap: 12px; align-items: flex-start; }
.gs-step .n { flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--sa-accent); color: #14202b; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tracker { list-style: none; display: flex; padding: 0; margin: 0; }
.tracker li { flex: 1; text-align: center; position: relative; font-size: .8rem; color: var(--sa-muted); padding-top: 22px; }
.tracker li::before { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #b8c4cf; z-index: 1; }
.tracker li::after { content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: #d3dbe2; }
.tracker li:first-child::after { display: none; }
.tracker li.done { color: var(--sa-ink); }
.tracker li.done::before { background: var(--sa-green); border-color: var(--sa-green); }
.tracker li.done::after, .tracker li.current::after { background: var(--sa-green); }
.tracker li.current { color: var(--sa-ink); font-weight: 700; }
.tracker li.current::before { background: var(--sa-accent); border-color: var(--sa-accent); box-shadow: 0 0 0 4px rgba(232, 163, 23, .25); }
@media (max-width: 767px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .tracker li span { display: none; }
  .tracker li.current span { display: block; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  .tracker { padding-bottom: 18px; }
  .action-bar { position: static; }
}

/* Designer text tool */
.add-text-btn{text-align:left;padding:.6rem .8rem;border-style:dashed;font-weight:600}
.add-text-btn span{font-size:1.2em;margin-right:.3rem}
.add-text-btn small{font-weight:400;margin-top:2px}
.tx-preview{min-height:96px;display:grid;place-items:center;padding:12px;border-radius:10px;border:1px solid var(--sa-line);
  background:repeating-conic-gradient(#eef1f4 0 25%,#fff 0 50%) 0 0/18px 18px}
.tx-preview img{max-width:100%;max-height:150px}
.tx-shapes{display:flex;gap:6px}
.tx-shapes .btn{flex:1;white-space:nowrap}
.tx-swatches{display:flex;flex-wrap:wrap;gap:6px}
.tx-swatches button{width:26px;height:26px;border-radius:50%;border:1px solid rgba(0,0,0,.25);padding:0;box-shadow:inset 0 0 0 2px rgba(255,255,255,.5)}
.tx-swatches button:focus-visible{outline:2px solid var(--sa-blue);outline-offset:2px}
#txFont{font-size:1.05rem}

/* Designer price breakdown (Product tab) */
.price-info { border-top: 1px solid var(--sa-line); padding-top: .75rem; }
.pi-block { margin-bottom: .9rem; }
.pi-h { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5d6b78; margin-bottom: .35rem; }
.pi-sizes { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; }
.pi-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 1px solid var(--sa-line); border-radius: 8px; padding: 6px; margin-bottom: 6px; }
.pi-line:hover, .pi-line:focus-visible { border-color: var(--sa-blue); }
.pi-line img { width: 40px; height: 40px; object-fit: contain; flex: none; background: repeating-conic-gradient(#e9edf1 0 25%, #fff 0 50%) 0 0 / 10px 10px; border-radius: 4px; }
.pi-what { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; line-height: 1.25; }
.pi-what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-what small { color: #5d6b78; }
.pi-price { font-weight: 700; white-space: nowrap; }
.pi-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; padding: 2px 0; }
.pi-row span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pi-sub { border-top: 1px solid var(--sa-line); margin-top: 4px; padding-top: 4px; font-weight: 600; }
.pi-grand { font-weight: 700; font-size: 1.05rem; }
.pi-total { background: #f6f8fa; border-radius: 8px; padding: 8px 10px; }
.pi-formula { font-size: .8rem; color: #6b4e00; background: #fff8e1; border-radius: 6px; padding: 4px 8px; margin-top: 4px; }
.pi-cost { font-size: .82rem; }
.pi-chart { margin-bottom: .5rem; font-size: .82rem; }
.pi-chart summary { font-weight: 600; cursor: pointer; }
.pi-chart th, .pi-chart td { white-space: nowrap; }
.pi-chart .pi-col { background: #fff3cd; }
.pi-chart .pi-use > * { font-weight: 700; }
.pi-chart .pi-use .pi-col { background: #ffd966; }

/* Designer color pickers: thread spools / screen print ink / heat press, plus "Colors selected" chips */
.cp{position:relative;border:1px solid #dfe4ea;border-radius:8px;padding:6px 8px 8px;margin-bottom:8px;background:#fafbfc}
.cp.is-match{border-color:var(--sa-blue);background:#eef4ff;box-shadow:0 0 0 2px rgba(21,89,208,.15)}
.cp-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px;margin-bottom:4px}
.cp-title{font-size:.8rem;font-weight:700}
.cp-sub{font-size:.72rem;color:#6c757d}
.cp-btn{text-align:left;font-size:.875rem}
.cp-pop{position:absolute;left:0;right:0;top:100%;z-index:40;background:#fff;border:1px solid #cfd6de;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:6px}
.cp-list{list-style:none;margin:6px 0 0;padding:0;max-height:300px;overflow:auto}
.cp-group{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#6c757d;padding:6px 6px 2px;position:sticky;top:0;background:#fff}
.cp-opt{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:6px;cursor:pointer;font-size:.85rem}
.cp-opt:hover,.cp-opt:focus{background:#eef4ff;outline:none}
.cp-opt:focus-visible{box-shadow:inset 0 0 0 2px var(--sa-blue)}
.cp-num{font-variant-numeric:tabular-nums;min-width:3.2em}
.cp-name{flex:1}
.cp-pms{color:#6c757d;white-space:nowrap}
.cp-ico{width:26px;height:26px;flex:none}
.cp-selected{border:1px dashed #b8c2cc;border-radius:8px;padding:8px;background:#fff}
.cp-chips{display:flex;flex-wrap:wrap;gap:6px}
.cp-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid #cfd6de;border-radius:999px;padding:2px 4px 2px 4px;font-size:.78rem;background:#f8f9fa;max-width:100%}
.cp-chip .cp-ico{width:20px;height:20px}
.cp-ico-custom{display:inline-block;border:1px dashed #868e96;border-radius:50%;width:16px!important;height:16px!important}
.cp-x{border:0;background:none;font-size:1rem;line-height:1;padding:0 4px;color:#6c757d}
.cp-x:hover{color:#c00}

/* Big 3D thread spool preview on hover (designer color pickers) */
.cpz{position:fixed;z-index:1080;width:333px;padding:14px 18px 18px;background:radial-gradient(circle at 50% 35%,#ffffff 0,#f1f3f6 70%);border:1px solid #cfd6de;border-radius:14px;box-shadow:0 14px 36px rgba(0,0,0,.25);pointer-events:none;text-align:center;animation:cpzIn .14s ease-out}
.cpz[hidden]{display:none}
.cpz-svg{display:block;width:263px;height:357px;margin:0 auto 4px;filter:drop-shadow(0 4px 6px rgba(0,0,0,.18))}
.cpz-name{font-size:1.35rem;line-height:1.2}
.cpz-sub{display:flex;align-items:center;justify-content:center;gap:8px;font-size:.95rem;color:#6c757d;margin-top:3px}
.cpz-dot{width:0.955in;height:0.955in;margin:8px auto 6px;border-radius:50%;border:1px solid rgba(0,0,0,.3);box-shadow:0 2px 6px rgba(0,0,0,.2)}
@keyframes cpzIn{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
/* "Colors selected" split into thread / ink / heat press / other groups */
.cp-sel-group{flex:1 1 100%;border-left:4px solid #adb5bd;border-radius:6px;background:#f8f9fa;padding:5px 8px 7px}
.cp-sel-group+.cp-sel-group{margin-top:4px}
.cp-sel-thread{border-left-color:#c9a46b;background:#fdf8ef}
.cp-sel-ink{border-left-color:var(--sa-blue);background:#f1f5fd}
.cp-sel-heat{border-left-color:#e8590c;background:#fff4ec}
.cp-sel-title{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#495057;margin-bottom:4px}
.cp-sel-chips{display:flex;flex-wrap:wrap;gap:6px}
.cp-sel-group .cp-chip{background:#fff}
/* Selected colors shown right under their own dropdown */
.cp-mine{margin-top:6px;padding-top:6px;border-top:1px dashed #cfd6de}
.cp-mine .cp-chip{background:#fff}
.cp[data-chart=thread] .cp-mine .cp-chip{border-color:#c9a46b}
.cp[data-chart=ink] .cp-mine .cp-chip{border-color:#8fb0ea}

/* SanMar order page: one card per style/color with picture and every size */
.sm-line{display:flex;gap:14px;border:1px solid var(--sa-line,#dee2e6);border-radius:10px;padding:10px;margin-bottom:10px;background:#fff}
.sm-line.is-removed{opacity:.55;background:#f8f9fa}
.sm-line.is-removed .sm-pic img{filter:grayscale(1)}
.sm-pic{flex:0 0 96px;height:110px;display:flex;align-items:center;justify-content:center;background:#f6f7f9;border-radius:8px;overflow:hidden}
.sm-pic img{max-width:100%;max-height:100%;object-fit:contain}
.sm-body{flex:1;min-width:0}
.sm-swatch{width:16px;height:16px;border-radius:3px;border:1px solid rgba(0,0,0,.25);vertical-align:-3px;margin-right:4px;object-fit:cover}
.sm-sizes{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.sm-size{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;border:1px solid #dfe4ea;border-radius:8px;padding:6px 8px 4px;width:86px;background:#fafbfc}
.sm-size-label{font-weight:700;font-size:.85rem}
.sm-size .sm-qty{width:64px;text-align:center}
.sm-size-was{font-size:.68rem;color:#6c757d}
.sm-x{position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;border:1px solid #dc3545;background:#fff;color:#dc3545;font-size:.85rem;line-height:1;padding:0}
.sm-x:hover{background:#dc3545;color:#fff}
.sm-size.is-removed{opacity:.5;background:#f1f3f5}
.sm-size.is-removed .sm-qty{text-decoration:line-through}
.sm-size.is-removed .sm-x{border-color:#198754;color:#198754}
.sm-size.is-problem{background:#fff3cd;border-color:#ffe08a;width:auto}
@media (max-width:576px){.sm-line{flex-direction:column}.sm-pic{flex-basis:auto;width:100%}}

/* Live SanMar inventory grid (crm/inventory.php) and stock badges */
.inv-wrap{max-height:75vh}
.inv-table{font-variant-numeric:tabular-nums;font-size:.85rem}
.inv-table thead th{position:sticky;top:0;background:#f1f3f5;z-index:2}
.inv-table .inv-color{position:sticky;left:0;background:#fff;white-space:nowrap;z-index:1;min-width:170px}
.inv-table thead .inv-color{z-index:3;background:#f1f3f5}
.inv-out{background:#f8d7da!important;color:#842029}
.inv-low{background:#fff3cd!important;color:#664d03}
.inv-mid{background:#e7f1ff!important}
.inv-ok{background:#d1e7dd!important;color:#0f5132}
.inv-na{color:#adb5bd;text-align:center}
.inv-legend span{display:inline-block;padding:0 6px;border-radius:4px}
.sm-stock{font-size:.68rem;border-radius:4px;padding:0 4px}
/* Designer Inventory tab */
#tabInv .inv-table{font-size:.78rem}
#tabInv .inv-table .inv-color{min-width:110px}
#tabInv .inv-current th.inv-color{background:#fff8e1;font-weight:700}
#tabInv .inv-want th, #tabInv .inv-want td{background:#f8f9fa;font-style:italic}

/* ---------- shopping boxes (crm/box.php) ---------- */
.box-line { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.box-photo { width: 64px; height: 72px; object-fit: contain; }
.box-cust-field { position: relative; flex: 1 1 300px; max-width: 420px; }
.box-cust-list { position: absolute; z-index: 1050; left: 0; right: 0; max-height: 320px; overflow-y: auto; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.box-name-field { flex: 1 1 260px; max-width: 420px; }
.box-create-field { padding-top: 1.5rem; }
.box-add { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.box-add-photo { width: 160px; height: 190px; object-fit: contain; }
.box-add-body { flex: 1 1 280px; min-width: 0; }
.box-line-info { min-width: 220px; flex: 0 1 300px; }
.box-line-price { flex: 1 1 100%; min-width: 0; }
.box-art-picks { margin-bottom: 6px; }
.box-price-table { max-width: 760px; font-size: .85rem; }
.box-totals .table { max-width: 560px; }
.box-art-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.1); font-size: .85rem; }
.box-art-name { flex: 1 1 200px; max-width: 280px; }
.box-art-type { flex: 1 1 240px; max-width: 300px; }
.box-art-small { width: 96px; }
.box-art-info { flex: 1 1 100%; }
.box-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.box-size { width: 86px; text-align: center; margin: 0; font-size: .8rem; }
.box-size-name { display: block; font-weight: 600; }
.box-stock { display: block; min-height: 1.2em; font-size: .72rem; color: #5c636a; white-space: nowrap; }
.box-short { color: #b02a37; font-weight: 700; }

/* Style lookup in the top bar (the dropdown's own look lives in stylepicker.js) */
.nav-style-search { flex: 0 1 260px; margin: .5rem 0; }
@media (min-width: 992px) { .nav-style-search { margin: 0 1rem 0 0; } }
/* Color picker: taller dropdown + "See all" window (2026-11-11, backups *.bak-cpmodal) */
.cp-row{display:flex;gap:6px;align-items:stretch}
.cp-row .cp-btn{flex:1;min-width:0}
.cp-all{white-space:nowrap;flex:none}
.cp-list{max-height:min(62vh,560px)}
.cpm .modal-header .cpm-find{width:min(100%,280px)}
.cpm .modal-body{background:#f6f7f9}
.cpm-group+.cpm-group{margin-top:18px}
.cpm-gtitle{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#6c757d;margin:0 0 8px}
.cpm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.cpm-tile{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 6px 8px;background:#fff;border:1px solid #dfe4ea;border-radius:10px;text-align:center;line-height:1.15;cursor:pointer;transition:border-color .12s,box-shadow .12s,transform .12s}
.cpm-tile:hover{border-color:#8fb0ea;box-shadow:0 4px 12px rgba(0,0,0,.08);transform:translateY(-1px)}
.cpm-tile:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(21,89,208,.35)}
.cpm-tile.is-on{border:2px solid var(--sa-blue);background:#eef4ff;padding:9px 5px 7px}
.cpm-tile[hidden],.cpm-group[hidden]{display:none}
.cpm-sw{position:relative;display:block}
.cpm-sw .cp-ico{width:56px;height:56px}
.cpm-check{position:absolute;right:-8px;top:-6px;width:22px;height:22px;border-radius:50%;background:var(--sa-blue);color:#fff;font-size:.8rem;font-weight:700;line-height:22px;display:none}
.cpm-tile.is-on .cpm-check{display:block}
.cpm-txt{display:flex;flex-direction:column;align-items:center;font-size:.82rem}
.cpm-num{font-variant-numeric:tabular-nums}
.cpm-pms{color:#6c757d;font-size:.72rem}
@media (max-width:575.98px){.cpm-grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}.cpm-sw .cp-ico{width:46px;height:46px}}
.cp-row .cp-btn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
