/* Additions on top of the Sharp design system (styles.css). Kept minimal. */
:root{--info:#4338ca;--info-bg:#eef2ff;--info-line:#c7d2fe;--soft-line:#cbd5e1;}
.b-info{background:var(--info-bg);color:var(--info)}
.spinner{width:18px;height:18px;border:2px solid var(--soft-line);border-top-color:var(--navy);border-radius:50%;animation:spin .6s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}
.view-loading{display:flex;align-items:center;justify-content:center;gap:10px;padding:48px;color:var(--muted)}
.side-foot .btn{width:100%;justify-content:center}

/* Brand logo — the wide Sharp logo replaces the text wordmark. */
.logo img{height:30px;width:auto;display:block}
.login-logo{max-width:200px;height:auto;display:block;margin:0 auto 22px}

/* Group-based supplier routing (pick a supplier, click its hotels) */
.rt-intro{color:var(--muted);font-size:13px;margin:0 0 14px}
.rt-group{border:1px solid var(--line);border-radius:2px;padding:16px;margin-bottom:14px;background:#fafafa}
.rt-group-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.rt-group-head strong{font-size:12px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:var(--navy)}
.rt-group-btns{display:flex;gap:6px;flex-wrap:wrap}
.rt-sup-row{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.rt-sup-row label{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--muted)}
.rt-sup-sel{max-width:320px}
.rt-chip-label{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.rt-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.rt-chip{display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:1px solid var(--line);background:#fff;border-radius:2px;padding:5px 9px;cursor:pointer;font-family:inherit;transition:border-color .12s,background .12s}
.rt-chip:hover{border-color:var(--navy)}
.rt-chip-code{font-size:12px;font-weight:800;color:var(--navy);line-height:1.15}
.rt-chip-name{font-size:10px;color:var(--muted);line-height:1.15;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rt-chip.on{background:var(--navy);border-color:var(--navy)}
.rt-chip.on .rt-chip-code{color:#fff}
.rt-chip.on .rt-chip-name{color:rgba(255,255,255,.72)}
.rt-chip.elsewhere{opacity:.45}
.rt-chip.elsewhere .rt-chip-code::after{content:' •';color:var(--red,#df1626)}
.rt-count{font-size:12px;font-style:italic;color:var(--muted)}
.rt-unassigned{font-size:12px;color:var(--muted);line-height:1.6;margin:12px 0 18px}
.rt-unassigned strong{color:var(--navy)}
.rt-actions{display:flex;gap:10px;align-items:center}

/* Review variance: highlight lines ordered more/less than last time */
tr.row-over > td{background:#fdecec}
tr.row-under > td{background:#fff7e8}
.rv-flag{font-size:11px;font-weight:700;color:var(--muted)}
tr.row-over .rv-flag{color:var(--bad,#df1626)}
tr.row-under .rv-flag{color:#9a6a00}

/* Phase 4 order-ref workflow refinements */
.meta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.mini{border:1px solid var(--line);background:var(--soft);border-radius:2px;padding:10px;min-width:0}
.mini span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.5px;font-weight:800;color:var(--muted);margin-bottom:4px}
.mini strong{display:block;color:var(--navy);font-size:13px;word-break:break-word}
.order-review-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}
.order-review-table table{min-width:1080px}
.section-title-small{font-size:14px;color:var(--navy);margin:16px 0 8px;font-weight:800}
.order-history{border:1px solid var(--line);border-radius:2px;overflow:hidden;background:#fff}
.order-event{display:grid;grid-template-columns:210px 1fr;gap:10px;padding:9px 11px;border-bottom:1px solid var(--line);font-size:12px}
.order-event:last-child{border-bottom:0}
.order-event strong{color:var(--navy);text-transform:capitalize}
.order-event span{color:var(--muted)}
.file-list{border:1px solid var(--line);border-radius:2px;overflow:hidden;background:#fff}
.file-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 11px;border-bottom:1px solid var(--line);font-size:12px}
.file-row:last-child{border-bottom:0}
.file-row strong{color:var(--navy)}
.file-row span{color:var(--muted)}
@media(max-width:900px){.meta-grid{grid-template-columns:1fr 1fr}.order-review-top{display:block}.order-event{grid-template-columns:1fr}}
@media(max-width:620px){.meta-grid{grid-template-columns:1fr}}

/* Phase 4 v3: clearer dashboard and order review UX */
.review-lines{display:flex;flex-direction:column;gap:10px;max-height:460px;overflow:auto;margin-top:12px;padding-right:4px}
.review-line{border:1px solid var(--line);border-radius:2px;background:#fff;padding:12px;display:grid;grid-template-columns:minmax(220px,1.1fr) minmax(360px,1.4fr) minmax(420px,1.6fr);gap:14px;align-items:start}
.review-line.row-over{border-left:4px solid var(--bad);background:#fffafa}
.review-line.row-under{border-left:4px solid var(--warn);background:#fffdf7}
.review-product strong{display:inline-flex;min-width:58px;color:var(--navy);font-weight:800;font-size:13px;margin-bottom:6px}
.review-product span{display:block;font-weight:700;color:var(--text);line-height:1.35}
.review-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.review-metrics div,.review-result{border:1px solid var(--line);background:var(--soft);border-radius:2px;padding:8px;min-height:58px}
.review-metrics small,.review-result small{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:800;margin-bottom:4px}
.review-metrics b,.review-result b{display:block;color:var(--navy);font-size:12px;line-height:1.3;word-break:break-word}
.review-controls{display:grid;grid-template-columns:92px 92px minmax(130px,.8fr) minmax(180px,1fr);gap:8px;align-items:end}
.review-controls .ff{margin-top:0}
.review-controls .ff label{font-size:9px}
.review-controls input.fi{min-height:38px}
@media(max-width:1280px){.review-line{grid-template-columns:1fr}.review-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.review-controls .ff:last-child{grid-column:1/-1}}
@media(max-width:700px){.review-metrics{grid-template-columns:repeat(2,1fr)}.review-controls{grid-template-columns:1fr}}

/* Phase 4 v4: review is centred on previous-order variance + copyable CTL message */
.variance-review-box{border:1px solid var(--line);border-left:4px solid var(--navy);background:#fff;margin:12px 0 16px;padding:14px;border-radius:2px}
.variance-review-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:10px}
.variance-review-head h3{font-size:16px;margin:0 0 4px;color:var(--navy)}
.variance-review-head p{margin:0;color:var(--muted);font-size:13px;line-height:1.4}
.variance-stats{display:flex;gap:8px;flex-wrap:wrap}
.variance-stats div{min-width:72px;border:1px solid var(--line);background:var(--soft);padding:8px;text-align:center}
.variance-stats b{display:block;font-size:20px;color:var(--navy);line-height:1}
.variance-stats span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:800;margin-top:4px}
.variance-alert,.variance-ok{display:flex;gap:10px;align-items:center;border-radius:2px;padding:10px 12px;margin:10px 0 12px;font-size:13px}
.variance-alert{background:#fff1f2;border:1px solid #fecdd3;color:#991b1b}
.variance-ok{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534}
.variance-alert strong,.variance-ok strong{font-weight:800}
.variance-actions{display:flex;justify-content:flex-end;margin-top:8px}
.variance-review-box textarea.fi{font-size:13px;line-height:1.45;min-height:118px;background:#fff}
.review-v4-lines{display:flex;flex-direction:column;gap:10px;max-height:420px;overflow:auto;margin-top:12px;padding-right:4px}
.review-v4-card{border:1px solid var(--line);border-radius:2px;background:#fff;padding:12px;display:grid;grid-template-columns:minmax(220px,1fr) minmax(420px,1.35fr) minmax(360px,1.1fr);gap:14px;align-items:start}
.review-v4-card.is-over{border-left:4px solid var(--bad);background:#fffafa}
.review-v4-card.is-under{border-left:4px solid var(--warn);background:#fffdf7}
.review-v4-card.is-new{border-left:4px solid var(--info);background:#fafbff}
.review-v4-code{font-size:13px;font-weight:800;color:var(--navy);margin-bottom:6px}
.review-v4-product strong{display:block;font-size:14px;line-height:1.35;color:var(--text);margin-bottom:8px}
.variance-pill{display:inline-flex;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800;line-height:1.2}
.variance-pill.is-over{background:#fee2e2;color:#991b1b}
.variance-pill.is-under{background:#fef3c7;color:#92400e}
.variance-pill.is-same{background:#dcfce7;color:#166534}
.variance-pill.is-new{background:#e0e7ff;color:#3730a3}
.review-v4-numbers{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.review-v4-numbers .metric{border:1px solid var(--line);background:var(--soft);padding:8px;min-height:64px}
.review-v4-numbers .strong-metric{background:#fff;border-color:#bfdbfe}
.review-v4-numbers small{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:800;margin-bottom:4px}
.review-v4-numbers b{display:block;color:var(--navy);font-size:13px;line-height:1.3;word-break:break-word}
.review-v4-actions{display:grid;grid-template-columns:105px 105px minmax(130px,1fr);gap:8px;align-items:start}
.review-v4-actions .ff{margin-top:0}
.review-v4-actions .ff label{font-size:9px}
.review-v4-actions input.fi{min-height:38px}
.review-v4-actions .hint{font-size:10px;margin-top:4px}
@media(max-width:1180px){.review-v4-card{grid-template-columns:1fr}.review-v4-numbers{grid-template-columns:repeat(3,minmax(0,1fr))}.review-v4-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.review-v4-actions .ff:last-child{grid-column:1/-1}}
@media(max-width:760px){.variance-review-head{display:block}.variance-stats{margin-top:10px}.review-v4-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}.review-v4-actions{grid-template-columns:1fr}}

/* Phase 4 v5: compact procurement review for 50+ product lines */
.rv5-review{display:flex;flex-direction:column;gap:12px}
.rv5-meta{margin-bottom:0}
.rv5-meta .mini{padding:8px 10px}
.rv5-summary{display:flex;align-items:stretch;justify-content:space-between;gap:14px;border:1px solid var(--line);border-left:4px solid var(--navy);background:#fff;padding:11px 12px;border-radius:2px}
.rv5-summary-main h3,.rv5-message-head h3{margin:0 0 3px;color:var(--navy);font-size:15px;font-weight:800}
.rv5-summary-main p,.rv5-message-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.35}
.rv5-stats{display:grid;grid-template-columns:repeat(4,72px);gap:7px;align-items:stretch;flex-shrink:0}
.rv5-stat{border:1px solid var(--line);background:var(--soft);padding:6px 7px;text-align:center;border-radius:2px}
.rv5-stat b{display:block;font-size:18px;line-height:1;color:var(--navy)}
.rv5-stat span{display:block;margin-top:3px;font-size:9px;text-transform:uppercase;letter-spacing:.5px;font-weight:900;color:var(--muted)}
.rv5-stat.over{background:#fff1f2;border-color:#fecdd3}.rv5-stat.over b{color:#991b1b}
.rv5-stat.under{background:#ecfdf5;border-color:#bbf7d0}.rv5-stat.under b{color:#166534}
.rv5-stat.new{background:#eef2ff;border-color:#c7d2fe}.rv5-stat.new b{color:#3730a3}
.rv5-query-strip{display:flex;align-items:center;gap:8px;font-size:12px;border-radius:2px;padding:8px 10px;margin-top:-2px}
.rv5-query-strip.bad{background:#fff1f2;border:1px solid #fecdd3;color:#991b1b}
.rv5-query-strip.ok{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534}
.rv5-query-strip strong{font-weight:900}
.rv5-review .ff{margin-top:0}
.rv5-review textarea.fi{min-height:70px;font-size:13px;line-height:1.4}
.rv5-table-wrap{border:1px solid var(--line);border-radius:2px;background:#fff;max-height:430px;overflow:auto}
.rv5-table{width:100%;min-width:1220px;border-collapse:separate;border-spacing:0}
.rv5-table thead th{position:sticky;top:0;z-index:1;background:var(--navy);color:#fff;font-size:11px;letter-spacing:.35px;text-transform:uppercase;padding:9px 9px;white-space:nowrap}
.rv5-table td{padding:7px 9px;border-bottom:1px solid var(--line);vertical-align:middle;font-size:13px;background:#fff}
.rv5-table tbody tr:hover td{background:#f8fafc}
.rv5-table tr.rv5-over td{background:#fffafa}
.rv5-table tr.rv5-under td{background:#f8fff9}
.rv5-table tr.rv5-new td{background:#fafbff}
.rv5-table tr.rv5-over:hover td{background:#fff1f2}
.rv5-table tr.rv5-under:hover td{background:#ecfdf5}
.rv5-table tr.rv5-new:hover td{background:#eef2ff}
.rv5-code{font-weight:900;color:var(--navy);width:58px;white-space:nowrap}
.rv5-product{min-width:260px;max-width:360px}.rv5-product strong{font-size:13px;line-height:1.25;color:var(--text)}
.rv5-requested{font-weight:900;color:var(--navy)}
.rv5-input input.fi{width:82px;min-height:34px;padding:6px 8px;font-size:13px}
.rv5-comment input.fi{width:170px;min-height:34px;padding:6px 8px;font-size:13px}
.rv5-diff{display:inline-flex;align-items:center;justify-content:center;min-width:52px;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:900;white-space:nowrap}
.rv5-diff-over{background:#fee2e2;color:#991b1b}.rv5-diff-under{background:#dcfce7;color:#166534}.rv5-diff-new{background:#e0e7ff;color:#3730a3}.rv5-diff-same{background:#f1f5f9;color:#334155}.rv5-diff-baseline{background:#f8fafc;color:#64748b}
.rv5-issue{display:inline-flex;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;white-space:nowrap;background:#f1f5f9;color:#334155}
.rv5-issue-over{background:#fee2e2;color:#991b1b}.rv5-issue-under{background:#dcfce7;color:#166534}.rv5-issue-new{background:#e0e7ff;color:#3730a3}.rv5-issue-baseline{background:#f8fafc;color:#64748b}
.rv5-message-panel{border:1px solid var(--line);border-left:4px solid var(--red);background:#fff;margin-top:2px;padding:12px;border-radius:2px}
.rv5-message-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}
.rv5-message-panel textarea.fi{width:100%;min-height:110px;background:#fff;font-size:13px;line-height:1.45}
.rv5-review .order-history{margin-bottom:2px}
@media(max-width:1150px){.rv5-summary{display:block}.rv5-stats{margin-top:10px;grid-template-columns:repeat(4,minmax(0,1fr))}.rv5-message-head{display:block}.rv5-message-head .btn{margin-top:8px}}

/* Phase 4 v6: fix procurement review table layout. The global .ta-r class is flex-based,
   so table numeric cells must override it or values stack vertically. */
.rv5-table-wrap{
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}
.rv5-table{
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}
.rv5-table th,
.rv5-table td{
  box-sizing: border-box;
}
.rv5-table th:nth-child(1), .rv5-table td:nth-child(1){width:64px;}
.rv5-table th:nth-child(2), .rv5-table td:nth-child(2){width:290px;}
.rv5-table th:nth-child(3), .rv5-table td:nth-child(3),
.rv5-table th:nth-child(4), .rv5-table td:nth-child(4),
.rv5-table th:nth-child(5), .rv5-table td:nth-child(5),
.rv5-table th:nth-child(6), .rv5-table td:nth-child(6),
.rv5-table th:nth-child(7), .rv5-table td:nth-child(7){width:86px;}
.rv5-table th:nth-child(8), .rv5-table td:nth-child(8),
.rv5-table th:nth-child(9), .rv5-table td:nth-child(9){width:96px;}
.rv5-table th:nth-child(10), .rv5-table td:nth-child(10){width:145px;}
.rv5-table th:nth-child(11), .rv5-table td:nth-child(11){width:170px;}
.rv5-table td.ta-r{
  display: table-cell !important;
  min-width: 0 !important;
  text-align: right !important;
  white-space: nowrap;
}
.rv5-table td{
  padding: 7px 8px;
  line-height: 1.25;
}
.rv5-product{
  min-width: 0 !important;
  max-width: none !important;
}
.rv5-product strong{
  display:block;
  white-space: normal;
  overflow-wrap: anywhere;
}
.rv5-input input.fi,
.rv5-comment input.fi{
  width: 100% !important;
  min-height: 32px;
  padding: 5px 7px;
}
.rv5-diff,.rv5-issue{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
.rv5-message-panel{
  margin-top: 0;
}
.rv5-message-panel textarea.fi{
  min-height: 82px;
  max-height: 150px;
}
.rv5-review textarea.fi{
  min-height: 54px;
}
@media(max-width: 1280px){
  .rv5-table{min-width: 1180px;}
}

/* Phase 4 v7: remove first-order inconsistency and use a simpler table when there is no previous baseline. */
.rv7-baseline-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border:1px solid #cbd5e1;
  border-left:4px solid var(--navy);
  background:#f8fafc;
  padding:12px 14px;
  border-radius:2px;
}
.rv7-baseline-summary h3{margin:0;font-size:15px;color:var(--navy);font-weight:900}
.rv7-baseline-summary p{margin:3px 0 0;color:var(--muted);font-size:13px;line-height:1.35}
.rv7-baseline-pill{
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  border:1px solid #cbd5e1;
  background:#fff;
  color:var(--navy);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.4px;
  padding:6px 9px;
  border-radius:999px;
}
.rv5-table.rv7-baseline-table th:nth-child(1), .rv5-table.rv7-baseline-table td:nth-child(1){width:64px;}
.rv5-table.rv7-baseline-table th:nth-child(2), .rv5-table.rv7-baseline-table td:nth-child(2){width:360px;}
.rv5-table.rv7-baseline-table th:nth-child(3), .rv5-table.rv7-baseline-table td:nth-child(3),
.rv5-table.rv7-baseline-table th:nth-child(4), .rv5-table.rv7-baseline-table td:nth-child(4),
.rv5-table.rv7-baseline-table th:nth-child(5), .rv5-table.rv7-baseline-table td:nth-child(5){width:100px;}
.rv5-table.rv7-baseline-table th:nth-child(6), .rv5-table.rv7-baseline-table td:nth-child(6),
.rv5-table.rv7-baseline-table th:nth-child(7), .rv5-table.rv7-baseline-table td:nth-child(7){width:110px;}
.rv5-table.rv7-baseline-table th:nth-child(8), .rv5-table.rv7-baseline-table td:nth-child(8){width:220px;}
.rv5-table tr.rv5-baseline td{background:#fff;}
.rv5-table tr.rv5-baseline:hover td{background:#f8fafc;}
@media(max-width:1150px){
  .rv7-baseline-summary{display:block}
  .rv7-baseline-pill{margin-top:10px}
  .rv5-table.rv7-baseline-table{min-width:980px;}
}


/* Phase 4 v8: align review table headings and values. Numeric headers and values are centred in the same column so the approval comparison is easy to scan. */
.rv5-table th,
.rv5-table td{
  vertical-align: middle;
}
.rv5-table th:nth-child(3), .rv5-table td:nth-child(3),
.rv5-table th:nth-child(4), .rv5-table td:nth-child(4),
.rv5-table th:nth-child(5), .rv5-table td:nth-child(5),
.rv5-table th:nth-child(6), .rv5-table td:nth-child(6),
.rv5-table th:nth-child(7), .rv5-table td:nth-child(7),
.rv5-table th:nth-child(8), .rv5-table td:nth-child(8),
.rv5-table th:nth-child(9), .rv5-table td:nth-child(9),
.rv5-table th:nth-child(10), .rv5-table td:nth-child(10){
  text-align: center !important;
}
.rv5-table td.ta-r{
  text-align: center !important;
}
.rv5-table .rv5-input input.fi{
  text-align: center;
}
.rv5-table th:nth-child(1), .rv5-table td:nth-child(1){width:58px;}
.rv5-table th:nth-child(2), .rv5-table td:nth-child(2){width:300px;}
.rv5-table th:nth-child(3), .rv5-table td:nth-child(3),
.rv5-table th:nth-child(4), .rv5-table td:nth-child(4),
.rv5-table th:nth-child(5), .rv5-table td:nth-child(5),
.rv5-table th:nth-child(6), .rv5-table td:nth-child(6),
.rv5-table th:nth-child(7), .rv5-table td:nth-child(7){width:82px;}
.rv5-table th:nth-child(8), .rv5-table td:nth-child(8),
.rv5-table th:nth-child(9), .rv5-table td:nth-child(9){width:104px;}
.rv5-table th:nth-child(10), .rv5-table td:nth-child(10){width:130px;}
.rv5-table th:nth-child(11), .rv5-table td:nth-child(11){width:180px;}

/* Phase 4 v11: operational batch stages and actions. Avoid ambiguous "Open" wording. */
.batch-list table{min-width:1120px;}
.batch-list th:last-child,.batch-list td:last-child{width:250px;}
.batch-stage-hint{margin-top:4px;font-size:11px;line-height:1.25;color:var(--muted);max-width:260px;}
.batch-actions{display:flex;gap:7px;align-items:center;justify-content:flex-start;flex-wrap:wrap;}
.batch-actions .btn.sm{min-height:32px;white-space:nowrap;}
.batch-detail-top-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.batch-stage-panel{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:-2px 0 12px;padding:12px 14px;border:1px solid var(--line);border-left:4px solid var(--navy);background:#fff;border-radius:2px;}
.batch-stage-panel strong{display:block;font-size:14px;color:var(--navy);font-weight:900;margin-bottom:3px;}
.batch-stage-panel p{margin:0;color:var(--muted);font-size:12px;line-height:1.35;}
.batch-detail-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.batch-detail-actions .btn.sm{min-height:34px;white-space:nowrap;}
.batch-status-preview{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;}
.batch-status-preview div{border:1px solid var(--line);background:var(--soft);padding:10px;border-radius:2px;}
.batch-status-preview span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.45px;font-weight:900;color:var(--muted);margin-bottom:5px;}
.batch-status-preview strong{color:var(--navy);font-size:14px;}
@media(max-width:900px){
  .batch-stage-panel{display:block;}
  .batch-detail-actions{justify-content:flex-start;margin-top:10px;}
  .batch-detail-top-actions{justify-content:flex-start;}
  .batch-status-preview{grid-template-columns:1fr;}
}
.btn.danger{background:var(--red);color:#fff;border-color:var(--red);}

/* Phase 4 v16: supplier sheet matrix must be a real compact spreadsheet.
   Do not use global .ta-r in supplier cells because .ta-r is flex-based and
   makes values stack/expand. */
.supplier-matrix-wrap{
  overflow:auto;
  max-width:100%;
  border-top:1px solid var(--line);
  background:#fff;
}
.supplier-matrix-table{
  width:max-content;
  min-width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
}
.supplier-matrix-table th,
.supplier-matrix-table td{
  display:table-cell!important;
  border-bottom:1px solid var(--line);
  border-right:1px solid #eef2f7;
  padding:9px 10px;
  vertical-align:middle;
  line-height:1.25;
  white-space:nowrap;
}
.supplier-matrix-table th:last-child,
.supplier-matrix-table td:last-child{border-right:0}
.supplier-matrix-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:var(--navy);
  color:#fff;
  text-align:center;
}
.supplier-matrix-table .sm-code{min-width:72px;text-align:left;font-weight:800;color:var(--navy)}
.supplier-matrix-table th.sm-code{color:#fff;text-align:left}
.supplier-matrix-table .sm-product{min-width:260px;max-width:340px;white-space:normal;text-align:left;font-weight:700;color:var(--text)}
.supplier-matrix-table th.sm-product{color:#fff;text-align:left}
.supplier-matrix-table .sm-total{min-width:72px;text-align:center;font-weight:900;background:#f8fafc;color:var(--navy)}
.supplier-matrix-table th.sm-total{background:var(--navy);color:#fff;text-align:center}
.supplier-matrix-table .sm-site{min-width:64px;text-align:center;font-weight:700;color:var(--text)}
.supplier-matrix-table tbody tr:nth-child(even) td{background:#fbfdff}
.supplier-matrix-table tbody tr:hover td{background:#eef6ff}
.supplier-matrix-table tbody tr:hover .sm-total{background:#e8f1fb}
@media(max-width:800px){
  .supplier-matrix-table .sm-product{min-width:220px;max-width:260px}
  .supplier-matrix-table .sm-site{min-width:56px}
}

/* Phase 4 v17: supplier sheet visual polish.
   Keep the supplier matrix readable like a spreadsheet: lighter site headers,
   clear total column, fixed first columns, and no dark-on-dark header issue. */
.supplier-sheet-panel{
  border:1px solid #d9e2ee!important;
  box-shadow:none!important;
  background:#fff;
}
.supplier-sheet-panel .ph{
  padding:14px 18px!important;
  border-bottom:1px solid #e7edf5!important;
  background:#fff!important;
}
.supplier-sheet-panel .ph h2{margin:0 0 4px!important;color:#17324d!important;}
.supplier-sheet-panel .ph p{margin:0!important;color:#5d6f86!important;}
.supplier-matrix-wrap{
  border-top:0!important;
  border-radius:0 0 4px 4px;
  background:#fff;
  overflow:auto;
}
.supplier-matrix-table{
  font-size:13px;
  border-collapse:separate!important;
  border-spacing:0!important;
}
.supplier-matrix-table th,
.supplier-matrix-table td{
  border-right:1px solid #e4eaf2!important;
  border-bottom:1px solid #e6ebf2!important;
  padding:10px 12px!important;
  height:42px;
  box-sizing:border-box;
}
.supplier-matrix-table th{
  top:0;
  font-size:11px;
  line-height:1.1;
  text-transform:uppercase;
  letter-spacing:.25px;
  box-shadow:inset 0 -1px 0 #ccd7e4;
}
.supplier-matrix-table th.sm-code,
.supplier-matrix-table th.sm-product,
.supplier-matrix-table th.sm-total{
  background:#24425f!important;
  color:#fff!important;
}
.supplier-matrix-table th.sm-site{
  background:#f3f7fb!important;
  color:#17324d!important;
  font-weight:900!important;
  border-bottom:2px solid #cbd7e6!important;
}
.supplier-matrix-table td.sm-code,
.supplier-matrix-table td.sm-product,
.supplier-matrix-table td.sm-total{
  background:#fff!important;
}
.supplier-matrix-table .sm-code{
  width:76px!important;
  min-width:76px!important;
  max-width:76px!important;
  text-align:left!important;
  color:#17324d!important;
}
.supplier-matrix-table .sm-product{
  width:330px!important;
  min-width:330px!important;
  max-width:330px!important;
  white-space:normal!important;
  text-align:left!important;
  color:#111827!important;
}
.supplier-matrix-table .sm-total{
  width:88px!important;
  min-width:88px!important;
  max-width:88px!important;
  text-align:center!important;
  background:#eef5ff!important;
  color:#17324d!important;
  font-weight:900!important;
}
.supplier-matrix-table td.sm-site{
  min-width:64px!important;
  text-align:center!important;
  font-weight:800!important;
  color:#0f172a!important;
  background:#fff!important;
}
.supplier-matrix-table tbody tr:nth-child(even) td.sm-site{background:#fbfdff!important;}
.supplier-matrix-table tbody tr:nth-child(even) td.sm-code,
.supplier-matrix-table tbody tr:nth-child(even) td.sm-product{background:#fbfdff!important;}
.supplier-matrix-table tbody tr:nth-child(even) td.sm-total{background:#eaf3ff!important;}
.supplier-matrix-table tbody tr:hover td{background:#edf6ff!important;}
.supplier-matrix-table tbody tr:hover td.sm-total{background:#ddecff!important;}
.supplier-matrix-table th.sm-code,
.supplier-matrix-table td.sm-code{
  position:sticky;
  left:0;
  z-index:4;
}
.supplier-matrix-table th.sm-product,
.supplier-matrix-table td.sm-product{
  position:sticky;
  left:76px;
  z-index:4;
}
.supplier-matrix-table th.sm-total,
.supplier-matrix-table td.sm-total{
  position:sticky;
  left:406px;
  z-index:4;
  box-shadow:2px 0 0 rgba(217,226,238,.8);
}
.supplier-matrix-table th.sm-code,
.supplier-matrix-table th.sm-product,
.supplier-matrix-table th.sm-total{z-index:7;}
@media(max-width:900px){
  .supplier-matrix-table .sm-product{width:260px!important;min-width:260px!important;max-width:260px!important;}
  .supplier-matrix-table th.sm-total,.supplier-matrix-table td.sm-total{left:336px;}
  .supplier-matrix-table td.sm-site{min-width:58px!important;}
}

/* Phase 4 v18: Professional supplier sheet headers and Excel export alignment. */
.supplier-sheet-panel .ph{align-items:center!important;gap:14px!important;}
.supplier-sheet-panel .ph .btn{white-space:nowrap;}
.supplier-matrix-table th.sm-site{
  min-width:128px!important;
  max-width:150px!important;
  padding:8px 10px!important;
  text-transform:none!important;
  letter-spacing:0!important;
  line-height:1.15!important;
}
.supplier-matrix-table .sm-site-code{
  display:block;
  font-size:13px;
  font-weight:900;
  color:#17324d;
}
.supplier-matrix-table .sm-site-name{
  display:block;
  margin-top:3px;
  font-size:10px;
  line-height:1.1;
  font-weight:700;
  color:#64748b;
  max-width:128px;
  white-space:normal;
}
.supplier-matrix-table td.sm-site{
  min-width:128px!important;
  max-width:150px!important;
  font-size:14px!important;
}
.supplier-matrix-table th.sm-total,
.supplier-matrix-table td.sm-total{
  border-left:2px solid #cbd7e6!important;
  border-right:2px solid #cbd7e6!important;
}
@media(max-width:900px){
  .supplier-matrix-table th.sm-site,
  .supplier-matrix-table td.sm-site{min-width:112px!important;max-width:126px!important;}
  .supplier-matrix-table .sm-site-name{max-width:108px;}
}

/* v20: Delivery issue visibility + claim table fixes */
.claim-count-cell{display:inline-flex;align-items:center;gap:8px;border-radius:8px;padding:5px 8px;border:1px solid #d9e2ee;background:#f8fafc;line-height:1.1;white-space:nowrap}
.claim-count-cell strong{font-size:14px;color:#17324d}
.claim-count-cell span{font-size:11px;color:#5f718a}
.claim-count-cell.open{border-color:#f2c0bd;background:#fff4f3}
.claim-count-cell.open strong{color:#9b1c18}
.claim-count-cell.done{border-color:#b9e5c9;background:#f0fbf4}
.claim-count-cell.done strong{color:#176b37}
.claim-items-table{width:100%;border-collapse:collapse;table-layout:fixed}
.claim-items-table th,.claim-items-table td{display:table-cell!important;padding:10px 12px!important;border-bottom:1px solid #e3e9f2;vertical-align:middle;text-align:left;white-space:normal!important}
.claim-items-table th{background:#24445f;color:#fff;text-transform:uppercase;font-size:12px;letter-spacing:.03em}
.claim-items-table td.num{text-align:right!important;font-variant-numeric:tabular-nums;display:table-cell!important;min-width:auto!important}
.claim-items-table th:nth-child(1),.claim-items-table td:nth-child(1){width:80px}
.claim-items-table th:nth-child(3),.claim-items-table td:nth-child(3),.claim-items-table th:nth-child(4),.claim-items-table td:nth-child(4){width:110px;text-align:right}
.claim-items-table th:nth-child(5),.claim-items-table td:nth-child(5){width:130px}
.claim-items-table th:nth-child(6),.claim-items-table td:nth-child(6){width:180px}
td.action-cell{display:table-cell!important;text-align:right!important;min-width:120px!important}
.batch-list td:last-child{min-width:185px!important;width:185px!important}
.batch-list .batch-action-list{max-width:170px;background:#fff;border:0;padding:0}
.batch-list .batch-action-list .btn{width:100%;justify-content:center;margin:0 0 8px 0}
.muted-small{font-size:12px;color:#718096}

/* v32: order review supplier override + cleaner 12-column layout */
.rv5-table{min-width:1460px;}
.rv5-table th:nth-child(1), .rv5-table td:nth-child(1){width:58px;}
.rv5-table th:nth-child(2), .rv5-table td:nth-child(2){width:280px;}
.rv5-table th:nth-child(3), .rv5-table td:nth-child(3),
.rv5-table th:nth-child(4), .rv5-table td:nth-child(4),
.rv5-table th:nth-child(5), .rv5-table td:nth-child(5),
.rv5-table th:nth-child(6), .rv5-table td:nth-child(6),
.rv5-table th:nth-child(7), .rv5-table td:nth-child(7){width:78px;text-align:center!important;}
.rv5-table th:nth-child(8), .rv5-table td:nth-child(8){width:170px;text-align:left!important;}
.rv5-table th:nth-child(9), .rv5-table td:nth-child(9),
.rv5-table th:nth-child(10), .rv5-table td:nth-child(10){width:100px;text-align:center!important;}
.rv5-table th:nth-child(11), .rv5-table td:nth-child(11){width:130px;text-align:center!important;}
.rv5-table th:nth-child(12), .rv5-table td:nth-child(12){width:180px;}
.rv5-supplier-cell select.fi,
.rv5-supplier-select{width:100%;min-height:34px;padding:6px 8px;font-size:12px;background:#fff;}
.rv5-table .rv5-supplier-cell{background:#fbfdff;}

/* v32: product form uses controlled category/code fields */
#productDetails input[readonly].fi{background:#f8fafc;color:var(--navy);font-weight:700;}
#productDetails select.fi{background:#fff;}

/* v33: procurement-controlled order batch correction */
.order-batch-move{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  margin:10px 0 14px;
  border:1px solid #cbd7e6;
  border-left:4px solid #24445f;
  border-radius:4px;
  background:#f8fafc;
}
.order-batch-move-copy{display:flex;flex-direction:column;gap:3px;min-width:260px;}
.order-batch-move-copy span{font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#64748b;}
.order-batch-move-copy strong{font-size:15px;color:#17324d;}
.order-batch-move-copy small{font-size:12px;color:#64748b;line-height:1.35;}
.order-batch-move-controls{display:flex;align-items:center;gap:10px;min-width:480px;justify-content:flex-end;}
.order-batch-move-controls .order-move-select{min-width:300px;max-width:390px;}
@media(max-width:900px){
  .order-batch-move{align-items:stretch;flex-direction:column;}
  .order-batch-move-controls{min-width:0;flex-direction:column;align-items:stretch;}
  .order-batch-move-controls .order-move-select{min-width:0;max-width:none;width:100%;}
  .order-batch-move-controls .btn{width:100%;}
}

/* v35 — secure invite / password-recovery screens */
.auth-notice{display:block;margin:0 0 14px;padding:11px 13px;border:1px solid #b7dec2;background:#eefaf1;color:#175c2e;border-radius:2px;font-size:13px;line-height:1.45}
.auth-link-row{display:flex;justify-content:center;margin-top:13px}
.auth-link{appearance:none;border:0;background:transparent;color:var(--navy);font:inherit;font-size:13px;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:4px 8px}
.auth-link:hover{color:var(--red)}
.auth-link:disabled{opacity:.55;cursor:not-allowed}
.auth-password-hint{margin-top:-4px;color:var(--muted);font-size:12px;line-height:1.45}

/* v37 — unified activity log */
.audit-log-table table{min-width:980px;}
.audit-log-table th:nth-child(1){width:145px;}
.audit-log-table th:nth-child(2){width:230px;}
.audit-log-table th:nth-child(3){width:210px;}
.audit-log-table th:nth-child(4){width:160px;}
.audit-log-table td{vertical-align:top;}
.audit-when strong{display:block;color:var(--navy);font-size:12px;}
.audit-details{white-space:normal;min-width:260px;color:var(--muted);}

/* v41 — historical comparison using up to five same-cycle approved orders */
.rv5-stats{grid-template-columns:repeat(4,88px)}
.rv41-history-table{min-width:1580px!important;table-layout:fixed}
.rv41-history-table th:nth-child(1),.rv41-history-table td:nth-child(1){width:58px!important}
.rv41-history-table th:nth-child(2),.rv41-history-table td:nth-child(2){width:285px!important}
.rv41-history-table th:nth-child(3),.rv41-history-table td:nth-child(3),
.rv41-history-table th:nth-child(4),.rv41-history-table td:nth-child(4),
.rv41-history-table th:nth-child(5),.rv41-history-table td:nth-child(5){width:78px!important;text-align:center!important}
.rv41-history-table th:nth-child(6),.rv41-history-table td:nth-child(6){width:155px!important;text-align:center!important}
.rv41-history-table th:nth-child(7),.rv41-history-table td:nth-child(7),
.rv41-history-table th:nth-child(8),.rv41-history-table td:nth-child(8){width:88px!important;text-align:center!important}
.rv41-history-table th:nth-child(9),.rv41-history-table td:nth-child(9){width:165px!important;text-align:left!important}
.rv41-history-table th:nth-child(10),.rv41-history-table td:nth-child(10),
.rv41-history-table th:nth-child(11),.rv41-history-table td:nth-child(11){width:96px!important;text-align:center!important}
.rv41-history-table th:nth-child(12),.rv41-history-table td:nth-child(12){width:165px!important;text-align:center!important}
.rv41-history-table th:nth-child(13),.rv41-history-table td:nth-child(13){width:175px!important}
.rv41-history{font-variant-numeric:tabular-nums;color:#40546d;font-size:12px!important;white-space:nowrap;text-align:center!important}
.rv41-history[title]{cursor:help}
.rv41-history-table .rv5-issue-same{background:#f1f5f9;color:#334155}
@media(max-width:1150px){
  .rv5-stats{grid-template-columns:repeat(4,minmax(82px,1fr))}
}

/* v42 — simpler review table and clearer metadata */
.rv42-history-table{min-width:1490px!important;table-layout:fixed}
.rv42-history-table th:nth-child(1),.rv42-history-table td:nth-child(1){width:58px!important}
.rv42-history-table th:nth-child(2),.rv42-history-table td:nth-child(2){width:285px!important}
.rv42-history-table th:nth-child(3),.rv42-history-table td:nth-child(3),
.rv42-history-table th:nth-child(4),.rv42-history-table td:nth-child(4){width:90px!important;text-align:center!important}
.rv42-history-table th:nth-child(5),.rv42-history-table td:nth-child(5){width:165px!important;text-align:center!important}
.rv42-history-table th:nth-child(6),.rv42-history-table td:nth-child(6),
.rv42-history-table th:nth-child(7),.rv42-history-table td:nth-child(7){width:92px!important;text-align:center!important}
.rv42-history-table th:nth-child(8),.rv42-history-table td:nth-child(8){width:165px!important;text-align:left!important}
.rv42-history-table th:nth-child(9),.rv42-history-table td:nth-child(9),
.rv42-history-table th:nth-child(10),.rv42-history-table td:nth-child(10){width:98px!important;text-align:center!important}
.rv42-history-table th:nth-child(11),.rv42-history-table td:nth-child(11){width:165px!important;text-align:center!important}
.rv42-history-table th:nth-child(12),.rv42-history-table td:nth-child(12){width:175px!important}
.rv42-history-table th{white-space:normal!important;line-height:1.15}

/* v43: scalable batch history and correctly aligned dashboard action column */
.hotel-status-wrap{
  width:100%;
  overflow-x:auto;
}
.hotel-status-table{
  width:100%;
  min-width:1120px;
  table-layout:fixed;
}
.hotel-status-table th,
.hotel-status-table td{
  display:table-cell!important;
  border-bottom:1px solid var(--line)!important;
  vertical-align:middle;
}
.hotel-status-table th:nth-child(1),
.hotel-status-table td:nth-child(1){width:250px;}
.hotel-status-table th:nth-child(2),
.hotel-status-table td:nth-child(2){width:70px;}
.hotel-status-table th:nth-child(3),
.hotel-status-table td:nth-child(3){width:190px;}
.hotel-status-table th:nth-child(4),
.hotel-status-table td:nth-child(4){width:210px;}
.hotel-status-table th:nth-child(5),
.hotel-status-table td:nth-child(5){width:85px;}
.hotel-status-table th:nth-child(6),
.hotel-status-table td:nth-child(6){width:75px;text-align:center;}
.hotel-status-table th:nth-child(7),
.hotel-status-table td:nth-child(7){width:110px;}
.hotel-status-table th:nth-child(8),
.hotel-status-table td:nth-child(8){width:120px;text-align:left;}
.hotel-action-cell{
  display:table-cell!important;
  text-align:left!important;
  min-width:120px;
  width:120px;
}
.hotel-action-cell .btn{
  min-width:78px;
  justify-content:center;
}

.batch-scope-tabs{
  display:flex;
  gap:22px;
  padding:0 18px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.batch-scope-tab{
  appearance:none;
  border:0;
  border-bottom:3px solid transparent;
  background:transparent;
  color:var(--muted);
  padding:13px 2px 11px;
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.batch-scope-tab:hover{color:var(--navy);}
.batch-scope-tab.on{
  color:var(--navy);
  border-bottom-color:var(--red);
}
.batch-filter-bar{
  display:grid;
  grid-template-columns:minmax(220px,1.5fr) minmax(150px,.8fr) minmax(150px,.8fr) auto;
  gap:10px;
  align-items:end;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:#fbfcfe;
}
.batch-filter-field label{
  display:block;
  margin-bottom:5px;
  color:var(--navy);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.5px;
}
.batch-filter-field .fi{height:38px;}
.batch-filter-actions{
  display:flex;
  gap:7px;
  align-items:center;
  min-height:38px;
}
.batch-result-count{
  padding:10px 18px 0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.batch-list{
  margin-top:8px;
}
.batch-list table{
  width:100%;
  min-width:1120px;
  table-layout:fixed;
}
.batch-list th,
.batch-list td{
  display:table-cell!important;
  border-bottom:1px solid var(--line)!important;
  vertical-align:middle;
}
.batch-list th:nth-child(1),.batch-list td:nth-child(1){width:170px;}
.batch-list th:nth-child(2),.batch-list td:nth-child(2){width:115px;}
.batch-list th:nth-child(3),.batch-list td:nth-child(3){width:115px;}
.batch-list th:nth-child(4),.batch-list td:nth-child(4){width:105px;}
.batch-list th:nth-child(5),.batch-list td:nth-child(5){width:120px;}
.batch-list th:nth-child(6),.batch-list td:nth-child(6){width:150px;}
.batch-list th:nth-child(7),.batch-list td:nth-child(7){width:250px;}
.batch-list th:nth-child(8),.batch-list td:nth-child(8){width:205px!important;min-width:205px!important;}
.batch-list-action-cell{
  display:table-cell!important;
  vertical-align:middle!important;
}
.batch-list-action-cell .batch-actions{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:7px;
}
.batch-list-action-cell .batch-actions .btn{
  width:100%;
  justify-content:center;
  margin:0;
}
.batch-pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 18px;
  border-top:1px solid var(--line);
  background:#fff;
}
.batch-page-summary{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.batch-page-buttons{
  display:flex;
  align-items:center;
  gap:10px;
}
.batch-page-number{
  min-width:105px;
  text-align:center;
  color:var(--navy);
  font-size:12px;
  font-weight:800;
}

@media(max-width:900px){
  .batch-filter-bar{
    grid-template-columns:1fr 1fr;
  }
  .batch-filter-field.cycle{grid-column:1/-1;}
  .batch-filter-actions{grid-column:1/-1;}
}
@media(max-width:560px){
  .batch-filter-bar{grid-template-columns:1fr;}
  .batch-filter-field.cycle,
  .batch-filter-actions{grid-column:auto;}
  .batch-pager{align-items:flex-start;flex-direction:column;}
  .batch-page-buttons{width:100%;justify-content:space-between;}
}


/* v44 — keep compact batch headings clearly separated */
.batch-list th:nth-child(4),
.batch-list td:nth-child(4),
.batch-list th:nth-child(5),
.batch-list td:nth-child(5),
.batch-list th:nth-child(6),
.batch-list td:nth-child(6){
  text-align:center;
}
.batch-list th:nth-child(5),
.batch-list td:nth-child(5){
  width:115px;
  padding-left:16px;
  padding-right:16px;
}
.batch-list th:nth-child(6),
.batch-list td:nth-child(6){
  width:155px;
  padding-left:16px;
  padding-right:16px;
}
.batch-list th:nth-child(5){
  border-right:1px solid rgba(255,255,255,.22)!important;
}


/* v47: safe, card-based Other-item resolution */
.other-items-review{margin-top:18px;border-top:1px solid var(--line);padding-top:16px}
.other-items-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}
.other-items-section-head h3{margin:0 0 4px}
.other-items-card-list{display:flex;flex-direction:column;gap:12px}
.other-item-card{border:1px solid var(--line);border-radius:4px;background:#fff;padding:14px}
.other-item-card.is-resolved{background:#f8fafc;opacity:.82}
.other-item-card-head{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:16px;align-items:start;padding-bottom:12px;border-bottom:1px solid var(--line)}
.other-item-card-title strong{display:block;color:var(--navy);font-size:15px;line-height:1.35;margin-bottom:4px}
.other-item-card-title span{display:block;color:var(--muted);font-size:12px;line-height:1.45}
.other-item-requested{border:1px solid #cbd5e1;background:var(--soft);padding:8px 10px;text-align:center;border-radius:3px}
.other-item-requested small{display:block;text-transform:uppercase;letter-spacing:.45px;font-size:9px;font-weight:900;color:var(--muted);margin-bottom:3px}
.other-item-requested b{display:block;color:var(--navy);font-size:18px}
.other-match-box{margin-top:12px;border:1px solid #bfdbfe;background:#f8fbff;padding:12px;border-radius:3px}
.other-box-label{font-size:11px;text-transform:uppercase;letter-spacing:.45px;font-weight:900;color:var(--navy);margin-bottom:7px}
.other-match-select{width:100%;min-height:42px;background:#fff}
.other-match-decision{margin-top:10px}
.other-match-placeholder{font-size:12px;color:var(--muted);line-height:1.45;padding:8px 0 2px}
.other-match-result{display:flex;align-items:center;justify-content:space-between;gap:14px;border-radius:3px;padding:11px 12px}
.other-match-result.not-present{border:1px solid #bbf7d0;background:#f0fdf4}
.other-match-result.already-present{align-items:flex-start;border:1px solid #f5c56b;background:#fffaf0}
.other-match-result strong{display:block;color:var(--navy);font-size:13px;margin-bottom:3px}
.other-match-result span{display:block;color:var(--text);font-size:12px;line-height:1.4}
.other-match-result small{display:block;color:#8a5a13;font-size:11px;line-height:1.4;margin-top:4px}
.other-existing-line{min-width:230px}
.other-decision-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.other-extra-btn{background:#9a5b00;border-color:#9a5b00;color:#fff}
.other-extra-btn:hover{background:#7c4900;border-color:#7c4900}
.other-keep-details{margin-top:10px;border:1px solid var(--line);border-radius:3px;background:#fff}
.other-keep-details summary{cursor:pointer;padding:11px 12px;font-size:12px;font-weight:800;color:var(--navy);user-select:none}
.other-keep-details[open] summary{border-bottom:1px solid var(--line);background:var(--soft)}
.other-keep-grid{display:grid;grid-template-columns:minmax(180px,1.2fr) 140px 140px;gap:10px;padding:12px}
.other-keep-grid .ff{margin-top:0}
.other-keep-grid .ff.full{grid-column:1/-1}
.other-keep-details>.muted-small{display:block;margin:0;padding:0 12px 12px}
.other-resolution-complete{display:flex;align-items:center;gap:10px;padding-top:12px}
.other-resolution-complete>span:last-child{font-size:11px;color:var(--muted);line-height:1.4}
.other-confirm-message{padding:10px 12px;margin-bottom:12px;border:1px solid #bbf7d0;background:#f0fdf4;color:#166534;font-size:13px;line-height:1.45}
.other-confirm-message.warn{border-color:#f5c56b;background:#fffaf0;color:#7c4900}
.other-confirm-message.safe{border-color:#cbd5e1;background:#f8fafc;color:#334155}
@media(max-width:900px){
  .other-items-section-head{display:block}
  .other-items-section-head>.badge{margin-top:8px}
  .other-match-result{display:block}
  .other-decision-buttons{justify-content:flex-start;margin-top:10px}
  .other-keep-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
  .other-item-card-head{grid-template-columns:1fr}
  .other-item-requested{text-align:left;width:120px}
  .other-keep-grid{grid-template-columns:1fr}
  .other-keep-grid .ff.full{grid-column:auto}
  .other-decision-buttons{display:grid;grid-template-columns:1fr;width:100%}
  .other-decision-buttons .btn{width:100%}
}

/* v48 — editable Other-item details and safe undo of a wrong catalogue match */
.other-item-head-side{display:flex;align-items:flex-start;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.other-edit-btn{white-space:nowrap}
.other-resolution-complete{justify-content:space-between;align-items:flex-start;flex-wrap:wrap}
.other-resolution-copy{display:flex;align-items:flex-start;gap:10px;min-width:0;flex:1}
.other-resolution-copy>span:last-child{font-size:11px;color:var(--muted);line-height:1.45;overflow-wrap:anywhere}
.other-undo-btn{white-space:nowrap;flex:0 0 auto}
.other-edit-form{display:grid;gap:12px}
.other-edit-form .ff{margin-top:0}
.other-undo-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.other-undo-summary>div{border:1px solid var(--line);border-radius:3px;background:var(--soft);padding:10px 12px}
.other-undo-summary span{display:block;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.other-undo-summary strong{display:block;color:var(--navy);font-size:13px;line-height:1.35}

@media (max-width:700px){
  .other-item-head-side{justify-content:flex-start}
  .other-resolution-copy{flex-basis:100%}
  .other-undo-btn{width:100%}
  .other-undo-summary{grid-template-columns:1fr}
}


/* v49 — compact searchable catalogue matcher for Other items */
.other-match-box{max-width:760px}
.other-match-native{display:none!important}
.other-catalogue-search{width:min(100%,680px);position:relative}
.other-catalogue-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}
.other-catalogue-search-input{width:100%;min-height:42px;margin:0;background:#fff}
.other-catalogue-clear{min-width:68px;min-height:42px;white-space:nowrap}
.other-catalogue-results{margin-top:6px;border:1px solid #cbd5e1;border-radius:3px;background:#fff;max-height:238px;overflow:auto;box-shadow:0 8px 20px rgba(15,23,42,.12)}
.other-catalogue-search-message{padding:12px 14px;color:var(--muted);font-size:12px;line-height:1.45}
.other-catalogue-search-message.no-results{color:#8a3b12;background:#fffaf0}
.other-catalogue-option{appearance:none;width:100%;display:grid;grid-template-columns:88px minmax(0,1fr);gap:12px;align-items:center;border:0;border-bottom:1px solid var(--line);background:#fff;padding:10px 12px;text-align:left;cursor:pointer;color:var(--text)}
.other-catalogue-option:last-of-type{border-bottom:0}
.other-catalogue-option:hover,.other-catalogue-option.is-active{background:#eef6ff}
.other-catalogue-option:focus{outline:2px solid #315f8c;outline-offset:-2px}
.other-catalogue-option-code{font-size:11px;font-weight:900;color:var(--navy);letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.other-catalogue-option-name{font-size:13px;font-weight:600;color:var(--text);line-height:1.35;overflow-wrap:anywhere}
.other-catalogue-search-more{padding:8px 12px;background:var(--soft);border-top:1px solid var(--line);font-size:11px;color:var(--muted);text-align:center}
@media(max-width:620px){
  .other-match-box{max-width:none}
  .other-catalogue-search{width:100%}
  .other-catalogue-search-row{grid-template-columns:1fr}
  .other-catalogue-clear{width:100%}
  .other-catalogue-option{grid-template-columns:72px minmax(0,1fr)}
}


/* v50 — force the searchable field; the legacy native catalogue dropdown no longer exists. */
.other-catalogue-search-input{display:block!important;font-size:14px}
.other-catalogue-results[hidden]{display:none!important}

/* v51 — show Other-item routing at a glance while the editor is collapsed */
.other-keep-summary{
  display:grid;
  grid-template-columns:minmax(190px,auto) minmax(0,1fr);
  align-items:center;
  gap:12px;
}
.other-keep-summary-title{
  color:var(--navy);
  font-weight:800;
  white-space:nowrap;
}
.other-keep-summary-values{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}
.other-keep-chip{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  max-width:100%;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#f8fafc;
  color:#475569;
  font-size:11px;
  font-weight:700;
  line-height:1.25;
  white-space:nowrap;
}
.other-keep-chip.is-set{
  border-color:#bbf7d0;
  background:#f0fdf4;
  color:#166534;
}
.other-keep-chip.is-missing{
  border-color:#fde68a;
  background:#fffbeb;
  color:#92400e;
}
.other-keep-chip.is-empty{
  color:#64748b;
}
.other-keep-note{
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:360px;
}
.other-keep-details[open] .other-keep-summary{
  background:var(--soft);
}
@media (max-width:900px){
  .other-keep-summary{
    grid-template-columns:1fr;
    gap:7px;
  }
  .other-keep-summary-title{white-space:normal}
  .other-keep-summary-values{justify-content:flex-start}
  .other-keep-note{max-width:100%}
}


/* v52 — batch review progress and post-approval change visibility */
.rv52-review-strip {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 12px;
  padding:13px 15px;
  border:1px solid #d9e2ec;
  border-left:4px solid #2c4d6d;
  border-radius:6px;
  background:#f8fafc;
}
.rv52-review-strip.needs-work { background:#fffaf0; border-color:#ead9ac; border-left-color:#b7791f; }
.rv52-review-strip.complete { background:#f0fff4; border-color:#c6e8d1; border-left-color:#2f855a; }
.rv52-review-strip > div { display:grid; gap:3px; }
.rv52-review-strip strong { color:#17324d; font-size:14px; }
.rv52-review-strip span:not(.badge) { color:#5d6f82; font-size:12px; }
.rv52-progress-cell { display:grid; justify-items:start; gap:4px; min-width:170px; }
.rv52-progress-note { display:block; color:#66788a; font-size:11px; line-height:1.25; }
.rv52-changed-badge {
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:3px 7px;
  border-radius:999px;
  background:#edf4ff;
  color:#2f5f98;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.rv52-row-needs-review { background:#fffdf7; }
.rv52-row-needs-review td:first-child { box-shadow:inset 3px 0 0 #b7791f; }
.rv52-orders-table th:nth-last-child(2), .rv52-orders-table td:nth-last-child(2) { min-width:190px; }
@media (max-width: 900px) {
  .rv52-review-strip { align-items:flex-start; }
  .rv52-progress-cell { min-width:150px; }
}


/* v53 — clearly number and identify every Other item. */
.other-item-card-title-wrap{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px;align-items:start;min-width:0}
.other-item-sequence{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--navy);color:#fff;font-weight:800;font-size:16px;line-height:1;box-shadow:0 0 0 3px #eaf2f8}
.other-item-identifiers{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 6px}
.other-item-card-title .other-item-label,.other-item-card-title .other-item-code{display:inline-flex;align-items:center;width:auto;line-height:1;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:800;letter-spacing:.35px;text-transform:uppercase}
.other-item-card-title .other-item-label{background:#eef4f8;color:var(--navy);border:1px solid #c9d9e4}
.other-item-card-title .other-item-code{background:#fff7df;color:#8a5700;border:1px solid #ead69a;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.2px}
@media (max-width:700px){.other-item-card-title-wrap{grid-template-columns:34px minmax(0,1fr);gap:9px}.other-item-sequence{width:30px;height:30px;font-size:14px}.other-item-identifiers{gap:5px}}


/* v54: supplier sheets must identify every unrouted site/product clearly. */
.supplier-matrix-wrap{
  max-height:70vh;
  overflow:auto!important;
}
.supplier-matrix-table th.sm-code,
.supplier-matrix-table td.sm-code{
  width:112px!important;
  min-width:112px!important;
  max-width:112px!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
.supplier-matrix-table th.sm-product,
.supplier-matrix-table td.sm-product{left:112px!important;}
.supplier-matrix-table th.sm-total,
.supplier-matrix-table td.sm-total{left:442px!important;}

.unrouted-detail-panel{
  border:2px solid #e4b84b!important;
  box-shadow:none!important;
  margin-top:16px;
}
.unrouted-detail-panel .ph{
  background:#fff9e8!important;
  border-bottom:1px solid #ecd590!important;
}
.unrouted-detail-panel .ph h2{color:#7a4b00!important;}
.unrouted-detail-wrap{overflow:auto;max-width:100%;}
.unrouted-detail-table{
  width:100%;
  min-width:980px;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.unrouted-detail-table th,
.unrouted-detail-table td{
  padding:11px 12px;
  border-right:1px solid #e6ebf2;
  border-bottom:1px solid #e6ebf2;
  vertical-align:middle;
  text-align:left;
}
.unrouted-detail-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:#24425f;
  color:#fff;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.25px;
}
.unrouted-detail-table tbody tr:nth-child(even) td{background:#fbfdff;}
.unrouted-detail-table tbody tr:hover td{background:#fff8e6;}
.unrouted-detail-table .ud-site,
.unrouted-detail-table .ud-product{min-width:210px;}
.unrouted-detail-table .ud-site strong,
.unrouted-detail-table .ud-product strong{
  display:block;
  color:#17324d;
  font-weight:900;
  margin-bottom:3px;
}
.unrouted-detail-table .ud-site span,
.unrouted-detail-table .ud-product span{
  display:block;
  color:#4f6278;
  white-space:normal;
}
.unrouted-detail-table .ud-qty{
  min-width:105px;
  text-align:center;
}
.unrouted-detail-table .ud-ref{min-width:180px;font-weight:700;color:#17324d;}
.unrouted-detail-table .ud-reason{min-width:230px;color:#7a4b00;white-space:normal;}
.unrouted-detail-table .ud-action{min-width:120px;text-align:right;}
@media(max-width:900px){
  .supplier-matrix-table th.sm-product,
  .supplier-matrix-table td.sm-product{left:112px!important;}
  .supplier-matrix-table th.sm-total,
  .supplier-matrix-table td.sm-total{left:372px!important;}
}


/* v55 — supplier matrix remains unambiguous at the bottom of long sheets.
   Every non-empty quantity cell carries its site code, and the complete site
   header is repeated at the bottom of the matrix. */
.supplier-matrix-table td.sm-site{
  padding:6px 8px!important;
}
.supplier-matrix-table .sm-cell-site-code{
  display:block;
  margin-bottom:2px;
  font-size:9px;
  line-height:1;
  font-weight:800;
  letter-spacing:.25px;
  color:#64748b;
}
.supplier-matrix-table .sm-cell-qty{
  display:block;
  font-size:15px;
  line-height:1.1;
  color:#0f172a;
}
.supplier-matrix-table tfoot th{
  background:#f3f7fb!important;
  color:#17324d!important;
  border-top:2px solid #cbd7e6!important;
  border-bottom:0!important;
  text-transform:none!important;
  letter-spacing:0!important;
  position:static!important;
}
.supplier-matrix-table tfoot th.sm-code,
.supplier-matrix-table tfoot th.sm-product,
.supplier-matrix-table tfoot th.sm-total{
  background:#24425f!important;
  color:#fff!important;
}
.supplier-matrix-table tfoot th.sm-code,
.supplier-matrix-table tfoot th.sm-product,
.supplier-matrix-table tfoot th.sm-total{
  position:sticky!important;
}
.supplier-matrix-table tfoot th.sm-code{left:0!important;z-index:6;}
.supplier-matrix-table tfoot th.sm-product{left:112px!important;z-index:6;}
.supplier-matrix-table tfoot th.sm-total{left:442px!important;z-index:6;}
@media(max-width:900px){
  .supplier-matrix-table tfoot th.sm-product{left:112px!important;}
  .supplier-matrix-table tfoot th.sm-total{left:372px!important;}
}

/* v57 — product images, CTL details and alias management */
.product-media-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 150px;
  gap:18px;
  align-items:center;
  padding:16px;
  margin:0 0 18px;
  border:1px solid #d8e2ea;
  background:#f8fbfd;
  border-radius:6px;
}
.product-media-copy{display:flex;flex-direction:column;gap:7px;min-width:0}
.product-media-copy>strong{font-size:15px;color:var(--navy)}
.product-media-copy>span{font-size:12px;line-height:1.5;color:var(--muted)}
.product-image-status{font-size:12px;color:#53647a;font-weight:600}
.product-media-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.product-image-preview{
  width:150px;
  height:150px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#fff;
  overflow:hidden;
  display:grid;
  place-items:center;
}
.product-image-preview img{width:100%;height:100%;object-fit:contain;background:#fff}
.product-image-empty{padding:14px;text-align:center;color:var(--muted);display:flex;flex-direction:column;gap:5px}
.product-image-empty strong{color:var(--navy)}
.product-image-empty span{font-size:11px;line-height:1.35}
@media(max-width:700px){
  .product-media-card{grid-template-columns:1fr}
  .product-image-preview{width:128px;height:128px;justify-self:start}
}


/* v58 — standard order unit */
.order-unit-pill{display:inline-flex;align-items:center;margin-left:7px;padding:2px 7px;border:1px solid #cbd5e1;border-radius:3px;background:#f8fafc;color:#334155;font-size:9px;font-weight:800;line-height:1.35;text-transform:uppercase;letter-spacing:.035em;vertical-align:middle;white-space:nowrap}
.order-unit-preview{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-2px 0 14px;padding:10px 12px;border:1px solid #dbe4ec;border-left:3px solid var(--navy);border-radius:3px;background:#f8fafc}.order-unit-preview>span{font-size:10px;font-weight:800;color:#64748b;text-transform:uppercase}.order-unit-preview .order-unit-pill{margin-left:0;color:var(--navy);background:#fff}.order-unit-preview small{color:#64748b;font-size:11px}.qty-unit-suffix{display:block;margin-top:3px;color:#64748b;font-size:9px;font-weight:700;text-align:center}.rv5-product .order-unit-pill,.sm-product .order-unit-pill{margin-top:4px}

.order-unit-pill.needs-setting{border-color:#f59e0b;background:#fffbeb;color:#92400e}


/* v59 — hide unset units from operational screens and align batch actions */
.rv52-orders-table th:last-child,
.rv52-orders-table td.rv59-order-action{
  width:132px;
  min-width:132px;
  max-width:132px;
  text-align:center;
  white-space:nowrap;
}
.rv52-orders-table td.rv59-order-action{
  display:table-cell!important;
  vertical-align:middle;
}
.rv52-orders-table td.rv59-order-action .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:94px;
  margin:0 auto;
}
.rv52-orders-table th:nth-last-child(2),
.rv52-orders-table td:nth-last-child(2){
  width:190px;
  min-width:190px;
}
.rv52-orders-table td{
  vertical-align:middle;
}


/* v60 — recent contingency shown separately from normal-order history */
.rv5-stats{grid-template-columns:repeat(5,minmax(82px,1fr))}
.rv5-stat.contingency{background:#fff7ed;border-color:#fed7aa}
.rv5-stat.contingency b{color:#9a3412}
.rv42-history-table{min-width:1660px!important}
.rv42-history-table th:nth-child(7),.rv42-history-table td:nth-child(7){width:170px!important;text-align:left!important}
.rv42-history-table th:nth-child(8),.rv42-history-table td:nth-child(8){width:92px!important;text-align:center!important}
.rv42-history-table th:nth-child(9),.rv42-history-table td:nth-child(9){width:165px!important;text-align:left!important}
.rv42-history-table th:nth-child(10),.rv42-history-table td:nth-child(10),
.rv42-history-table th:nth-child(11),.rv42-history-table td:nth-child(11){width:98px!important;text-align:center!important}
.rv42-history-table th:nth-child(12),.rv42-history-table td:nth-child(12){width:165px!important;text-align:center!important}
.rv42-history-table th:nth-child(13),.rv42-history-table td:nth-child(13){width:175px!important}
.rv60-contingency-cell{background:#fffdfa!important}
.rv60-contingency{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:start;gap:3px 6px;line-height:1.15;cursor:help}
.rv60-contingency strong{color:#9a3412;font-size:13px;font-variant-numeric:tabular-nums}
.rv60-contingency-status{padding:2px 5px;border:1px solid #fed7aa;background:#fff7ed;color:#9a3412;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.35px;border-radius:2px}
.rv60-contingency small{grid-column:1/-1;color:#64748b;font-size:10px;white-space:normal}
.rv60-none{color:#94a3b8}
@media(max-width:1150px){.rv5-stats{grid-template-columns:repeat(3,minmax(82px,1fr))}}


/* v61 — compact workflow views for order review and delivery */
.rv61-workflow{margin-top:14px}
.rv61-tabs{display:flex;gap:0;border-bottom:1px solid #cbd5e1;margin:0 0 14px}
.rv61-tab{appearance:none;border:0;border-bottom:3px solid transparent;background:#fff;color:#52657a;padding:10px 16px;font-size:12px;font-weight:800;cursor:pointer;border-radius:0}
.rv61-tab:hover{background:#f6f9fc;color:#17324d}
.rv61-tab.on{color:#17324d;border-bottom-color:#17324d;background:#f8fafc}
.rv61-pane[hidden]{display:none!important}
.rv61-table-wrap{width:100%;overflow:auto;border:1px solid #d8e1ea;background:#fff}
.rv61-review-table,.rv61-delivery-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.rv61-review-table{min-width:1080px}
.rv61-delivery-table{min-width:850px}
.rv61-review-table th,.rv61-review-table td,.rv61-delivery-table th,.rv61-delivery-table td{padding:9px 10px;border-right:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;vertical-align:middle;text-align:left}
.rv61-review-table th,.rv61-delivery-table th{position:sticky;top:0;z-index:3;background:#24425f;color:#fff;font-size:10px;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap}
.rv61-review-table tbody tr:nth-child(4n+3) td,.rv61-delivery-table tbody tr:nth-child(even) td{background:#fbfdff}
.rv61-review-table th:nth-child(1),.rv61-review-table td:nth-child(1){width:245px;min-width:245px}
.rv61-review-table th:nth-child(2),.rv61-review-table td:nth-child(2),.rv61-review-table th:nth-child(3),.rv61-review-table td:nth-child(3){width:92px;min-width:92px;text-align:right}
.rv61-review-table th:nth-child(4),.rv61-review-table td:nth-child(4){width:220px;min-width:220px}
.rv61-review-table th:nth-child(5),.rv61-review-table td:nth-child(5){width:175px;min-width:175px}
.rv61-review-table th:nth-child(6),.rv61-review-table td:nth-child(6){width:205px;min-width:205px}
.rv61-review-table th:nth-child(7),.rv61-review-table td:nth-child(7){width:92px;min-width:92px;text-align:center}
.rv61-delivery-table th:nth-child(1),.rv61-delivery-table td:nth-child(1){width:280px;min-width:280px}
.rv61-delivery-table th:nth-child(2),.rv61-delivery-table td:nth-child(2){width:110px;text-align:right}
.rv61-delivery-table th:nth-child(3),.rv61-delivery-table td:nth-child(3){width:130px;text-align:center}
.rv61-delivery-table th:nth-child(4),.rv61-delivery-table td:nth-child(4){width:125px}
.rv61-delivery-table th:nth-child(5),.rv61-delivery-table td:nth-child(5){width:130px}
.rv61-delivery-table th:nth-child(6),.rv61-delivery-table td:nth-child(6){min-width:210px}
.rv61-product{white-space:normal!important}
.rv61-product strong{display:block;color:#17324d;line-height:1.25}
.rv61-product-code{font-size:10px;font-weight:900;color:#64748b;margin-bottom:3px;letter-spacing:.25px}
.rv61-product .order-unit-pill{margin:5px 0 0}
.rv61-pattern{display:flex;flex-direction:column;gap:4px;line-height:1.2}
.rv61-pattern-main{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.rv61-pattern-main span{font-size:10px;color:#64748b;text-transform:uppercase;font-weight:800}
.rv61-pattern-main strong{color:#17324d;font-size:13px}
.rv61-pattern-history{font-size:11px;color:#52657a;white-space:normal}
.rv61-pattern-footer{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.rv61-pattern-footer .rv5-diff{font-size:10px}
.rv61-pattern-footer .rv5-issue{font-size:9px;padding:3px 5px}
.rv61-decision{display:grid;grid-template-columns:minmax(110px,1fr) 72px;gap:7px;align-items:start}
.rv61-decision .rv5-supplier-select{width:100%;min-width:0}
.rv61-approve-control input,.rv61-received-input input{width:68px!important;min-width:68px!important}
.rv61-note-button{min-width:74px;padding-left:8px;padding-right:8px}
.rv61-note-button.has-note{border-color:#5f7d9a;background:#eef4f8;color:#17324d}
.rv61-note-row td{padding:0!important;background:#f8fafc!important}
.rv61-note-editor{display:grid;grid-template-columns:220px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border-left:3px solid #24425f}
.rv61-note-editor label{font-size:11px;font-weight:800;color:#17324d}
.rv61-note-editor input{width:100%}
.rv61-receipt-difference,.rv61-receipt-status{display:inline-flex;padding:3px 6px;border:1px solid #cbd5e1;background:#f8fafc;color:#52657a;font-size:10px;font-weight:800;border-radius:2px;white-space:nowrap}
.rv61-receipt-difference.matched,.rv61-receipt-status.received{border-color:#a7d7bd;background:#eefbf3;color:#17623a}
.rv61-receipt-difference.short,.rv61-receipt-difference.over,.rv61-receipt-status.issue{border-color:#efc0b8;background:#fff4f1;color:#9b2c1f}
.rv61-receipt-status.awaiting{border-color:#ecd590;background:#fff9e8;color:#7a4b00}
.rv61-delivery-issue{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.rv61-delivery-issue small{font-size:10px;color:#64748b;white-space:normal}
.rv61-no-issue{color:#94a3b8}
.rv61-receipt-overview{display:grid;grid-template-columns:repeat(4,minmax(90px,1fr));border:1px solid #d8e1ea;margin:0 0 12px;background:#f8fafc}
.rv61-receipt-overview>div{padding:10px 12px;border-right:1px solid #d8e1ea}
.rv61-receipt-overview>div:last-child{border-right:0}
.rv61-receipt-overview span{display:block;font-size:9px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.3px}
.rv61-receipt-overview strong{display:block;margin-top:2px;font-size:18px;color:#17324d}
.rv61-claim-panel{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;margin:0 0 12px;border:1px solid #d8e1ea;border-left:3px solid #24425f;background:#fff}
.rv61-claim-panel>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.rv61-claim-panel span{font-size:9px;font-weight:800;color:#64748b;text-transform:uppercase}
.rv61-claim-panel strong{font-size:12px;color:#17324d}
.rv61-claim-panel small{font-size:10px;color:#64748b;white-space:normal}
.rv61-claim-panel.empty-state{border-left-color:#cbd5e1;background:#f8fafc}
.rv61-other-receipts{margin-top:16px}
@media(max-width:900px){
  .rv61-note-editor{grid-template-columns:1fr}
  .rv61-receipt-overview{grid-template-columns:repeat(2,1fr)}
  .rv61-receipt-overview>div:nth-child(2){border-right:0}
  .rv61-receipt-overview>div:nth-child(-n+2){border-bottom:1px solid #d8e1ea}
  .rv61-claim-panel{align-items:flex-start;flex-direction:column}
}


/* v62 — keep compact workflow tables structurally aligned.
   The legacy global .ta-r utility is flex-based; table cells must remain table cells. */
.rv61-review-table,
.rv61-delivery-table{table-layout:fixed}
.rv61-review-table td.ta-r,
.rv61-delivery-table td.ta-r{
  display:table-cell!important;
  min-width:0!important;
  text-align:right!important;
  white-space:nowrap;
}
.rv61-review-table td.rv5-requested{display:table-cell!important;min-width:0!important}

/* v62 — global Delivery Issues page */
.rv62-issues-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:14px}
.rv62-issues-head h2{margin:0;color:#17324d;font-size:20px}
.rv62-issues-head p{margin:4px 0 0;color:#64748b;font-size:12px}
.rv62-issue-stats{display:grid;grid-template-columns:repeat(3,minmax(105px,1fr));gap:8px;min-width:360px}
.rv62-issue-stat{border:1px solid #d8e1ea;background:#fff;padding:9px 11px}
.rv62-issue-stat span{display:block;font-size:9px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.35px}
.rv62-issue-stat strong{display:block;margin-top:2px;font-size:20px;color:#17324d}
.rv62-issue-stat.open{border-left:3px solid #c93434;background:#fff7f7}
.rv62-issue-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.rv62-issue-filters{display:flex;gap:0;border:1px solid #cbd5e1}
.rv62-issue-filter{border:0;border-right:1px solid #cbd5e1;background:#fff;color:#52657a;padding:8px 12px;font:inherit;font-size:11px;font-weight:800;cursor:pointer}
.rv62-issue-filter:last-child{border-right:0}
.rv62-issue-filter.on{background:#17324d;color:#fff}
.rv62-issue-search{width:300px;max-width:100%}
.rv62-issues-table{min-width:980px}
.rv62-issues-table td{vertical-align:middle}
.rv62-issues-table .issue-summary{max-width:360px;white-space:normal;line-height:1.3}
.rv62-issue-actions{display:flex;gap:6px;justify-content:flex-end;white-space:nowrap}
.rv62-open-marker{display:inline-flex;align-items:center;gap:5px}
.rv62-open-marker:before{content:'';width:7px;height:7px;border-radius:50%;background:#c93434}
@media(max-width:900px){
  .rv62-issues-head{align-items:stretch;flex-direction:column}
  .rv62-issue-stats{min-width:0}
  .rv62-issue-toolbar{align-items:stretch;flex-direction:column}
  .rv62-issue-search{width:100%}
}


/* v64 — secure delivery-note image and document preview */
.rv64-file-list{
  display:grid;
  gap:12px;
}
.rv64-file-card{
  border:1px solid var(--line);
  background:#fff;
  overflow:hidden;
}
.rv64-file-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:11px 12px;
  border-bottom:1px solid var(--line);
}
.rv64-file-meta{
  min-width:0;
  display:grid;
  gap:3px;
}
.rv64-file-meta strong{
  color:var(--navy);
  overflow-wrap:anywhere;
}
.rv64-file-meta span{
  color:var(--muted);
  font-size:12px;
  text-transform:capitalize;
}
.rv64-file-actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
}
.rv64-file-actions a{
  text-decoration:none;
}
.rv64-image-preview{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:180px;
  padding:12px;
  background:#f5f7fa;
  text-decoration:none;
}
.rv64-delivery-image{
  display:block;
  width:auto;
  max-width:100%;
  max-height:520px;
  object-fit:contain;
  background:#fff;
  border:1px solid var(--line);
}
.rv64-file-error{
  padding:12px;
  color:#9f2727;
  background:#fff5f5;
  border-top:1px solid #f3cccc;
  font-size:12px;
}
.rv64-image-preview.failed{
  cursor:default;
}
@media(max-width:700px){
  .rv64-file-header{
    align-items:flex-start;
    flex-direction:column;
  }
  .rv64-file-actions{
    width:100%;
  }
  .rv64-file-actions a{
    flex:1;
    text-align:center;
  }
  .rv64-image-preview{
    min-height:120px;
    padding:8px;
  }
  .rv64-delivery-image{
    max-height:420px;
  }
}
