/* Bulk Production (factory steps), Customers (their SKU codes and files), factory users, brand logos and the
   datasheet page 2 layouts (built 11/2026). Uses the shared type scale and control sizes from tokens.css. */

/* ---- Users: factory / agent link ------------------------------------------------------------------------------- */
.user-link-sees{margin-top:6px;padding:8px 10px;border:1px solid #bbf7d0;background:#f0fdf4;border-radius:8px;font-size:var(--fs-label)}
.user-link-sees ul{margin:4px 0 4px;padding-left:0;list-style:none}
.user-link-sees li{padding:1px 0}
.user-link-sees li.is-yes::before{content:"✓ ";color:#15803d;font-weight:700}
.user-link-sees li.is-no::before{content:"✗ ";color:#b91c1c;font-weight:700}
.user-unlinked-banner{margin:8px 0;padding:8px 12px;border:1px solid #fed7aa;background:#fff7ed;border-radius:8px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:var(--fs-field)}
.user-unlinked-banner strong{color:#9a3412}
.user-unlinked{color:#9a3412;font-weight:600}
tr.user-row-unlinked td{background:#fff7ed}

/* ---- Settings → Features: bulk production steps ---------------------------------------------------------------- */
.bulk-settings{margin-top:14px}
.bulk-settings-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;margin-top:8px}
.bulk-settings-title,.cust-switches-title{font-size:var(--fs-label);color:var(--fg-secondary);font-weight:500;margin:4px 0}

/* ---- Bulk Production list (redesigned 21/11/2026) ------------------------------------------------------------------------ */
.bulk-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:4px 0 10px}
.bulk-tile{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;color:inherit;font:inherit;text-align:left;cursor:pointer;min-height:56px}
#content .bulk-tile span:not(#_){font-size:var(--fs-label);color:var(--fg-secondary)}
#content .bulk-tile strong:not(#_){font-size:20px!important;font-weight:600!important;line-height:1.2}
.bulk-tile.is-red strong{color:#b91c1c}.bulk-tile.is-amber strong{color:#b45309}.bulk-tile.is-green strong{color:#15803d}
.bulk-tile.is-on{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.bulk-tile:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.bulk-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 10px}
.bulk-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.bulk-chips .chip.is-on,.cad-chip.is-on{background:#eff6ff;border-color:#2563eb;color:#1d4ed8}
.bulk-search{flex:1 1 220px;height:var(--ctl-h);padding:var(--ctl-pad);box-sizing:border-box}
.bulk-group-btn[aria-pressed="true"]{background:#eff6ff;border-color:#93c5fd;color:#1d4ed8}
.bulk-table td{vertical-align:middle}
.bulk-table tr.bulk-late td:first-child{box-shadow:inset 3px 0 0 #dc2626}
.bulk-table tr.bulk-po-row td{background:#f8fafc;font-size:var(--fs-label);color:var(--fg-secondary);padding-top:6px;padding-bottom:6px;cursor:default}
.bulk-table tr.bulk-po-row strong{font-size:var(--fs-field);color:inherit;color:#111827}
.bulk-style strong{font-weight:600}
.bulk-style .muted{display:block;font-size:var(--fs-label)}
.bulk-style .badge{margin-top:3px}
.bulk-now{margin-top:5px;font-size:var(--fs-label)}
.bulk-now strong{font-weight:600}
.bulk-etd{white-space:nowrap}
.bulk-etd small{display:block;font-size:var(--fs-label);color:var(--fg-secondary)}
.bulk-etd small.is-amber{color:#b45309}.bulk-etd small.is-red{color:#b91c1c;font-weight:500}
.bulk-upd{font-size:var(--fs-label);white-space:nowrap}
.bulk-act{text-align:right;white-space:nowrap}
.bulk-open-btn{min-width:84px}
.bulk-cards-list{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Step tracker: numbered circles joined by a line; a tick when done; a blue ring that fills for the step in progress. */
.bt{min-width:240px;max-width:420px}
.bt-dots{display:flex;align-items:center}
.bt-dot{flex:none;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:2px solid #cbd5e1;background:#fff;color:#64748b;font-size:11px;font-weight:600;box-sizing:border-box}
.bt-dot.is-done{background:#16a34a;border-color:#16a34a;color:#fff}
.bt-dot.is-doing{border-color:#2563eb;color:#1d4ed8;background:conic-gradient(#bfdbfe var(--p,0%),#fff 0)}
.bt-dot.is-fail{border-color:#dc2626;color:#b91c1c}
.bt-line{flex:1;height:2px;min-width:10px;background:#cbd5e1}
.bt-line.is-done{background:#16a34a}
.bt-labels{display:flex;justify-content:space-between;gap:4px;margin-top:3px;font-size:11px;line-height:1.2;color:var(--fg-secondary)}
.bt-labels span{flex:1;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-labels span:first-child{text-align:left}.bt-labels span:last-child{text-align:right}

/* ---- Bulk Production line: the update window as a timeline --------------------------------------------------------------- */
.bulk-line-sum{display:flex;flex-wrap:wrap;gap:4px 16px;padding:0 0 10px;margin:0 0 10px;border-bottom:1px solid #eef1f5;font-size:var(--fs-label);color:var(--fg-secondary)}
.bulk-line-sum strong{color:#111827;font-weight:500}
.bulk-route{margin:0 0 10px}
.bulk-timeline{position:relative;display:flex;flex-direction:column}
.bulk-tl-step{position:relative;padding:0 0 4px 34px}
.bulk-tl-step::before{content:"";position:absolute;left:10px;top:24px;bottom:0;width:2px;background:#e2e8f0}
.bulk-tl-step:last-child::before{display:none}
.bulk-tl-step>summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:32px;cursor:pointer;padding:2px 0}
.bulk-tl-step>summary::-webkit-details-marker{display:none}
.bulk-tl-step>summary .bt-dot{position:absolute;left:0;top:5px}
.bulk-tl-step>summary:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:6px}
.bulk-tl-title{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;flex:1;min-width:0}
.bulk-tl-name{font-size:var(--fs-heading);font-weight:var(--fw-heading)}
.bulk-tl-title .muted{font-size:var(--fs-label)}
.bulk-tl-more{flex:none;font-size:var(--fs-label);color:#1d4ed8}
.bulk-tl-more::after{content:"▾"}
.bulk-tl-step[open]>summary .bulk-tl-more::after{content:"▴"}
.bulk-tl-body{margin:4px 0 10px;padding:10px 12px;border:1px solid #dbeafe;background:#f8fbff;border-radius:10px}
.bulk-prog-text{display:flex;justify-content:space-between;gap:8px;font-size:var(--fs-field)}
.bulk-prog{height:8px;border-radius:4px;background:#e2e8f0;overflow:hidden;margin:6px 0 4px}
.bulk-prog i{display:block;height:100%;background:#2563eb;transition:width .2s}
.bulk-quick{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin:10px 0 2px}
.bulk-quick .form-group{margin:0;width:150px}
.bulk-quick-gap{flex:1}
.bulk-quick-hint{margin:4px 0 0;font-size:var(--fs-label);color:#15803d}
.bulk-tl-body .bulk-grid{margin-top:10px}
.bulk-tl-body .bulk-chips{margin-top:10px}
/* Save stays in view while the steps scroll (the window's own 18px bottom padding is covered too). */
.bulk-line-actions{position:sticky;bottom:-18px;margin-bottom:-18px !important;padding:10px 0 18px;background:#fff;align-items:center;border-top:1px solid #e5e7eb;z-index:1}
.bulk-line-actions>.muted{margin-right:auto;font-size:var(--fs-label)}
@media (prefers-reduced-motion:reduce){.bulk-prog i{transition:none}}
.bulk-card{border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px;background:#fff;margin:10px 0}
.bulk-card h4{margin:0;font-size:var(--fs-heading);font-weight:var(--fw-heading)}
.bulk-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px}
.bulk-grid .full{grid-column:1/-1}
.bulk-photos{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}
.bulk-photo{position:relative;display:inline-block}
.bulk-photo img{width:56px;height:56px;object-fit:cover;border-radius:6px;border:1px solid #e5e7eb;display:block}
.bulk-photo .link-btn{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:9px;background:#fff;border:1px solid #d1d5db;line-height:14px;padding:0;text-align:center}
.bulk-qc-preview{margin:4px 0}
.bulk-files{margin:4px 0;padding-left:18px}
.bulk-history{margin:8px 0}
.bulk-history ul{margin:6px 0;padding-left:18px;font-size:var(--fs-label)}

/* The Time & Action Plan's Bulk cell: the step the factory is on. */
.cp-bulk-step{display:block;margin-top:2px;font-size:11px;line-height:1.2;color:#1d4ed8;text-decoration:none;white-space:nowrap}

/* ---- Customers and customer files ------------------------------------------------------------------------------------ */
.cust-switches{margin:10px 0;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px;background:#f9fafb}
.cust-sku-bar{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;margin:8px 0;padding:8px 10px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:8px}
.sku-cust-input{width:140px}
.cust-check{margin:8px 0;padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb}
.cust-check.amber{border-color:#fde68a;background:#fffbeb}
.cust-check.red{border-color:#fecaca;background:#fef2f2}
.cust-check ul{margin:4px 0;padding-left:18px;font-size:var(--fs-label)}
.cf-upload{margin:8px 0 12px;padding:10px;border:1px dashed #cbd5e1;border-radius:8px}
.cf-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px}
.cf-grid .full{grid-column:1/-1}
.cf-table td{vertical-align:top}

/* ---- Our details ------------------------------------------------------------------------------------------------------- */
.our-dl{display:grid;grid-template-columns:140px 1fr;gap:6px 12px;margin:8px 0 14px}
.our-dl dt{color:var(--fg-secondary);font-size:var(--fs-label)}
.our-dl dd{margin:0}
.our-details h4{font-size:var(--fs-heading);font-weight:var(--fw-heading);margin:10px 0 4px}
.our-people{margin:0;padding-left:18px}

/* ---- Phones (portrait): these screens' own parts only ------------------------------------------------------------ */
@media (max-width: 700px){
  .bulk-settings-grid,.cf-grid,.bulk-grid{grid-template-columns:1fr}
  .bulk-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .bulk-tile{flex-direction:row;justify-content:space-between;align-items:center;min-height:48px}
  .bulk-search{flex-basis:100%}
  .bulk-table-wrap{display:none}
  .bulk-cards-list{display:flex;flex-direction:column;gap:8px}
  .bulk-po-head{font-size:var(--fs-label);color:var(--fg-secondary);margin:6px 2px 0}
  .bulk-po-head strong{font-size:var(--fs-field);color:#111827}
  .bulk-card-line{border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px;background:#fff}
  .bulk-card-line.is-late{box-shadow:inset 3px 0 0 #dc2626}
  .bulk-card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:8px}
  .bulk-card-line .bt{min-width:0;max-width:none}
  .bulk-card-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px;font-size:var(--fs-label)}
  #content .bulk-card-foot .bulk-open-btn:not(#_){height:40px!important;min-height:40px!important;padding:0 18px!important}
  .bulk-tl-step{padding-left:30px}
  .bulk-quick .form-group{flex:1;width:auto}
  .bulk-quick-gap{display:none}
  .bulk-quick .primary{flex-basis:100%}
  .modal .bulk-quick .primary:not(#_){height:44px!important;min-height:44px!important}
  .bulk-quick .secondary{min-height:var(--ctl-h)}
  .bulk-tl-more::after{content:"▾"}
  .bulk-tl-step[open]>summary .bulk-tl-more::after{content:"▴"}
  .bulk-line-actions{flex-wrap:wrap}
  .bulk-line-actions>.muted{flex-basis:100%}
  .our-dl{grid-template-columns:1fr}
  .sku-cust-input{width:110px}
}

/* ---- Branding: brand logos ---------------------------------------------------------------------------------------- */
.brand-logo-thumb{max-height:36px;max-width:120px;object-fit:contain;display:block}
.brand-logos-table td{vertical-align:middle}
@media (max-width: 700px){
  .brand-logos-table thead{display:none}
  .brand-logos-table,.brand-logos-table tbody,.brand-logos-table tr,.brand-logos-table td{display:block;width:auto}
  .brand-logos-table tr{border:1px solid #e5e7eb;border-radius:10px;margin:0 0 8px;padding:6px 8px}
  .brand-logos-table td{border:0!important;padding:3px 0!important}
  .brand-logos-table td::before{content:attr(data-label);display:block;font-size:var(--fs-label);color:var(--fg-secondary)}
}

/* ---- Datasheet page 2: layouts, crop and adjust, text formatting (approved 16/11/2026) ---- */
.gds-p2-pic{position:relative;overflow:hidden}
.gds-p2-pic.is-fit{background:#fff}
.gds-p2-pic img.gds-p2-placed{position:absolute;max-width:none;max-height:none;height:auto;transform-origin:center center}
.gds-p2-copy ol{margin:0 0 2mm;padding-left:5mm}
.gds-p2-copy ol:last-child{margin-bottom:0}
.gds-p2-slot{border:0}
.gds-p2-edit.gds-p2-slot{outline:1px dashed #94a3b8;background:#f8fafc;display:flex;align-items:center;justify-content:center}
.gds-p2-slot-hint{color:#2563eb;font-size:var(--fs-field);cursor:pointer;padding:2mm 3mm;border-radius:6px;background:#eff6ff}
.gds-p2-edit.is-fixed{cursor:pointer}
.gds-p2-grid{position:absolute;inset:0;pointer-events:none;z-index:0;
  background-image:linear-gradient(to right,rgba(37,99,235,.14) 1px,transparent 1px),linear-gradient(to bottom,rgba(37,99,235,.14) 1px,transparent 1px);
  background-size:calc(100% / var(--grid,12)) calc(100% / var(--grid,12))}
@media print{.gds-p2-grid,.gds-p2-slot-hint{display:none!important}}
.ds-p2-layouts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:8px}
.ds-p2-layout{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px;border:1px solid var(--line,#e5e7eb);border-radius:8px;background:#fff;font-size:var(--fs-label);color:inherit;cursor:pointer;min-height:var(--ctl-h)}
.ds-p2-layout.is-on{border-color:#2563eb;box-shadow:0 0 0 1px #2563eb;background:#eff6ff}
.ds-p2-layout:disabled{cursor:default;opacity:.7}
.ds-p2-thumb{position:relative;display:block;width:44px;height:52px;border:1px solid #cbd5e1;background:#fff;border-radius:2px}
.ds-p2-thumb i{position:absolute;box-sizing:border-box;border:1px solid #fff;background:#94a3b8}
.ds-p2-thumb i.is-text{background:repeating-linear-gradient(to bottom,#cbd5e1 0 2px,#fff 2px 4px)}
.ds-p2-gridtick{margin-bottom:6px}
.ds-p2-fmtbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.ds-fmt{height:28px;min-width:28px;padding:0 7px;border:1px solid var(--line,#e5e7eb);border-radius:6px;background:#fff;font-size:var(--fs-field);color:inherit;cursor:pointer}
.ds-fmt.is-on{background:#eff6ff;border-color:#2563eb;color:#1d4ed8}
.ds-fmt-gap{width:6px}
.ds-p2-fmtbar select{height:28px!important;min-height:28px!important;width:auto}
.ds-fmt-colour{display:inline-flex;align-items:center;gap:4px}
.ds-fmt-colour input[type=color]{width:32px;height:28px!important;min-height:28px!important;padding:2px!important}
.ds-p2-q{font-size:var(--fs-label);padding:1px 6px;border-radius:10px;margin-left:auto}
.ds-p2-q.is-good{background:#f0fdf4;color:#166534}
.ds-p2-q.is-fair{background:#fffbeb;color:#92400e}
.ds-p2-q.is-low{background:#fef2f2;color:#991b1b}
.ds-p2-pic-btns{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.ds-p2-nopic{display:flex;align-items:center;justify-content:center;width:72px;height:56px;border:1px dashed #cbd5e1;border-radius:6px;color:var(--fg-secondary);font-size:var(--fs-label);text-align:center;flex:0 0 auto}
.ds-p2-fit.is-warn{background:#fffbeb;color:#92400e}
.ds-crop-modal{max-width:640px}
.ds-crop-stage{display:flex;justify-content:center;background:#e2e8f0;padding:12px;border-radius:8px}
.ds-crop-frame{position:relative;overflow:hidden;background:#fff;width:min(100%,520px);max-height:55vh;cursor:grab;touch-action:none;box-shadow:0 0 0 1px #94a3b8}
.ds-crop-frame:active{cursor:grabbing}
.ds-crop-frame img{position:absolute;max-width:none;max-height:none;height:auto;transform-origin:center center;user-select:none;pointer-events:none}
.ds-crop-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.ds-crop-zoom{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-label);color:var(--fg-secondary)}
.ds-crop-info{font-size:var(--fs-label);margin:8px 0 0;padding:6px 8px;border-radius:6px}
.ds-crop-info.is-good{background:#f0fdf4;color:#166534}
.ds-crop-info.is-fair{background:#fffbeb;color:#92400e}
.ds-crop-info.is-low{background:#fef2f2;color:#991b1b}
.ds-crop-info:empty{display:none}
@media (max-width:700px){
  .ds-p2-layouts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ds-crop-frame{max-height:45vh}
  .ds-crop-tools .ds-crop-zoom{flex:1 1 100%}
  .ds-crop-tools .ds-crop-zoom input{flex:1}
}
.ds-crop-chips{display:flex;gap:6px;flex-wrap:wrap}
.ds-crop-chips .chip{border:1px solid var(--line,#e5e7eb);border-radius:14px;background:#fff;padding:0 10px;font-size:var(--fs-field);cursor:pointer}.ds-crop-chips .chip.is-on{background:#eff6ff;border-color:#2563eb;color:#1d4ed8}
.ds-crop-chips .chip{height:var(--chip-h)}
.gds-p2-copy[style*="text-align:center"] ul,.gds-p2-copy[style*="text-align:center"] ol,.gds-p2-copy[style*="text-align:right"] ul,.gds-p2-copy[style*="text-align:right"] ol{list-style-position:inside;padding-left:0}
