/* B21.38-A «التسعير الجماعي» — multi-target price-list builder. A large grid that scrolls inside its own box (both ways) with a
   two-row sticky header (the target name over its three columns) and a sticky item column, so a long list and many targets stay
   readable on a large screen; on a phone the cards and toolbars wrap and only the grid box scrolls (never the page). */
.mtb .mtb-links{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:4px;font-size:var(--fs-sm);color:var(--ink-2)}
.mtb .mtb-panel{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--s2,8px) var(--s3,12px);padding:var(--s2,8px) var(--s3,12px);
  margin-bottom:var(--s2,8px);border:1px solid var(--border);border-radius:var(--r);background:var(--surface)}
.mtb .mtb-panel > label{display:flex;flex-direction:column;gap:2px;font-size:var(--fs-sm)}
.mtb .mtb-step{flex-basis:100%;font-weight:800;font-size:var(--fs-sm);color:var(--accent-700)}
.mtb .mtb-cards{display:flex;flex-wrap:wrap;gap:var(--s2,8px);width:100%}
.mtb .mtb-card{display:flex;flex-direction:column;gap:6px;flex:1 1 220px;max-width:300px;padding:8px 10px;border:1px solid var(--border-2);
  border-radius:var(--r);background:var(--surface-2)}
.mtb .mtb-card label{display:flex;flex-direction:column;gap:2px;font-size:var(--fs-xs)}
.mtb .mtb-card .inp{width:100%}
.mtb .mtb-card-head{display:flex;gap:4px;align-items:center}
.mtb .mtb-row2{display:grid;grid-template-columns:1fr 90px;gap:6px}
.mtb .mtb-add{justify-content:center;align-items:flex-start;background:transparent;border-style:dashed}
.mtb .sm{font-size:var(--fs-xs)}

.mtb .mtb-grid-wrap{max-height:70vh;overflow:auto;border:1px solid var(--border);border-radius:var(--r)}
.mtb table.grid.mtb-grid{overflow:visible;border:none;border-radius:0;min-width:0}
.mtb .mtb-grid thead th{position:sticky;z-index:3}
.mtb .mtb-grid thead tr.mtb-h1 th{top:0;height:34px;box-sizing:border-box}
.mtb .mtb-grid thead tr.mtb-h2 th{top:34px}
.mtb .mtb-grid thead th[rowspan]{z-index:4}
.mtb .mtb-grid th.mtb-tgt{text-align:center;background:var(--accent-50);color:var(--accent-700)}
.mtb .mtb-grid th.mtb-tgt-start,.mtb .mtb-grid td.mtb-tgt-start{border-inline-start:2px solid var(--accent-100)}
.mtb .mtb-grid .mtb-name{position:sticky;inset-inline-start:0;z-index:2;background:var(--surface);max-width:220px;min-width:140px}
.mtb .mtb-grid thead .mtb-name{z-index:5;background:var(--surface-3)}
.mtb .mtb-grid tbody tr:nth-child(even) .mtb-name{background:var(--surface-2)}
.mtb .mtb-grid tbody tr.sel .mtb-name{background:var(--sel-2)}
.mtb .mtb-grid td.mtb-bad{background:var(--danger-bg)}
.mtb .mtb-grid td.mtb-old{color:var(--ink-3, #6b7280);text-decoration:line-through}
.mtb .mtb-grid td:has(.neg){height:auto}
.mtb .mtb-edit{display:flex;align-items:center;gap:4px;white-space:nowrap;justify-content:center}
.mtb .mtb-edit .inp{width:86px;min-width:0}
.mtb .mtb-selbar{position:sticky;top:0;z-index:6;background:var(--bg)}

.mtb .mtb-review{border:2px solid var(--accent);border-radius:var(--r);padding:var(--s2,8px) var(--s3,12px);margin:var(--s2,8px) 0;background:var(--surface)}
.mtb .mtb-review-cards{display:flex;flex-direction:column;gap:6px;margin:8px 0}
.mtb .mtb-review-card{border:1px solid var(--border);border-radius:var(--r);padding:6px 10px;background:var(--surface-2)}
.mtb .mtb-review-card summary{cursor:pointer;line-height:1.9}
.mtb .mtb-review-grid{max-height:40vh;overflow:auto;margin-top:6px}
.mtb .mtb-review-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
@media (max-width:560px){
  .mtb .mtb-card{max-width:none;flex-basis:100%}
  .mtb .mtb-grid-wrap{max-height:65vh}
  .mtb .mtb-grid .mtb-name{min-width:110px;max-width:130px}
  .mtb .mtb-panel .searchbar{max-width:none !important;flex:1 1 100%}
  .mtb .mtb-panel select.inp{max-width:none !important;flex:1 1 45%}
  .mtb .mtb-selbar{position:static}
}
