/* Pages « BDD Prestation », « PCM » et « Prix » — habillage v2 (actif seulement avec body.embed). */

/* ---- En-tête de page ---- */
body.embed .pg-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:6px 0 16px;flex-wrap:wrap}
body.embed .pg-title{font-size:20px;font-weight:600;letter-spacing:-.01em;margin:0}
body.embed .pg-sub{color:var(--sub);font-size:14px;line-height:1.5;margin:4px 0 0;max-width:760px}
body.embed .pg-sub b{color:var(--text);font-weight:600}
body.embed .help{display:inline-grid;place-items:center;width:18px;height:18px;margin-left:6px;border-radius:50%;background:var(--border);color:var(--sub);font:600 11px/1 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif;cursor:help;position:relative;vertical-align:middle;text-transform:none;letter-spacing:0}
body.embed .help:hover,body.embed .help:focus{background:var(--accent-soft);color:var(--accent);outline:none}
body.embed .help::after{content:attr(data-tip);position:absolute;left:50%;top:calc(100% + 8px);transform:translateX(-50%);width:max-content;max-width:260px;padding:8px 12px;border-radius:var(--radius-sm);background:var(--text);color:var(--card);font:400 13px/1.45 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif;opacity:0;pointer-events:none;transition:opacity .12s;z-index:50;white-space:normal;text-align:left}
body.embed .help:hover::after,body.embed .help:focus::after{opacity:1}

/* ---- Barres d'outils ---- */
body.embed #page-prestations-v2 .toolbar-card,body.embed #page-pcm .toolbar-card,body.embed #page-prix .toolbar-card{position:sticky;top:0;z-index:5}
body.embed #page-prestations-v2 .filters-row,body.embed #page-pcm .filters-row,body.embed #page-prix .filters-row{display:flex;flex-wrap:wrap;align-items:center}
body.embed #ptv2-search,body.embed #pcm-search,body.embed #prix-search{flex:1 1 280px;min-width:220px}

/* ---- Tableaux ---- */
body.embed #ptv2-table,body.embed #pcm-table,body.embed #prix-table{width:100%}
body.embed #page-prestations-v2 .table-card,body.embed #page-pcm .table-card,body.embed #page-prix .table-card{padding:0;overflow:auto;max-height:calc(100vh - 300px)}
body.embed #ptv2-table td,body.embed #pcm-table td,body.embed #prix-table td{vertical-align:middle}
body.embed .pcm-empty{text-align:center;padding:36px 16px!important;color:var(--sub);font-size:14px}
body.embed #ptv2-tbody .btn-edit-ptv2{width:36px;padding:0}
body.embed #ptv2-tbody .btn-show-links{background:var(--accent-soft);color:var(--accent);font-weight:500}
body.embed #ptv2-tbody .btn-show-links:hover{background:var(--accent-soft);border-color:var(--accent)}

/* ---- Panneau « produits liés » ---- */
body.embed #ptv2-link-panel{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
body.embed #ptv2-link-panel .cart-list{gap:8px}
body.embed #ptv2-link-panel .cart-item{border:1px solid var(--border);background:var(--card);border-radius:var(--radius-sm);padding:8px 8px 8px 12px;min-height:44px}
body.embed #ptv2-link-panel .chip-remove{width:32px;padding:0;color:var(--danger)}
body.embed #ptv2-link-search{width:100%}

/* ---- PCM : cases modifiables ---- */
body.embed #pcm-table .pcm-num{text-align:center;width:150px}
body.embed #pcm-table th.pcm-num{white-space:normal}
body.embed .pcm-cell-input,body.embed .pcm-all-input{width:96px;text-align:center;padding:6px 8px}
body.embed .pcm-cell-input:placeholder-shown{background:var(--chip)}
body.embed .pcm-cell-input.pcm-saved{border-color:var(--ok);background:var(--ok-soft)}
body.embed .pcm-cell-input.pcm-error{border-color:var(--danger);background:var(--danger-soft)}
body.embed .pcm-all-row td{background:var(--accent-soft)!important;border-bottom:1px solid var(--accent)!important}
body.embed .pcm-all-row .muted{color:var(--sub);font-size:12.5px}
body.embed .pcm-all-input{border-color:var(--accent);background:var(--card)}
body.embed .pcm-links-row td{background:var(--chip)}

