/* Compact market views. Account scoping and PMA grouping remain server-owned. */
.portal-content.market-view{max-width:1760px;padding:28px 32px 56px}
.market-view .page-heading{gap:16px;margin-bottom:20px;align-items:center}
.market-view .page-heading h1{font-size:28px;margin-bottom:4px}
.market-view .page-heading p{font-size:13px;margin:0}
.market-view .btn{min-height:34px;padding:7px 12px;font-size:12px;border-radius:6px;gap:6px}
.market-view .stats{gap:12px;margin:18px 0}
.market-view .stat{padding:14px 16px;border-radius:8px}
.market-view .stat>span{font-size:11px}
.market-view .stat>strong{font-size:26px;line-height:1.25;margin:5px 0}
.market-view .stat>small{font-size:11px;line-height:1.3}
.market-view .panel{padding:16px;border-radius:10px}
.market-view .af-channel-tabs{gap:0;margin:0 0 12px}
.market-view .af-channel-tabs .btn{border-radius:0;min-height:32px;padding:6px 12px;border:1px solid var(--line)}
.market-view .af-channel-tabs .btn:first-child{border-radius:6px 0 0 6px}
.market-view .af-channel-tabs .btn:last-child{border-radius:0 6px 6px 0}
.market-view .af-channel-tabs .btn+.btn{margin-left:-1px}
.market-view .af-channel-tabs .btn.navy{background:var(--deepteal);border-color:var(--deepteal);position:relative}
.market-view .af-channel-tabs span{margin-left:3px;font-size:11px;padding:0 5px}
.market-view .channel-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#73879e}
.market-view .channel-ml{background:#4f83db}.market-view .channel-shopee{background:#fa7245}
.market-view .channel-amazon{background:#e6b449}.market-view .channel-magalu{background:#368cdd}
.market-view .channel-ifood{background:#ef5269}
.market-view .toolbar{gap:10px;margin:0 0 10px}
.market-view .toolbar label{font-size:11px;min-width:155px}
.market-view .toolbar input,.market-view .toolbar select{min-height:34px;height:34px;padding:5px 9px;margin-top:3px;font-size:12px;border-radius:6px}
.market-view .toolbar .search{min-width:230px;flex:1 1 240px}
.market-view .toolbar .pma-product-filter{flex:1 1 320px;max-width:520px}
.market-view .panel p.subtle{font-size:11px;line-height:1.5;margin:8px 0 14px}
.market-view .table-wrap{border-radius:0}
.market-view .table-wrap table{width:100%;font-size:12px;line-height:1.4}
.market-view .table-wrap th{padding:9px 10px;font-size:11px;color:var(--muted);background:#f5f8fa}
.market-view .table-wrap td{padding:10px;vertical-align:middle;max-width:none}
.market-view .table-wrap tbody tr:hover{background:#f8fbfc}
.market-view .table-wrap td:first-child{min-width:0}
.market-view .table-wrap small{font-size:10px;line-height:1.4;margin-top:3px}
.market-view .table-wrap .num{white-space:nowrap}
.market-view .table-wrap .num small{white-space:normal;color:var(--muted)}
.market-view .table-wrap .negative,.market-view .table-wrap .negative small{color:#cc3656}
.market-view .market-offer-table{table-layout:fixed;min-width:1060px}
.market-offer-table .channel-col{width:7%}.market-offer-table .offer-product-col{width:28%}
.market-offer-table .seller-col{width:14%}.market-offer-table .money-col{width:10%}
.market-offer-table .gap-col{width:9%}.market-offer-table .status-col{width:13%}
.market-offer-table .seen-col{width:9%}
.market-view .market-product-name{font-size:12px;font-weight:600;line-height:1.4}
.market-view .market-channel{font-size:10px;font-weight:600;color:var(--muted)}
.market-view .market-seller-link{font-size:12px;font-weight:650;line-height:1.4;color:var(--deepteal);text-decoration:none}
.market-view .market-seller-link:hover{text-decoration:underline}
.market-view .market-seen{display:block;font-size:10px;color:var(--muted);white-space:nowrap;line-height:1.4}
.market-view .market-seen small{display:block;margin-top:1px}
.market-view .badge{padding:3px 6px;font-size:10px;line-height:1.35;border-radius:4px}
.market-view .table-action{font-size:11px;padding:0;margin-top:4px;line-height:1.4}
.market-view .table-foot{margin-top:14px;font-size:12px;gap:12px}
.market-view .pma-product-table{min-width:1000px}
.market-view .pma-product-table .product-col{width:31%}
.market-view .pma-product-table .floor-col{width:11%}
.market-view .pma-product-identity{gap:10px;align-items:center}
.market-view .pma-product-photo{width:52px;height:52px;flex-basis:52px;border-radius:6px}
.market-view .pma-product-photo img{padding:3px}
.market-view .pma-product-photo span{font-size:9px}
.market-view .pma-product-floor strong{font-size:12px}
.market-view .pma-sellers{display:block}
.market-view .pma-offer-head,.market-view .pma-seller-offer{display:grid;grid-template-columns:minmax(130px,1fr) 110px 108px 96px;align-items:center;gap:12px}
.market-view .pma-offer-head>span:nth-child(2),.market-view .pma-offer-head>span:nth-child(3){text-align:right}
.market-view .pma-seller-offer{margin:0;padding:7px 0;min-height:45px}
.market-view .pma-seller-offer+.pma-seller-offer{border-top:1px solid var(--line)}
.market-view .pma-seller-identity{min-width:0;overflow-wrap:anywhere}
.market-view .pma-seller-channel{display:block}
.market-view .pma-seller-price,.market-view .pma-seller-gap{font-size:12px;color:#cc3656;white-space:nowrap;text-align:right;margin:0}
.market-view .pma-seller-gap small{display:block;color:#cc3656}
.market-view .pma-product-floor small{white-space:normal}
@media(max-width:1100px){
 .portal-content.market-view{padding:24px 20px 44px}
 .market-view .toolbar .pma-product-filter{max-width:none}
 .market-view .market-channels{gap:5px}
 .market-view .market-channels .btn{border-radius:5px!important;margin-left:0!important}
}
@media(max-width:760px){
 .portal-content.market-view{padding:22px 14px 40px}
 .market-view .panel{padding:12px}
 .market-view .page-heading{align-items:flex-start}
 .market-view .page-heading h1{font-size:24px}
 .market-view .stats{gap:8px}
 .market-view .stat{padding:12px}
 .market-view .stat>strong{font-size:24px}
 .market-view .toolbar{gap:8px}
 .market-view .toolbar .search,.market-view .toolbar .pma-product-filter{flex:1 1 100%;min-width:0}
 .market-view .toolbar label{min-width:0}
 .market-view .toolbar>.btn{flex-shrink:0}
 .market-view .btn{min-height:40px}
 .market-view .market-channels .btn{min-height:36px;padding:6px 8px;font-size:11px}
 .market-view .table-foot{flex-wrap:wrap;justify-content:center}
 .market-view .pma-product-table{min-width:0}
 .market-view .pma-product-table tr{padding:12px 0}
 .market-view .pma-product-table td{padding:6px 0;min-width:0;max-width:none}
 .market-view .pma-product-table .pma-product-floor{justify-content:flex-start}
 .market-view .pma-product-identity strong{font-size:13px}
 .market-view .pma-seller-offer{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 12px;padding:10px 0}
 .market-view .pma-seller-identity{grid-column:1/-1}
 .market-view .pma-seller-price,.market-view .pma-seller-gap{text-align:left}
 .market-view .pma-seller-seen{grid-column:1/-1;display:flex;align-items:baseline;gap:6px}
 .market-view .pma-seller-offer [data-label]:before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;font-weight:400;margin-bottom:2px}
 .market-view .pma-seller-seen .market-seen small{display:inline;margin-left:4px}
}

/* Seller details share the compact comparison style. */
dialog.seller-offers-dialog{width:min(1320px,calc(100vw - 32px));max-width:none;max-height:90vh}
.seller-offers-dialog .seller-offers-table{min-width:900px;table-layout:fixed}
.seller-offers-table th:first-child{width:38%}
.seller-offers-table th:nth-child(2){width:13%}
.seller-offers-table th:nth-child(3){width:12%}
.seller-offers-table th:nth-child(4){width:11%}
.seller-offers-table th:nth-child(5){width:14%}
.seller-offers-table th:nth-child(6){width:12%}
.seller-offers-dialog .market-seller-link{display:inline-block;margin-top:5px}
.seller-offers-dialog .table-wrap{max-height:60vh;overflow:auto}
.seller-offers-dialog th{position:sticky;top:0;z-index:1}
@media(max-width:760px){dialog.seller-offers-dialog{width:calc(100vw - 16px);padding:16px}.seller-offers-dialog .dialog-top h2{font-size:20px;overflow-wrap:anywhere}.seller-offers-dialog .af-channel-tabs{flex-wrap:wrap}}

/* Tenant PMA allowances */
.pma-rules-dialog{width:min(860px,calc(100vw - 28px));max-width:860px}
.pma-rules-fields{border:0;padding:0;margin:0;min-width:0;display:grid;gap:14px}
.pma-rules-fields:disabled{opacity:.85}
.pma-rule-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.pma-rule-heading h3{margin:0}
.pma-rule-check{display:flex;align-items:center;gap:10px;color:#23374a;font-weight:500}
.pma-rule-check input{width:18px;height:18px;flex:0 0 18px;margin:0;accent-color:#07887c}
.pma-promotion{border:1px solid #dce5ed;border-radius:10px;padding:18px;display:grid;gap:14px;background:#fafcfd}
.pma-rule-preview{display:grid;grid-template-columns:160px 1fr;gap:20px;padding:18px;background:#eaf7f4;border-radius:10px}
.pma-rule-preview p{margin:8px 0;line-height:1.7}
.pma-rule-preview small{line-height:1.5;display:block;color:#586e78}
.pma-rule-hint{display:block!important;white-space:normal!important;color:#087e75!important;line-height:1.4}
@media(max-width:650px){.pma-rule-preview{grid-template-columns:1fr}.pma-rules-dialog .form-grid{grid-template-columns:1fr}.pma-rule-heading{flex-wrap:wrap}}

/* Rules belong to the current customer and reuse the PMA permission. */
.pma-rules-page{max-width:1100px;margin:0 auto}
.pma-rules-page .pma-rule-channel-label{display:grid;gap:8px;max-width:340px}
.pma-rules-page>.notice{margin-top:0}
.pma-rules-page .dialog-bottom{flex-wrap:wrap}
@media(max-width:650px){.pma-rules-page{padding:18px}.pma-rules-page .form-grid{grid-template-columns:1fr}.pma-rules-page .dialog-bottom .btn{width:100%;text-align:center}}
