
/* Patch 04P — Clean CSV review polish */
.gp-clean-review-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  padding:10px 12px;margin:10px 0;border:1px solid var(--gp-border, #e5e7f2);
  border-radius:16px;background:rgba(124,92,255,.04);
}
.gp-clean-review-toolbar small{color:var(--gp-muted,#6b7280);font-weight:700}
.gp-clean-filters{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.gp-clean-filters button{
  border:1px solid var(--gp-border,#dfe3f3);background:var(--gp-card,#fff);color:var(--gp-text,#111827);
  border-radius:999px;padding:7px 10px;font-size:12px;font-weight:800;cursor:pointer;
}
.gp-clean-filters button.active{background:#6d5dfc;color:#fff;border-color:#6d5dfc;box-shadow:0 8px 18px rgba(109,93,252,.22)}
.gp-clean-table-polished th,.gp-clean-table-polished td{vertical-align:middle}
.gp-clean-table-polished .gp-import-title-cell strong{max-width:280px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gp-clean-table-polished .gp-import-title-cell small{max-width:280px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gp-clean-status-badge{
  display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:6px 9px;font-size:11px;font-weight:900;white-space:nowrap;
  border:1px solid transparent;
}
.gp-clean-status-badge.ready{background:#e9f9ef;color:#137333;border-color:#b8ebc9}
.gp-clean-status-badge.auto_selected{background:#eaf2ff;color:#174ea6;border-color:#bed7ff}
.gp-clean-status-badge.needs_review{background:#fff4e5;color:#9a5b00;border-color:#ffd89a}
.gp-clean-status-badge.missing_brand{background:#fff8d9;color:#8a6d00;border-color:#ffe88c}
.gp-clean-status-badge.missing_model{background:#fff1d6;color:#9a5b00;border-color:#ffd083}
.gp-clean-status-badge.missing_range{background:#ffe8d9;color:#a33d00;border-color:#ffb98c}
.gp-clean-status-badge.missing_category{background:#f3e8ff;color:#6b21a8;border-color:#d8b4fe}
.gp-clean-status-badge.missing_image{background:#eef2ff;color:#3730a3;border-color:#c7d2fe}
.gp-clean-status-badge.missing_price{background:#ffe4e6;color:#9f1239;border-color:#fecdd3}
.gp-clean-issues{display:flex;gap:5px;flex-wrap:wrap;min-width:150px}
.gp-missing-chip{
  display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:850;border:1px solid transparent;
}
.gp-missing-ready{background:#e9f9ef;color:#137333;border-color:#b8ebc9}
.gp-missing-auto{background:#eaf2ff;color:#174ea6;border-color:#bed7ff}
.gp-missing-brand{background:#fff8d9;color:#8a6d00;border-color:#ffe88c}
.gp-missing-model{background:#fff1d6;color:#9a5b00;border-color:#ffd083}
.gp-missing-year_range{background:#ffe8d9;color:#a33d00;border-color:#ffb98c}
.gp-missing-category{background:#f3e8ff;color:#6b21a8;border-color:#d8b4fe}
.gp-missing-images{background:#eef2ff;color:#3730a3;border-color:#c7d2fe}
.gp-missing-source_price{background:#ffe4e6;color:#9f1239;border-color:#fecdd3}
.gp-missing-title_en,.gp-missing-original_offer_url{background:#f1f5f9;color:#334155;border-color:#cbd5e1}
.gp-clean-img-wrap{position:relative;display:inline-flex;width:44px;height:44px;border-radius:12px;overflow:visible}
.gp-clean-img-wrap>img{width:44px;height:44px;object-fit:cover;border-radius:12px;border:1px solid var(--gp-border,#dfe3f3)}
.gp-clean-img-pop{
  position:absolute;left:52px;top:-38px;width:220px;height:170px;padding:8px;border-radius:18px;
  background:var(--gp-card,#fff);border:1px solid var(--gp-border,#dfe3f3);box-shadow:0 24px 60px rgba(15,23,42,.22);
  z-index:50;display:none;
}
.gp-clean-img-pop img{width:100%;height:100%;object-fit:contain;border-radius:12px}
.gp-clean-img-wrap:hover .gp-clean-img-pop{display:block}
.gp-clean-row-ready{box-shadow:inset 4px 0 0 #22c55e}
.gp-clean-row-auto_selected{box-shadow:inset 4px 0 0 #3b82f6}
.gp-clean-row-missing_brand{box-shadow:inset 4px 0 0 #facc15}
.gp-clean-row-missing_model{box-shadow:inset 4px 0 0 #fb923c}
.gp-clean-row-missing_range{box-shadow:inset 4px 0 0 #f97316}
.gp-clean-row-missing_category{box-shadow:inset 4px 0 0 #a855f7}
.gp-clean-row-missing_image{box-shadow:inset 4px 0 0 #6366f1}
.gp-clean-row-missing_price{box-shadow:inset 4px 0 0 #e11d48}
.gp-clean-edit-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.gp-clean-edit-form .gp-field textarea{min-height:86px}
.gp-clean-edit-preview{
  grid-column:1/-1;display:grid;grid-template-columns:100px 1fr;gap:14px;align-items:center;padding:12px;border-radius:18px;
  background:rgba(124,92,255,.06);border:1px solid var(--gp-border,#dfe3f3);
}
.gp-clean-edit-preview img{width:100px;height:82px;object-fit:contain;border-radius:14px;background:#fff;border:1px solid var(--gp-border,#dfe3f3)}
.gp-clean-edit-preview strong,.gp-clean-edit-preview small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gp-clean-edit-form .gp-import-edit-actions{grid-column:1/-1}
@media (max-width: 900px){
  .gp-clean-edit-form{grid-template-columns:1fr}
  .gp-clean-review-toolbar{align-items:flex-start}
  .gp-clean-img-pop{left:auto;right:0;top:48px}
}

/* Patch 04Q — Clean CSV table layout polish */
.gp-import-clean-results{
  overflow:visible;
}
.gp-import-clean-results .gp-import-results-head-04l{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:end;
}
.gp-import-clean-results .gp-import-stats-04n{
  display:grid;
  grid-template-columns:repeat(8,minmax(92px,1fr));
  gap:10px;
}
.gp-import-clean-results .gp-import-stats-04n>div{
  min-height:74px;
  padding:14px 12px;
  border-radius:16px;
}
.gp-import-clean-results .gp-import-row-actions-04l{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
  min-width:360px;
}
.gp-import-clean-results .gp-table-wrap{
  border:1px solid var(--gp-border,#e3e7f4);
  border-radius:18px;
  overflow:auto;
  max-height:58vh;
  background:var(--gp-card,#fff);
  box-shadow:0 14px 35px rgba(15,23,42,.06);
}
.gp-clean-table-polished{
  width:100%;
  min-width:1180px;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}
.gp-clean-table-polished thead th{
  position:sticky;
  top:0;
  z-index:12;
  background:var(--gp-card,#fff);
  color:var(--gp-muted,#64748b);
  font-size:10px;
  letter-spacing:.065em;
  text-transform:uppercase;
  font-weight:900;
  padding:11px 10px;
  border-bottom:1px solid var(--gp-border,#e3e7f4);
  white-space:nowrap;
}
.gp-clean-table-polished tbody td{
  padding:12px 10px;
  border-bottom:1px solid rgba(148,163,184,.16);
  vertical-align:top;
  background:var(--gp-card,#fff);
}
.gp-clean-table-polished tbody tr:hover td{
  background:rgba(124,92,255,.035);
}
.gp-clean-table-polished .gp-col-row{width:44px}.gp-clean-table-polished .gp-col-status{width:128px}.gp-clean-table-polished .gp-col-image{width:76px}.gp-clean-table-polished .gp-col-title{width:37%}.gp-clean-table-polished .gp-col-vehicle{width:190px}.gp-clean-table-polished .gp-col-part{width:190px}.gp-clean-table-polished .gp-col-price{width:96px}.gp-clean-table-polished .gp-col-action{width:72px}
.gp-clean-rownum{
  color:var(--gp-muted,#64748b);
  font-weight:900;
  text-align:center;
  padding-top:18px!important;
}
.gp-clean-status-cell{padding-top:15px!important}
.gp-clean-status-badge{
  min-width:104px;
  justify-content:center;
  padding:7px 10px;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.55);
}
.gp-clean-image-cell{text-align:center;overflow:visible!important}
.gp-clean-img-wrap{
  width:52px;
  height:52px;
  border-radius:14px;
  background:rgba(148,163,184,.08);
}
.gp-clean-img-wrap>img{
  width:52px;
  height:52px;
  border-radius:14px;
  box-shadow:0 8px 18px rgba(15,23,42,.10);
}
.gp-clean-img-pop{
  left:62px;
  top:-64px;
  width:300px;
  height:230px;
  padding:10px;
  border-radius:22px;
  z-index:999;
}
.gp-clean-title-cell strong,
.gp-clean-title-cell small,
.gp-clean-title-cell a,
.gp-clean-vehicle-cell strong,
.gp-clean-vehicle-cell small,
.gp-clean-vehicle-cell span,
.gp-clean-vehicle-cell em,
.gp-clean-part-cell strong,
.gp-clean-part-cell small,
.gp-clean-part-cell span{
  display:block;
}
.gp-clean-title-main{
  max-width:100%;
  font-size:13px;
  line-height:1.35;
  color:var(--gp-text,#111827);
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-title-ar{
  margin-top:4px;
  max-width:100%;
  font-size:12px;
  line-height:1.35;
  color:var(--gp-text,#111827);
  opacity:.82;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-title-raw{
  margin-top:5px;
  max-width:100%;
  font-size:11px;
  line-height:1.35;
  color:var(--gp-muted,#64748b);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-source-link{
  width:max-content;
  margin-top:5px;
  font-size:11px;
  font-weight:850;
  color:#5b4bdb;
  text-decoration:none;
}
.gp-clean-vehicle-cell strong,
.gp-clean-part-cell strong{
  font-size:12px;
  line-height:1.35;
  font-weight:900;
  color:var(--gp-text,#111827);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-vehicle-cell small,
.gp-clean-part-cell small{
  margin-top:3px;
  color:var(--gp-muted,#64748b);
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-vehicle-cell span{
  margin-top:5px;
  padding:5px 7px;
  width:max-content;
  max-width:100%;
  border-radius:10px;
  background:rgba(99,102,241,.08);
  color:#3730a3;
  font-size:11px;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-vehicle-cell em{
  margin-top:4px;
  max-width:100%;
  color:var(--gp-muted,#64748b);
  font-size:10.5px;
  font-style:normal;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gp-clean-part-cell>span{
  margin-top:5px;
  color:var(--gp-muted,#64748b);
  font-size:11px;
  font-weight:800;
}
.gp-clean-issues{
  margin-top:7px;
  min-width:0;
  gap:4px;
}
.gp-missing-chip{
  padding:4px 7px;
  font-size:10.5px;
}
.gp-clean-price-cell{
  padding-top:17px!important;
  white-space:nowrap;
  color:var(--gp-text,#111827);
}
.gp-clean-action-cell{
  padding-top:13px!important;
  text-align:center;
}
.gp-clean-action-cell .gp-action-row{justify-content:center}
.gp-clean-action-cell .gp-icon-btn{
  width:34px;
  height:34px;
  border-radius:12px;
}
.gp-clean-row-ready td:first-child{box-shadow:inset 4px 0 0 #22c55e}
.gp-clean-row-auto_selected td:first-child{box-shadow:inset 4px 0 0 #3b82f6}
.gp-clean-row-missing_brand td:first-child{box-shadow:inset 4px 0 0 #facc15}
.gp-clean-row-missing_model td:first-child{box-shadow:inset 4px 0 0 #fb923c}
.gp-clean-row-missing_range td:first-child{box-shadow:inset 4px 0 0 #f97316}
.gp-clean-row-missing_category td:first-child{box-shadow:inset 4px 0 0 #a855f7}
.gp-clean-row-missing_image td:first-child{box-shadow:inset 4px 0 0 #6366f1}
.gp-clean-row-missing_price td:first-child{box-shadow:inset 4px 0 0 #e11d48}
.gp-clean-row-ready,.gp-clean-row-auto_selected,.gp-clean-row-missing_brand,.gp-clean-row-missing_model,.gp-clean-row-missing_range,.gp-clean-row-missing_category,.gp-clean-row-missing_image,.gp-clean-row-missing_price{box-shadow:none!important}
@media (max-width: 1300px){
  .gp-import-clean-results .gp-import-results-head-04l{grid-template-columns:1fr}
  .gp-import-clean-results .gp-import-row-actions-04l{justify-content:flex-start;min-width:0}
  .gp-import-clean-results .gp-import-stats-04n{grid-template-columns:repeat(4,minmax(110px,1fr))}
}
@media (max-width: 900px){
  .gp-import-clean-results .gp-import-stats-04n{grid-template-columns:repeat(2,minmax(110px,1fr))}
  .gp-clean-img-pop{left:auto;right:-20px;top:58px;width:260px;height:200px}
}

/* Patch 04R — Clean CSV edit modal and part-number review polish */
.gp-clean-status-badge.missing_part_number{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
.gp-missing-part_number{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
.gp-clean-row-missing_part_number td:first-child{box-shadow:inset 4px 0 0 #f59e0b}
.gp-import-clean-results .gp-import-stats-04n{grid-template-columns:repeat(10,minmax(86px,1fr))}
.gp-import-clean-results .gp-import-stats-04n>div{min-width:0}
.gp-import-clean-results .gp-import-stats-04n>div strong{font-size:22px}
.gp-import-clean-results .gp-import-stats-04n>div span{font-size:11px;line-height:1.15}

.gp-clean-edit-shell{
  display:grid;
  grid-template-columns:minmax(0,60%) minmax(320px,40%);
  gap:18px;
  align-items:start;
  max-width:100%;
}
.gp-clean-edit-left,.gp-clean-edit-right{min-width:0}
.gp-clean-edit-section-title{
  display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:0 0 12px;
}
.gp-clean-edit-section-title strong{font-size:14px;font-weight:900;color:var(--gp-text,#111827)}
.gp-clean-edit-section-title span{font-size:11px;font-weight:800;color:var(--gp-muted,#64748b)}
.gp-clean-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 12px}
.gp-clean-edit-grid .gp-field input,
.gp-clean-edit-grid .gp-field select,
.gp-clean-edit-right .gp-field textarea{
  min-height:40px;border-radius:13px;font-weight:750;
}
.gp-clean-edit-right{display:flex;flex-direction:column;gap:12px;position:sticky;top:0}
.gp-clean-edit-image-card,.gp-clean-edit-fixed-card{
  border:1px solid var(--gp-border,#e3e7f4);border-radius:18px;background:rgba(248,250,252,.72);padding:12px;
}
.gp-clean-edit-image-card>strong,.gp-clean-edit-fixed-card>strong{display:block;margin-bottom:10px;font-size:13px;font-weight:950;color:var(--gp-text,#111827)}
.gp-clean-edit-image-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.gp-clean-edit-image-grid a{display:block;border-radius:14px;overflow:hidden;background:#fff;border:1px solid var(--gp-border,#dfe3f3);height:86px}
.gp-clean-edit-image-grid img{width:100%;height:100%;object-fit:contain;display:block}
.gp-clean-edit-full{grid-column:1/-1}
.gp-clean-edit-right .gp-field textarea{min-height:112px;resize:vertical;font-size:12px;line-height:1.35}
.gp-clean-edit-fixed-card dl{margin:0;display:grid;grid-template-columns:94px minmax(0,1fr);gap:7px 10px;align-items:start}
.gp-clean-edit-fixed-card dt{font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--gp-muted,#64748b);font-weight:900}
.gp-clean-edit-fixed-card dd{margin:0;font-size:12px;color:var(--gp-text,#111827);font-weight:750;word-break:break-word;line-height:1.35}
.gp-clean-edit-fixed-card a{color:#5b4bdb;text-decoration:none;font-weight:900}
.gp-clean-edit-actions-sticky{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:8px;padding-top:10px;background:linear-gradient(to top,var(--gp-card,#fff),rgba(255,255,255,.78))}
[data-import-view-body] .gp-clean-edit-shell .gp-field span{font-size:11px;font-weight:900;color:var(--gp-muted,#64748b)}
[data-import-view-modal] .gp-modal-card{max-width:min(1080px,calc(100vw - 40px))!important;width:min(1080px,calc(100vw - 40px))!important}
[data-import-view-modal] .gp-modal-body{max-height:calc(100vh - 170px);overflow:auto;padding-right:8px}

@media (max-width: 1300px){
  .gp-import-clean-results .gp-import-stats-04n{grid-template-columns:repeat(5,minmax(100px,1fr))}
}
@media (max-width: 980px){
  .gp-clean-edit-shell{grid-template-columns:1fr}
  .gp-clean-edit-right{position:static}
  .gp-clean-edit-grid{grid-template-columns:1fr}
  .gp-import-clean-results .gp-import-stats-04n{grid-template-columns:repeat(2,minmax(110px,1fr))}
}

/* Patch 04S — status simplification + smarter filter colors */
.gp-clean-table-polished .gp-col-row{width:44px}
.gp-clean-table-polished .gp-col-image{width:82px}
.gp-clean-table-polished .gp-col-title{width:42%}
.gp-clean-table-polished .gp-col-vehicle{width:210px}
.gp-clean-table-polished .gp-col-part{width:160px}
.gp-clean-table-polished .gp-col-price{width:96px}
.gp-clean-table-polished .gp-col-action{width:72px}
.gp-clean-status-cell,.gp-col-status{display:none!important}
.gp-clean-table-polished tbody tr td{transition:background .15s ease, box-shadow .15s ease}
.gp-clean-row-ready,.gp-clean-row-auto_selected,.gp-clean-row-missing_brand,.gp-clean-row-missing_model,.gp-clean-row-missing_range,.gp-clean-row-missing_category,.gp-clean-row-missing_image,.gp-clean-row-missing_price,.gp-clean-row-missing_part_number{box-shadow:none!important}
.gp-clean-row-ready td:first-child,.gp-clean-row-auto_selected td:first-child,.gp-clean-row-missing_brand td:first-child,.gp-clean-row-missing_model td:first-child,.gp-clean-row-missing_range td:first-child,.gp-clean-row-missing_category td:first-child,.gp-clean-row-missing_image td:first-child,.gp-clean-row-missing_price td:first-child,.gp-clean-row-missing_part_number td:first-child{box-shadow:none!important}
.gp-clean-image-cell{padding-top:12px!important;text-align:center;overflow:visible!important}
.gp-clean-img-wrap,.gp-clean-no-img{position:relative;display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:15px;overflow:visible;background:rgba(148,163,184,.08)}
.gp-clean-img-wrap>img{width:56px;height:56px;border-radius:15px;object-fit:cover;border:1px solid var(--gp-border,#dfe3f3);box-shadow:0 8px 18px rgba(15,23,42,.10)}
.gp-clean-no-img{border:1px dashed var(--gp-border,#dfe3f3);color:var(--gp-muted,#64748b)}
.gp-clean-image-line{position:absolute;left:7px;right:7px;bottom:-8px;height:4px;border-radius:999px;background:#94a3b8;box-shadow:0 4px 10px rgba(15,23,42,.10)}
.gp-clean-image-line.ready{background:#22c55e}
.gp-clean-image-line.auto_selected{background:#3b82f6}
.gp-clean-image-line.needs_review{background:#f59e0b}
.gp-clean-image-line.missing_brand{background:#facc15}
.gp-clean-image-line.missing_model{background:#fb923c}
.gp-clean-image-line.missing_range{background:#f97316}
.gp-clean-image-line.missing_category{background:#a855f7}
.gp-clean-image-line.missing_image{background:#6366f1}
.gp-clean-image-line.missing_price{background:#e11d48}
.gp-clean-image-line.missing_part_number{background:#f59e0b}
.gp-clean-issues,.gp-missing-chip{display:none!important}
.gp-clean-part-cell>span{margin-top:5px;color:var(--gp-muted,#64748b);font-size:11px;font-weight:800}
.gp-clean-filters button{position:relative;overflow:hidden}
.gp-clean-filters button::after{content:"";position:absolute;left:10px;right:10px;bottom:4px;height:3px;border-radius:999px;background:transparent;opacity:.95}
.gp-clean-filters button[data-clean-filter="ready"]::after{background:#22c55e}
.gp-clean-filters button[data-clean-filter="auto_selected"]::after{background:#3b82f6}
.gp-clean-filters button[data-clean-filter="needs_review"]::after{background:#f59e0b}
.gp-clean-filters button[data-clean-filter="part_number"]::after{background:#f59e0b}
.gp-clean-filters button[data-clean-filter="brand"]::after{background:#facc15}
.gp-clean-filters button[data-clean-filter="model"]::after{background:#fb923c}
.gp-clean-filters button[data-clean-filter="year_range"]::after{background:#f97316}
.gp-clean-filters button[data-clean-filter="category"]::after{background:#a855f7}
.gp-clean-filters button[data-clean-filter="images"]::after{background:#6366f1}
.gp-clean-filters button[data-clean-filter="source_price"]::after{background:#e11d48}
.gp-clean-filters button.active{color:#fff;border-color:transparent;box-shadow:0 10px 22px rgba(15,23,42,.13)}
.gp-clean-filters button.active[data-clean-filter="all"]{background:#6d5dfc}
.gp-clean-filters button.active[data-clean-filter="ready"]{background:#16a34a}
.gp-clean-filters button.active[data-clean-filter="auto_selected"]{background:#2563eb}
.gp-clean-filters button.active[data-clean-filter="needs_review"]{background:#d97706}
.gp-clean-filters button.active[data-clean-filter="part_number"]{background:#d97706}
.gp-clean-filters button.active[data-clean-filter="brand"]{background:#ca8a04}
.gp-clean-filters button.active[data-clean-filter="model"]{background:#ea580c}
.gp-clean-filters button.active[data-clean-filter="year_range"]{background:#f97316}
.gp-clean-filters button.active[data-clean-filter="category"]{background:#9333ea}
.gp-clean-filters button.active[data-clean-filter="images"]{background:#4f46e5}
.gp-clean-filters button.active[data-clean-filter="source_price"]{background:#be123c}
.gp-clean-filters button.active::after{background:rgba(255,255,255,.72)}
.gp-clean-review-toolbar:has(button[data-clean-filter="ready"].active){border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.06)}
.gp-clean-review-toolbar:has(button[data-clean-filter="auto_selected"].active){border-color:rgba(59,130,246,.35);background:rgba(59,130,246,.06)}
.gp-clean-review-toolbar:has(button[data-clean-filter="needs_review"].active),
.gp-clean-review-toolbar:has(button[data-clean-filter="part_number"].active){border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.07)}
.gp-clean-review-toolbar:has(button[data-clean-filter="brand"].active){border-color:rgba(250,204,21,.45);background:rgba(250,204,21,.09)}
.gp-clean-review-toolbar:has(button[data-clean-filter="model"].active){border-color:rgba(251,146,60,.4);background:rgba(251,146,60,.07)}
.gp-clean-review-toolbar:has(button[data-clean-filter="year_range"].active){border-color:rgba(249,115,22,.4);background:rgba(249,115,22,.07)}
.gp-clean-review-toolbar:has(button[data-clean-filter="category"].active){border-color:rgba(168,85,247,.38);background:rgba(168,85,247,.07)}
.gp-clean-review-toolbar:has(button[data-clean-filter="images"].active){border-color:rgba(99,102,241,.38);background:rgba(99,102,241,.07)}
.gp-clean-review-toolbar:has(button[data-clean-filter="source_price"].active){border-color:rgba(225,29,72,.35);background:rgba(225,29,72,.07)}
@supports not selector(:has(*)){
  .gp-clean-filters[data-active-filter="ready"] button.active{background:#16a34a}
  .gp-clean-filters[data-active-filter="auto_selected"] button.active{background:#2563eb}
  .gp-clean-filters[data-active-filter="part_number"] button.active,
  .gp-clean-filters[data-active-filter="needs_review"] button.active{background:#d97706}
}

/* Patch 04W — polished integrated filter counters */
.gp-clean-filters{
  gap:8px!important;
}
.gp-clean-filters button[data-clean-filter]{
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-height:34px!important;
  padding:7px 10px 7px 12px!important;
  line-height:1!important;
  overflow:visible!important;
  white-space:nowrap!important;
}
.gp-clean-filter-count{
  position:static!important;
  transform:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:22px!important;
  height:20px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  font-size:11px!important;
  font-weight:900!important;
  letter-spacing:.01em!important;
  background:rgba(100,116,139,.12)!important;
  color:var(--gp-text,#0f172a)!important;
  border:1px solid rgba(100,116,139,.18)!important;
  box-shadow:none!important;
}
.gp-clean-filters button[data-clean-filter="ready"] .gp-clean-filter-count{background:rgba(34,197,94,.13)!important;color:#15803d!important;border-color:rgba(34,197,94,.28)!important}
.gp-clean-filters button[data-clean-filter="auto_selected"] .gp-clean-filter-count{background:rgba(59,130,246,.13)!important;color:#1d4ed8!important;border-color:rgba(59,130,246,.28)!important}
.gp-clean-filters button[data-clean-filter="needs_review"] .gp-clean-filter-count,
.gp-clean-filters button[data-clean-filter="part_number"] .gp-clean-filter-count{background:rgba(245,158,11,.15)!important;color:#b45309!important;border-color:rgba(245,158,11,.32)!important}
.gp-clean-filters button[data-clean-filter="brand"] .gp-clean-filter-count{background:rgba(250,204,21,.18)!important;color:#92400e!important;border-color:rgba(250,204,21,.38)!important}
.gp-clean-filters button[data-clean-filter="model"] .gp-clean-filter-count{background:rgba(251,146,60,.16)!important;color:#c2410c!important;border-color:rgba(251,146,60,.33)!important}
.gp-clean-filters button[data-clean-filter="year_range"] .gp-clean-filter-count{background:rgba(249,115,22,.15)!important;color:#c2410c!important;border-color:rgba(249,115,22,.33)!important}
.gp-clean-filters button[data-clean-filter="category"] .gp-clean-filter-count{background:rgba(168,85,247,.13)!important;color:#7e22ce!important;border-color:rgba(168,85,247,.28)!important}
.gp-clean-filters button[data-clean-filter="images"] .gp-clean-filter-count{background:rgba(99,102,241,.13)!important;color:#4338ca!important;border-color:rgba(99,102,241,.28)!important}
.gp-clean-filters button[data-clean-filter="source_price"] .gp-clean-filter-count{background:rgba(225,29,72,.13)!important;color:#be123c!important;border-color:rgba(225,29,72,.30)!important}
.gp-clean-filters button.active .gp-clean-filter-count{
  background:rgba(255,255,255,.22)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.35)!important;
}
.gp-clean-filters button.is-disabled{
  opacity:.48!important;
  cursor:not-allowed!important;
  filter:grayscale(.25);
}
.gp-clean-filters button.is-disabled .gp-clean-filter-count{
  background:rgba(148,163,184,.10)!important;
  color:#94a3b8!important;
  border-color:rgba(148,163,184,.16)!important;
}

/* Patch 04X — clean row edit modal layout fix + gallery workflow polish */
[data-import-view-modal] .gp-import-view-card.gp-import-view-card-04l{
  width:min(1180px,calc(100vw - 48px))!important;
  max-width:min(1180px,calc(100vw - 48px))!important;
  max-height:calc(100vh - 54px)!important;
  overflow:hidden!important;
}
[data-import-view-modal] .gp-import-view-card.gp-import-view-card-04l>header{
  flex-shrink:0!important;
  border-bottom:1px solid var(--gp-border,#e3e7f4)!important;
}
[data-import-view-modal] .gp-import-view-body{
  display:block!important;
  width:100%!important;
  max-height:calc(100vh - 160px)!important;
  overflow:auto!important;
  padding:16px 18px 18px!important;
  box-sizing:border-box!important;
}
[data-import-view-modal] .gp-clean-edit-shell{
  display:grid!important;
  grid-template-columns:minmax(0,60%) minmax(340px,40%)!important;
  gap:18px!important;
  align-items:start!important;
  width:100%!important;
  max-width:100%!important;
}
[data-import-view-modal] .gp-clean-edit-left,
[data-import-view-modal] .gp-clean-edit-right{
  min-width:0!important;
  width:100%!important;
}
[data-import-view-modal] .gp-clean-edit-left{
  padding-right:4px!important;
}
[data-import-view-modal] .gp-clean-edit-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
}
[data-import-view-modal] .gp-clean-edit-grid .gp-field{min-width:0!important;margin:0!important}
[data-import-view-modal] .gp-clean-edit-grid .gp-field input,
[data-import-view-modal] .gp-clean-edit-grid .gp-field select,
[data-import-view-modal] .gp-clean-edit-right .gp-field textarea{
  width:100%!important;
  box-sizing:border-box!important;
}
[data-import-view-modal] .gp-clean-edit-right{
  position:sticky!important;
  top:0!important;
  align-self:start!important;
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}
[data-import-view-modal] .gp-clean-edit-image-card,
[data-import-view-modal] .gp-clean-edit-fixed-card{
  width:100%!important;
  box-sizing:border-box!important;
  background:rgba(248,250,252,.92)!important;
}
[data-import-view-modal] .gp-clean-edit-image-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  margin-bottom:10px!important;
}
[data-import-view-modal] .gp-clean-edit-image-grid a{
  height:92px!important;
  border-radius:14px!important;
  display:block!important;
}
[data-import-view-modal] .gp-clean-edit-image-grid img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
}
[data-import-view-modal] .gp-clean-edit-right textarea[name="images"]{
  min-height:130px!important;
  max-height:210px!important;
  overflow:auto!important;
  white-space:pre-wrap!important;
  word-break:break-all!important;
}
[data-import-view-modal] .gp-clean-edit-fixed-card dl{
  grid-template-columns:100px minmax(0,1fr)!important;
}
[data-import-view-modal] .gp-clean-edit-actions-sticky{
  position:sticky!important;
  bottom:0!important;
  z-index:5!important;
  background:linear-gradient(to top,var(--gp-card,#fff) 78%,rgba(255,255,255,.72))!important;
  padding:12px 0 0!important;
}
.gp-field select[name="image_mode"] option[value="local_gallery"]{font-weight:900}
@media (max-width: 980px){
  [data-import-view-modal] .gp-clean-edit-shell{grid-template-columns:1fr!important}
  [data-import-view-modal] .gp-clean-edit-right{position:static!important}
  [data-import-view-modal] .gp-clean-edit-grid{grid-template-columns:1fr!important}
}


/* Patch 04Y — visible Clean CSV progress popup */
.gp-clean-progress-modal{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:rgba(15,23,42,.42)!important;
  backdrop-filter:blur(8px)!important;
  padding:20px!important;
}
.gp-clean-progress-modal[hidden]{display:none!important}
.gp-clean-progress-card{
  width:min(520px,calc(100vw - 34px))!important;
  border-radius:24px!important;
  background:var(--gp-card,#fff)!important;
  border:1px solid var(--gp-border,#dfe3f3)!important;
  box-shadow:0 26px 80px rgba(15,23,42,.28)!important;
  padding:18px!important;
  color:var(--gp-text,#0f172a)!important;
}
.gp-clean-progress-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:14px!important;margin-bottom:14px!important}
.gp-clean-progress-head small{display:block!important;color:var(--gp-muted,#64748b)!important;font-size:12px!important;font-weight:800!important;margin-bottom:4px!important}
.gp-clean-progress-head strong{display:block!important;font-size:20px!important;font-weight:950!important;letter-spacing:-.03em!important}
.gp-clean-progress-percent{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:8px!important;font-weight:950!important}
.gp-clean-progress-percent span{font-size:28px!important;letter-spacing:-.05em!important;color:#4f46e5!important}
.gp-clean-progress-percent em{font-style:normal!important;color:var(--gp-muted,#64748b)!important;font-size:12px!important;font-weight:900!important;padding:5px 9px!important;border-radius:999px!important;background:rgba(100,116,139,.10)!important}
.gp-clean-progress-bar{height:12px!important;border-radius:999px!important;background:rgba(99,102,241,.12)!important;overflow:hidden!important;border:1px solid rgba(99,102,241,.16)!important;margin-bottom:14px!important}
.gp-clean-progress-bar span{display:block!important;height:100%!important;width:0;background:linear-gradient(90deg,#6d5dfc,#22c55e)!important;border-radius:999px!important;transition:width .35s ease!important}
.gp-clean-progress-stage{font-size:15px!important;font-weight:950!important;margin-bottom:6px!important}
.gp-clean-progress-detail{font-size:13px!important;line-height:1.45!important;color:var(--gp-muted,#64748b)!important;margin-bottom:12px!important}
.gp-clean-progress-log{list-style:none!important;margin:0!important;padding:10px!important;border-radius:16px!important;background:rgba(248,250,252,.92)!important;border:1px solid var(--gp-border,#dfe3f3)!important;max-height:142px!important;overflow:auto!important}
.gp-clean-progress-log li{font-size:12px!important;color:var(--gp-muted,#64748b)!important;padding:5px 2px!important;border-bottom:1px dashed rgba(148,163,184,.25)!important}
.gp-clean-progress-log li:first-child{color:var(--gp-text,#0f172a)!important;font-weight:900!important}
.gp-clean-progress-log li:last-child{border-bottom:0!important}
.gp-clean-progress-modal.is-warning .gp-clean-progress-card{border-color:rgba(245,158,11,.45)!important;box-shadow:0 26px 90px rgba(245,158,11,.18)!important}
.gp-clean-progress-modal.is-warning .gp-clean-progress-percent span{color:#d97706!important}
.gp-clean-progress-modal.is-warning .gp-clean-progress-bar span{background:linear-gradient(90deg,#f59e0b,#ef4444)!important}
.gp-clean-progress-modal.is-done .gp-clean-progress-percent span{color:#16a34a!important}
.gp-clean-progress-modal.is-error .gp-clean-progress-card{border-color:rgba(225,29,72,.45)!important;box-shadow:0 26px 90px rgba(225,29,72,.18)!important}
.gp-clean-progress-modal.is-error .gp-clean-progress-percent span{color:#be123c!important}

/* Patch URL debug — clean row source enrichment diagnostics */
.gp-clean-debug-card{
  border:1px dashed var(--gp-border,#d8def0);
  border-radius:18px;
  background:rgba(255,255,255,.72);
  padding:12px;
  width:100%;
  box-sizing:border-box;
}
.gp-clean-debug-card>strong{display:block;margin-bottom:10px;font-size:13px;font-weight:950;color:var(--gp-text,#111827)}
.gp-clean-debug-card dl{margin:0 0 10px;display:grid;grid-template-columns:132px minmax(0,1fr);gap:7px 10px;align-items:start}
.gp-clean-debug-card dt{font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--gp-muted,#64748b);font-weight:900}
.gp-clean-debug-card dd{margin:0;font-size:12px;color:var(--gp-text,#111827);font-weight:850;word-break:break-word;line-height:1.35}
.gp-clean-debug-details{border-top:1px solid rgba(148,163,184,.28);padding-top:8px;margin-top:8px}
.gp-clean-debug-details summary{cursor:pointer;font-size:12px;font-weight:900;color:var(--gp-text,#111827)}
.gp-clean-debug-list{margin:8px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
.gp-clean-debug-list li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;align-items:start;font-size:11.5px;color:var(--gp-muted,#64748b)}
.gp-clean-debug-list li>span{font-weight:950;color:var(--gp-text,#111827)}
.gp-clean-debug-list code{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:#4f46e5;background:rgba(79,70,229,.08);border-radius:8px;padding:3px 6px}
.gp-clean-debug-list em{grid-column:2;display:block;font-style:normal;font-weight:800;color:var(--gp-muted,#64748b)}
[data-import-view-modal] .gp-clean-debug-card{width:100%!important;box-sizing:border-box!important}

/* Patch: stable image review tabs + broken image separation */
.gp-clean-image-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 12px}
.gp-clean-image-tabs button{border:1px solid rgba(148,163,184,.35);background:rgba(248,250,252,.9);border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800;color:#475569;cursor:pointer}
.gp-clean-image-tabs button.active{background:#eef2ff;border-color:#8b5cf6;color:#4338ca;box-shadow:0 8px 18px rgba(79,70,229,.10)}
.gp-clean-image-tabs button span{display:inline-flex;min-width:18px;height:18px;align-items:center;justify-content:center;border-radius:999px;background:#fff;margin-left:5px;font-size:11px}
.gp-clean-edit-image-grid[hidden]{display:none!important}
.gp-clean-image-thumb{position:relative;display:inline-flex;border-radius:14px;overflow:hidden;border:1px solid rgba(148,163,184,.32);background:#fff}
.gp-clean-image-thumb-broken{border-color:rgba(239,68,68,.45);background:#fff1f2}
.gp-clean-image-thumb-broken:after{content:'Broken';position:absolute;left:6px;bottom:6px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;font-weight:800;padding:3px 6px;box-shadow:0 8px 18px rgba(239,68,68,.25)}
.gp-clean-source-tools{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:1px dashed rgba(148,163,184,.45)}
.gp-clean-image-advanced textarea[name="broken_images"]{border-color:rgba(239,68,68,.28);background:#fff7f7}
@media (prefers-color-scheme: dark){
  .gp-clean-image-tabs button{background:rgba(30,41,59,.9);color:#cbd5e1;border-color:rgba(148,163,184,.25)}
  .gp-clean-image-tabs button.active{background:rgba(79,70,229,.25);color:#e0e7ff;border-color:rgba(129,140,248,.5)}
  .gp-clean-image-thumb{background:rgba(15,23,42,.8)}
  .gp-clean-image-thumb-broken{background:rgba(127,29,29,.25)}
  .gp-clean-image-advanced textarea[name="broken_images"]{background:rgba(127,29,29,.12)}
}