/* ---- Prix ---- */
body.embed #prix-table .qty-input{text-align:right;width:104px!important;padding:6px 10px}
body.embed #prix-table .prix-vente-cell{font-weight:600;font-size:14px;white-space:nowrap}
body.embed #prix-table td:last-child{white-space:nowrap}
body.embed #prix-table .icon-btn{width:34px;height:34px;margin-left:2px;display:inline-grid;place-items:center}
body.embed #prix-table .icon-btn:hover{border-color:var(--accent)}
body.embed .prix-maj-warn{color:var(--warn);font-weight:600}
body.embed .prix-maj-old{color:var(--danger);font-weight:600}
body.embed #prix-table tr.prix-comp-row td{background:var(--chip);padding-top:6px;padding-bottom:6px}
body.embed #prix-table tr.prix-comp-row .prix-comp-mark{color:var(--sub);text-align:center;font-size:16px}
body.embed #prix-table tr.prix-comp-row .prix-vente-cell{font-weight:500}
@container prixtbl (max-width: 700px){
  body.embed #page-prix #prix-table tr.prix-comp-row{background:var(--chip);padding-left:28px}
  body.embed #page-prix #prix-table tr.prix-comp-row td:nth-child(8),body.embed #page-prix #prix-table tr.prix-comp-row td:nth-child(9){display:none}
}

/* ---- Fenêtres de ces pages ---- */
body.embed #prestation-v2-modal .modal,body.embed #pcm-edit-modal .modal,body.embed #prix-sites-modal .modal,body.embed #prix-evolution-modal .modal,body.embed #marques-evolution-modal .modal{width:min(720px,94vw)}
body.embed #prix-evolution-modal .modal,body.embed #marques-evolution-modal .modal{width:min(900px,94vw)}
body.embed #prestation-v2-modal .form-grid{grid-template-columns:1fr 1fr;gap:14px 16px}
body.embed #prestation-v2-modal .form-grid label,body.embed #pcm-edit-modal .form-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:500;color:var(--sub)}
body.embed #prestation-v2-modal .form-grid label:first-child{grid-column:1/-1}
body.embed #prestation-v2-modal .modal-actions{position:sticky;bottom:-24px;background:var(--card);padding:14px 0 0;border-top:1px solid var(--border);margin-top:20px}
body.embed #prestation-v2-modal #btn-delete-prestation-v2{margin-right:auto}
body.embed #prix-sites-list .prix-site-row{display:flex;align-items:center;gap:12px;background:var(--chip);border-radius:var(--radius-sm);padding:8px 12px}
body.embed #prix-sites-list .prix-site-row .name{flex:0 0 150px;font-weight:600;font-size:14px}
body.embed #prix-sites-list .prix-site-url-input{flex:1;min-width:0}
body.embed .sg-direction-choice{display:inline-flex;gap:4px;padding:3px;border-radius:99px;background:var(--chip);font-size:13.5px}
body.embed .sg-direction-choice label{padding:5px 14px;border-radius:99px;cursor:pointer;color:var(--sub)}
body.embed .sg-direction-choice label:has(input:checked){background:var(--card);color:var(--accent);font-weight:600;box-shadow:0 1px 2px rgba(20,30,40,.12)}
body.embed .sg-direction-choice input{position:absolute;opacity:0;pointer-events:none}
body.embed .sg-direction-choice label:has(input:focus-visible){outline:2px solid var(--accent)}
body.embed .pev-line{stroke:var(--accent)}
body.embed .mev-bar-track{background:var(--chip)}
body.embed .mev-value{font-variant-numeric:tabular-nums}
body.embed .mev-row{min-height:28px}

@media (max-width:760px){
  body.embed #prestation-v2-modal .form-grid{grid-template-columns:1fr}
  body.embed #prix-sites-list .prix-site-row{flex-direction:column;align-items:stretch}
  body.embed #page-prestations-v2 .toolbar-card,body.embed #page-pcm .toolbar-card,body.embed #page-prix .toolbar-card{position:static}
}
