.product-profile{display:grid;grid-template-columns:minmax(0,1fr) minmax(235px,265px);gap:1rem;align-items:start;min-width:0}
.product-profile-main{min-width:0}
.product-group-hint{margin:.1rem 0 .35rem;color:var(--text-secondary);font-size:.8rem}
.product-group-hint a{font-weight:700}
.product-profile-intro{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin:0 0 .65rem}
.product-profile-intro h2{margin:.1rem 0 0;font-size:1.13rem;line-height:1.3;overflow-wrap:anywhere}
.product-profile-eyebrow{margin:0;color:var(--text-secondary);font-size:.76rem;font-weight:700;letter-spacing:.025em}
.product-profile-status{display:inline-flex;align-items:center;padding:.25rem .55rem;border:1px solid var(--card-border);border-radius:999px;color:var(--text-secondary);font-size:.75rem;font-weight:700;white-space:nowrap}
.product-profile-tabs{margin-bottom:.75rem}
.product-profile-tabs .gwn-tab{padding:.65rem .8rem;font-size:.82rem}
.product-profile-form{min-width:0}
.product-profile-section{min-width:0;scroll-margin-top:5.5rem}
.product-profile-section[hidden]{display:none}
.product-profile-section+.product-profile-section{margin-top:.75rem}
.product-profile-tabs{overflow-x:auto;white-space:nowrap}
.product-profile-panel{padding:1rem;min-width:0}
.product-profile-panel+.product-profile-panel{margin-top:.75rem}
.product-profile-panel h3,.product-profile-summary h3{margin:0 0 .7rem;font-size:.94rem}
.product-profile-panel>p{margin:.1rem 0 .8rem;color:var(--text-secondary);font-size:.82rem;line-height:1.5}
.product-profile-summary{padding:1rem;min-width:0}
.product-profile-aside{display:grid;gap:.75rem;min-width:0}
.product-profile-aside .product-profile-summary{align-self:start}
.product-profile-summary dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem .8rem;margin:0;font-size:.8rem}
.product-profile-summary dt{color:var(--text-secondary)}
.product-profile-summary dd{margin:0;font-weight:700;text-align:right;overflow-wrap:anywhere}
.product-profile-summary-note{margin:.35rem 0 0;color:var(--text-secondary);font-size:.76rem;line-height:1.45}
.product-profile-pending{border-style:dashed}
.product-commercial-fields h4,.product-notes-fields h4{margin:.7rem 0 .55rem;font-size:.86rem}
.product-notes-fields{margin-top:1rem;padding-top:.7rem;border-top:1px solid var(--card-border)}
.product-cost-scenario-heading{align-items:flex-start;gap:.75rem}
.product-cost-scenario-heading>div:first-child{min-width:0}
.product-cost-scenario-heading h4{margin:0 0 .25rem}
.product-cost-scenario-heading p{margin:0;color:var(--text-secondary);font-size:.8rem;line-height:1.45;overflow-wrap:anywhere}
.product-cost-scenario-actions{display:flex;align-items:flex-start;justify-content:flex-end;flex-wrap:wrap;gap:.4rem;max-width:60%}
.product-cost-scenario-actions .button{white-space:normal;text-align:center}
@media(max-width:760px){.product-cost-scenario-actions{justify-content:flex-start;max-width:none;width:100%}}
.product-cost-breakdown{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.55rem;margin:.8rem 0;padding:.65rem;border:1px solid var(--card-border);border-radius:.65rem;background:var(--surface-muted)}
.product-cost-breakdown-item{display:grid;align-content:center;gap:.2rem;min-width:0;padding:.3rem .55rem;border-right:1px solid var(--card-border)}
.product-cost-breakdown-item:nth-child(4n),.product-cost-breakdown-item:last-child{border-right:0}
.product-cost-breakdown-item small{color:var(--text-secondary);font-weight:700}
.product-cost-breakdown-item strong{font-size:.94rem;overflow-wrap:anywhere}
.product-profile-simulated{padding:.6rem .75rem;border-radius:.5rem;background:var(--surface-muted);color:var(--text-primary)!important}
.product-bom-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin:.4rem 0 .8rem}
.product-bom-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,235px);gap:.75rem;align-items:start}
.product-bom-materials,.product-bom-control{min-width:0;padding:.8rem;border:1px solid var(--card-border);border-radius:.6rem;background:var(--surface-muted)}
.product-bom-layout h4{margin:0 0 .65rem;font-size:.85rem}
.product-bom-route{margin-top:1rem;padding-top:.85rem;border-top:1px solid var(--card-border)}
.product-bom-route p{margin:.35rem 0 0;color:var(--text-secondary);font-size:.8rem}
.product-bom-control dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.45rem;margin:0;font-size:.78rem}
.product-bom-control dt{color:var(--text-secondary)}
.product-bom-control dd{margin:0;font-weight:700;text-align:right}
.product-bom-control p{margin:.8rem 0 0;color:var(--text-secondary);font-size:.76rem;line-height:1.4}
.product-profile [role=tabpanel]{min-width:0}
.cost-revision-profile .product-profile-panel h4{margin:1rem 0 .65rem;font-size:.85rem}
.cost-revision-profile .cost-revision-table{min-width:720px}
.cost-revision-total{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin-top:.85rem;padding:.8rem .9rem;border:1px solid var(--card-border);border-radius:.6rem;background:var(--surface-muted);font-size:.85rem}
.cost-revision-total strong{font-size:1.05rem;text-align:right;overflow-wrap:anywhere}
.cost-category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin-top:1rem}
.cost-category-panel{min-width:0;padding:.85rem;border:1px solid var(--card-border);border-radius:.65rem;background:var(--surface-muted)}
.cost-category-material{grid-column:1/-1}
.cost-category-heading{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;padding-bottom:.55rem;border-bottom:1px solid var(--card-border)}
.cost-category-heading h4{margin:0!important;font-size:.9rem}
.cost-category-heading strong{font-size:.88rem;text-align:right;overflow-wrap:anywhere}
.cost-category-panel>p{margin:.7rem 0 0;color:var(--text-secondary);font-size:.78rem;line-height:1.45}
.cost-category-lines{list-style:none;display:grid;gap:.55rem;margin:.7rem 0 0;padding:0}
.cost-category-line{min-width:0;padding:.65rem;border:1px solid var(--card-border);border-radius:.5rem;background:var(--surface)}
.cost-category-line-title{display:flex;align-items:baseline;justify-content:space-between;gap:.6rem;font-size:.84rem}
.cost-category-line-title>*{overflow-wrap:anywhere}
.cost-category-line-title span{font-weight:700;text-align:right}
.cost-category-line dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.3rem .5rem;margin:.5rem 0 0;font-size:.76rem;line-height:1.4}
.cost-category-line dt{color:var(--text-secondary)}
.cost-category-line dd{margin:0;overflow-wrap:anywhere}
.structure-detail-lower{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin-top:.75rem}
.structure-detail-lower .product-profile-panel{margin:0}
.structure-detail-lower .cost-revision-table{display:block;min-width:0}
.structure-detail-lower .cost-revision-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.structure-detail-lower .cost-revision-table tbody,.structure-detail-lower .cost-revision-table tr,.structure-detail-lower .cost-revision-table td{display:block;width:100%}
.structure-detail-lower .cost-revision-table tr{margin:.7rem 0;border:1px solid var(--card-border);border-radius:.6rem;overflow:hidden}
.structure-detail-lower .cost-revision-table td{display:grid;grid-template-columns:minmax(95px,35%) minmax(0,1fr);gap:.5rem;overflow-wrap:anywhere}
.structure-detail-lower .cost-revision-table td::before{content:attr(data-label);font-weight:700;color:var(--text-secondary)}
@media(max-width:1100px){.product-profile{grid-template-columns:minmax(0,1fr)}.product-profile-summary dl{grid-template-columns:repeat(2,minmax(0,1fr))}.product-profile-summary dd{text-align:left}}
@media(max-width:880px){.product-bom-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){.product-profile{gap:.75rem}.product-profile-intro{align-items:flex-start}.product-profile-intro h2{font-size:1rem}.product-profile-panel,.product-profile-summary{padding:.8rem}.product-profile-tabs .gwn-tab{padding:.55rem .7rem}.product-profile .gwn-form-grid>:is(.gwn-col-3,.gwn-col-4,.gwn-col-6,.gwn-col-8){grid-column:span 12}.product-profile-summary dl{grid-template-columns:minmax(0,1fr) auto}.product-profile-summary dd{text-align:right}.product-cost-breakdown{grid-template-columns:repeat(2,minmax(0,1fr))}.product-cost-breakdown-item{border-right:0}.product-cost-breakdown-item:nth-child(odd){border-right:1px solid var(--card-border)}}
@media(max-width:760px){.cost-category-grid,.structure-detail-lower{grid-template-columns:minmax(0,1fr)}.cost-category-material{grid-column:auto}.cost-category-line-title{flex-direction:column;align-items:flex-start;gap:.2rem}.cost-category-line-title span{text-align:left}}
@media(max-width:760px){
  .cost-revision-profile .cost-revision-table{display:block;min-width:0}
  .cost-revision-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .cost-revision-table tbody,.cost-revision-table tr,.cost-revision-table td{display:block;width:100%}
  .cost-revision-table tr{margin:.7rem 0;border:1px solid var(--card-border);border-radius:.6rem;overflow:hidden}
  .cost-revision-table td{display:grid;grid-template-columns:minmax(95px,35%) minmax(0,1fr);gap:.5rem;overflow-wrap:anywhere}
  .cost-revision-table td::before{content:attr(data-label);font-weight:700;color:var(--text-secondary)}
  .cost-revision-total{align-items:flex-start;flex-direction:column;gap:.3rem}
  .cost-revision-total strong{text-align:left}
}
.product-structure-history { display: grid; gap: .5rem; margin-top: 1rem; }
.product-structure-history h5 { margin: 0; }
.product-structure-history a { color: var(--color-primary, #1559dc); text-decoration: underline; text-underline-offset: .15em; }
.structure-history-link { display: flex; justify-content: center; margin-top: .5rem; white-space: normal; text-align: center; }
.main-content:has(.product-profile) .button-outline:not(:disabled):not([aria-disabled="true"]):is(:hover,:focus-visible){background:#1559dc;border-color:#1559dc;color:#fff}
.product-bom-actions .button{white-space:normal;text-align:center}
.product-price-simulation .section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.product-price-simulation .section-heading h3{margin-bottom:.25rem}
.product-price-simulation .section-heading p{margin:0;color:var(--text-secondary);font-size:.82rem;line-height:1.5}
.product-price-simulation-actions{display:flex;justify-content:flex-end;margin-top:.8rem}
.product-price-results{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.55rem;margin-top:1rem}
.product-price-results>div{display:grid;align-content:center;gap:.3rem;min-width:0;padding:.75rem;border:1px solid var(--card-border);border-radius:.6rem;background:var(--surface-muted)}
.product-price-results small{color:var(--text-secondary);font-weight:700;line-height:1.35}
.product-price-results strong{overflow-wrap:anywhere;font-size:.95rem}
.product-price-simulation-note{margin:.75rem 0 0;color:var(--text-secondary);font-size:.78rem}
@media(max-width:960px){.product-price-results{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.product-price-results{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
  .product-bom-table{display:block;min-width:0}
  .product-bom-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .product-bom-table tbody,.product-bom-table tr,.product-bom-table td{display:block;width:100%}
  .product-bom-table tr{margin:.7rem 0;border:1px solid var(--card-border);border-radius:.6rem;overflow:hidden}
  .product-bom-table td{display:grid;grid-template-columns:minmax(95px,35%) minmax(0,1fr);gap:.5rem;overflow-wrap:anywhere}
  .product-bom-table td::before{content:attr(data-label);font-weight:700;color:var(--text-secondary)}
}
/* Etapa 1 · fichas: estado do ciclo de vida, grade de componentes e aprovação */
.sheet-status-approved{border-color:var(--gwn-success);color:var(--gwn-success)}
.sheet-status-draft{border-color:var(--gwn-warning);color:var(--text-primary)}
.sheet-check-field{display:flex;flex-direction:column;justify-content:flex-end;gap:4px}
.gwn-check{display:inline-flex;align-items:center;gap:8px;min-height:var(--gwn-control-height);cursor:pointer}
.gwn-check input{width:20px;height:20px}
.sheet-grid-table td{vertical-align:top}
.sheet-grid-table td:first-child{min-width:min(320px,70vw)}
.sheet-grid-table input{width:100%;min-width:0}
.sheet-approval form{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.cost-outdated{border-left:4px solid var(--gwn-warning)}
@media(max-width:760px){
  table.ap-table.sheet-grid-table td{display:flex;flex-direction:column;align-items:stretch;gap:4px;text-align:left}
  table.ap-table.sheet-grid-table td::before{text-align:left}
  table.ap-table.sheet-grid-table td:first-child{min-width:0}
  table.ap-table.sheet-grid-table :is(.ap-searchable,input,select){width:100%}
  table.ap-table.sheet-grid-table td:last-child{align-items:flex-end}
}
/* Lista de produtos: atalhos e filtros compactos; a lista é o foco da tela */
.product-list-toolbar{margin-bottom:12px;padding:12px 14px}
.product-list-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.product-chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:4px 12px;border:1px solid var(--card-border);border-radius:999px;color:var(--text-secondary);font-size:.85rem;text-decoration:none;white-space:nowrap}
.product-chip strong{color:var(--text-primary)}
.product-chip:hover,.product-chip:focus-visible{border-color:var(--gwn-primary,var(--primary));color:var(--text-primary)}
.product-chip.is-active{border-color:var(--gwn-primary,var(--primary));background:color-mix(in srgb,var(--gwn-primary,var(--primary)) 14%,transparent);color:var(--text-primary)}
.product-chip.is-attention strong{color:var(--gwn-warning)}
.product-filter-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,190px) minmax(130px,170px) auto;gap:8px 10px;align-items:center}
.product-filter-form .field{margin:0}
.product-filter-actions{display:flex;gap:8px}
.product-filter-more{grid-column:1/-1}
.product-filter-more>summary{cursor:pointer;display:inline-flex;align-items:center;min-height:32px;font-size:.85rem;font-weight:600}
.product-filter-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;margin-top:6px}
.product-list-table td small{color:var(--text-secondary)}
@media(min-width:761px) and (max-width:1199.98px){.product-list-table .col-secondary{display:none}}
@media(min-width:761px) and (max-width:991.98px){.product-list-table .col-tertiary{display:none}}
@media(max-width:991.98px){.product-filter-form{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.product-filter-search,.product-filter-actions{grid-column:1/-1}.product-filter-actions{justify-content:flex-end}}
@media(max-width:760px){.product-list-chips{flex-wrap:nowrap;overflow-x:auto;margin:0 0 8px;padding-bottom:2px;scrollbar-width:thin}.product-chip{min-height:44px}.product-filter-form{grid-template-columns:minmax(0,1fr) auto}.product-filter-form .gwn-list-filter-toggle{grid-column:2}.product-filter-form .gwn-list-mobile-extra,.product-filter-actions,.product-filter-search{grid-column:1/-1}.product-filter-form .product-filter-search{grid-column:1}.product-filter-more-grid{grid-template-columns:minmax(0,1fr)}.product-filter-actions>*{flex:1}}
/* Celular: cartão compacto de 3 linhas (código+situação / descrição / tipo+ficha); toque no cartão abre o produto */
@media(max-width:760px){
  table.ap-table.product-list-table tbody{gap:8px}
  table.ap-table.product-list-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:10px 12px;cursor:pointer}
  table.ap-table.product-list-table td{display:block;padding:0;text-align:left;min-width:0}
  table.ap-table.product-list-table td::before{content:none;display:none}
  table.ap-table.product-list-table td:nth-child(1){grid-column:1;grid-row:1;align-self:center}
  table.ap-table.product-list-table td:nth-child(8){grid-column:2;grid-row:1;justify-self:end}
  table.ap-table.product-list-table td:nth-child(2){grid-column:1/-1;grid-row:2}
  table.ap-table.product-list-table td:nth-child(3){grid-column:1;grid-row:3;align-self:center;color:var(--text-secondary);font-size:.85rem}
  table.ap-table.product-list-table td:nth-child(7){grid-column:2;grid-row:3;justify-self:end}
  table.ap-table.product-list-table :is(td:nth-child(4),td:nth-child(5),td:nth-child(6),td:nth-child(9)){display:none}
  table.ap-table.product-list-table td:nth-child(1) a{display:inline-flex;align-items:center;min-height:32px}
}
@media(max-width:760px){table.ap-table.product-list-table .product-no-sheet{display:none}}
/* Grupos e subgrupos: um cartão por grupo, ações por linha, edição no lugar */
.inventory-groups{display:grid;gap:12px}
.inventory-groups-head .section-heading{margin-bottom:8px}
.inventory-group-inline{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:flex-end}
.inventory-group-inline .field{flex:1 1 240px;margin:0}
.inventory-group-inline .field-error-text{flex-basis:100%;color:var(--gwn-danger-text)}
.inventory-group-header{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;justify-content:space-between}
.inventory-group-header h3{margin:0;font-size:1.05rem}
.inventory-group-header h3 .mono,.inventory-subgroup-name .mono{font-size:.95em;color:var(--text-secondary)}
.inventory-group-header form.inventory-group-inline{flex:1 1 100%}
.inventory-group .gwn-row-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.inventory-group .gwn-row-actions form{margin:0}
.inventory-subgroup-list{list-style:none;margin:10px 0 0;padding:0}
.inventory-subgroup{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:space-between;padding:8px 0;border-top:1px solid var(--card-border)}
.inventory-subgroup>form.inventory-group-inline{flex:1 1 100%}
.inventory-subgroup-name small{display:block;color:var(--text-secondary)}
.inventory-group.is-inactive h3,.inventory-subgroup.is-inactive .inventory-subgroup-name{color:var(--text-secondary)}
.inventory-subgroup-add{margin-top:8px;padding-top:10px;border-top:1px dashed var(--card-border)}
@media(max-width:760px){.inventory-group .gwn-row-actions .button,.inventory-group-inline .button{min-height:44px}.inventory-subgroup,.inventory-group-header{align-items:flex-start}.inventory-group .gwn-row-actions{width:100%}.inventory-group-inline .field{flex-basis:100%}.inventory-group-inline>.button,.inventory-group-inline .gwn-row-actions>*{flex:1}}
.sheet-revise{display:grid;gap:10px;margin-bottom:12px}
.sheet-revise p{margin:0}
.sheet-revise>.button{justify-self:start}
.sheet-revise-form{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:flex-end}
.sheet-revise-form .field{flex:1 1 280px;margin:0}
@media(max-width:760px){.sheet-revise-form .button,.sheet-revise>.button{flex:1 1 100%;min-height:44px;justify-self:stretch}}
