/* C4U — Biblioteca, Estoque e ícones v4
   Camada visual somente; carregada por último. */

/* Ícones consistentes em áreas que ainda usavam símbolos antigos */
.c4u-tile-icon,.c4u-briefing-avatar{
  display:grid!important;place-items:center!important;
}
.c4u-tile-icon .c4u-icon{width:19px!important;height:19px!important;color:#6f4bf1!important}
.chat-hub-link>.c4u-icon{width:18px!important;height:18px!important;flex:0 0 18px!important}
.c4u-close>.c4u-icon{width:18px!important;height:18px!important}

/* Biblioteca — cards com a imagem inteira */
#appShell .c4u-unified-grid{
  grid-template-columns:repeat(auto-fill,minmax(285px,1fr))!important;
  gap:18px!important;
}
#appShell .c4u-library-card-v4{
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:455px!important;
  background:#fff!important;
  border:1px solid #e9e2f4!important;
  border-radius:20px!important;
  box-shadow:0 10px 28px rgba(54,34,93,.07)!important;
}
#appShell .c4u-library-card-v4:hover{
  transform:translateY(-3px)!important;
  border-color:#d9cef1!important;
  box-shadow:0 16px 36px rgba(54,34,93,.11)!important;
}
#appShell .c4u-library-media-v4{
  height:245px!important;
  min-height:245px!important;
  padding:18px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#fff 0%,#fbf9ff 100%)!important;
  border-bottom:1px solid #eee8f6!important;
}
#appShell .c4u-library-media-v4 img{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  display:block!important;
}
#appShell .c4u-library-body-v4{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  padding:16px 17px 17px!important;
  flex:1!important;
}
#appShell .c4u-library-source-row{
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;
}
#appShell .c4u-library-stock-chip{
  display:inline-flex!important;align-items:center!important;
  padding:5px 9px!important;border-radius:999px!important;
  background:#eef9f3!important;color:#19724a!important;
  font-size:10px!important;font-weight:750!important;
}
#appShell .c4u-library-body-v4 h3{
  margin:0!important;color:#2b2140!important;font-size:16px!important;line-height:1.32!important;
  min-height:42px!important;
}
#appShell .c4u-library-code{margin:0!important;color:#80758f!important;font-size:11px!important;min-height:16px!important}
#appShell .c4u-library-facts{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;
  margin-top:auto!important;
}
#appShell .c4u-library-facts>div{
  padding:11px 12px!important;border:1px solid #eee8f7!important;border-radius:13px!important;background:#faf8ff!important;
  min-width:0!important;
}
#appShell .c4u-library-facts small{display:block!important;color:#8a7f99!important;font-size:9px!important;margin-bottom:5px!important}
#appShell .c4u-library-facts b{display:block!important;color:#2d2242!important;font-size:12px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
#appShell .c4u-library-actions-v4{display:flex!important;gap:8px!important;margin-top:3px!important}
#appShell .c4u-library-actions-v4 .btn{width:100%!important;justify-content:center!important}

/* Modal de detalhes — mais amplo, limpo e legível */
#appShell .c4u-unified-detail-v4{
  width:min(1080px,calc(100vw - 40px))!important;
  max-width:1080px!important;
  height:auto!important;
  max-height:calc(100vh - 40px)!important;
  padding:0!important;
  overflow:hidden!important;
  gap:0!important;
  border-radius:24px!important;
  background:#fff!important;
  box-shadow:0 32px 90px rgba(38,24,63,.28)!important;
}
#appShell .c4u-detail-header-v4{
  display:flex!important;justify-content:space-between!important;align-items:flex-start!important;gap:18px!important;
  padding:22px 24px 18px!important;border-bottom:1px solid #eee8f5!important;background:linear-gradient(180deg,#fff,#fdfcff)!important;
}
#appShell .c4u-detail-header-v4 h2{margin:8px 0 5px!important;font-size:25px!important;line-height:1.2!important;color:#291f3d!important}
#appShell .c4u-detail-header-v4 p{margin:0!important;font-size:12px!important;color:#817691!important}
#appShell .c4u-detail-badges-v4{display:flex!important;gap:8px!important;align-items:center!important;flex-wrap:wrap!important}
#appShell .c4u-detail-badges-v4>span:not(.c4u-unified-source){padding:5px 9px!important;border-radius:999px!important;background:#f3eeff!important;color:#6d48d8!important;font-size:10px!important;font-weight:700!important}
#appShell .c4u-detail-close-v4{width:42px!important;height:42px!important;min-width:42px!important;padding:0!important;justify-content:center!important}
#appShell .c4u-detail-layout-v4{
  display:grid!important;grid-template-columns:minmax(360px,44%) minmax(0,1fr)!important;
  min-height:420px!important;max-height:calc(100vh - 190px)!important;
}
#appShell .c4u-detail-media-v4{
  padding:26px!important;display:grid!important;place-items:center!important;background:#fbfaff!important;border-right:1px solid #eee8f5!important;overflow:hidden!important;
}
#appShell .c4u-detail-media-v4 img{
  width:100%!important;height:100%!important;max-width:100%!important;max-height:520px!important;object-fit:contain!important;display:block!important;
}
#appShell .c4u-detail-no-image-v4{display:grid!important;place-items:center!important;gap:10px!important;color:#9388a2!important}
#appShell .c4u-detail-no-image-v4 .c4u-icon{width:48px!important;height:48px!important;color:#a48bdc!important}
#appShell .c4u-detail-content-v4{padding:22px 24px!important;overflow:auto!important;min-width:0!important}
#appShell .c4u-detail-metrics-v4{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-bottom:18px!important}
#appShell .c4u-detail-metrics-v4>div{padding:13px 14px!important;border-radius:14px!important;background:#f8f5fd!important;border:1px solid #ebe4f7!important;min-width:0!important}
#appShell .c4u-detail-metrics-v4 small,#appShell .c4u-detail-info-grid-v4 small{display:block!important;font-size:9px!important;color:#857a94!important;margin-bottom:5px!important}
#appShell .c4u-detail-metrics-v4 strong{font-size:14px!important;color:#2a2040!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important}
#appShell .c4u-detail-section-v4{padding:15px 0!important;border-top:1px solid #f0eaf7!important}
#appShell .c4u-detail-section-v4:first-of-type{border-top:0!important}
#appShell .c4u-detail-section-v4 h3{font-size:13px!important;margin:0 0 9px!important;color:#33274a!important}
#appShell .c4u-detail-section-v4 p{font-size:12px!important;line-height:1.55!important;margin:0 0 7px!important;color:#5f556d!important}
#appShell .c4u-detail-section-v4 small{font-size:10px!important;line-height:1.45!important;color:#887d97!important}
#appShell .c4u-detail-info-grid-v4{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;margin-bottom:10px!important}
#appShell .c4u-detail-info-grid-v4>div{padding:10px 11px!important;border-radius:12px!important;background:#faf8ff!important;border:1px solid #eee8f7!important;min-width:0!important}
#appShell .c4u-detail-info-grid-v4 b{font-size:11px!important;color:#302547!important;display:block!important;overflow:hidden!important;text-overflow:ellipsis!important}
#appShell .c4u-detail-footer-v4{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:14px 24px!important;border-top:1px solid #eee8f5!important;background:#fff!important}
#appShell .c4u-detail-footer-v4 small{font-size:9px!important;color:#8b8198!important}

/* Estoque físico — seletor Lista/Cards e cards */
#appShell .c4u-stock-toolbar-v4{padding:15px 16px!important;margin-bottom:16px!important}
#appShell .c4u-stock-filter-row-v4{display:flex!important;align-items:flex-end!important;gap:12px!important;justify-content:space-between!important;margin-top:10px!important}
#appShell .c4u-stock-filter-row-v4>.field{flex:1!important;margin:0!important}
#appShell .c4u-stock-view-v4{display:flex!important;gap:6px!important}
#appShell .c4u-stock-view-v4 .btn.active{background:#ede6ff!important;color:#653de0!important;border-color:#d8c9fb!important}
#appShell .c4u-stock-grid-v4{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))!important;gap:18px!important}
#appShell .c4u-stock-card-v4{overflow:hidden!important;background:#fff!important;border:1px solid #e8e1f2!important;border-radius:20px!important;box-shadow:0 9px 26px rgba(54,34,93,.07)!important;transition:.16s ease!important}
#appShell .c4u-stock-card-v4:hover{transform:translateY(-2px)!important;box-shadow:0 15px 34px rgba(54,34,93,.1)!important}
#appShell .c4u-stock-card-media-v4{height:215px!important;padding:16px!important;display:grid!important;place-items:center!important;background:linear-gradient(180deg,#fff,#faf8ff)!important;border-bottom:1px solid #eee8f5!important}
#appShell .c4u-stock-card-media-v4 img{width:100%!important;height:100%!important;object-fit:contain!important;display:block!important}
#appShell .c4u-stock-empty-image-v4{width:100%!important;height:100%!important;display:grid!important;place-items:center!important;color:#8e73d4!important}
#appShell .c4u-stock-empty-image-v4 .c4u-icon{width:42px!important;height:42px!important}
#appShell .c4u-stock-card-body-v4{padding:16px!important;display:grid!important;gap:12px!important}
#appShell .c4u-stock-card-head-v4{display:flex!important;justify-content:space-between!important;gap:10px!important;align-items:flex-start!important}
#appShell .c4u-stock-card-head-v4 small{font-size:9px!important;color:#8a8096!important}
#appShell .c4u-stock-card-head-v4 h3{margin:4px 0 0!important;font-size:15px!important;line-height:1.3!important;color:#2a2040!important}
#appShell .c4u-stock-card-head-v4>span{font-size:9px!important;padding:5px 8px!important;border-radius:999px!important;background:#f3eeff!important;color:#7150d4!important;white-space:nowrap!important}
#appShell .c4u-stock-owner-v4{margin:0!important;font-size:11px!important;color:#72677f!important}
#appShell .c4u-stock-numbers-v4{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:8px!important}
#appShell .c4u-stock-numbers-v4>div{padding:10px!important;border-radius:12px!important;background:#f8f5fd!important;border:1px solid #ece5f6!important;text-align:center!important}
#appShell .c4u-stock-numbers-v4 small,#appShell .c4u-stock-values-v4 small{display:block!important;font-size:9px!important;color:#8a8097!important;margin-bottom:4px!important}
#appShell .c4u-stock-numbers-v4 b{font-size:15px!important;color:#2d2341!important}
#appShell .c4u-stock-values-v4{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
#appShell .c4u-stock-values-v4>span{padding:10px 12px!important;border-radius:12px!important;border:1px solid #eee8f6!important;background:#fff!important}
#appShell .c4u-stock-values-v4 b{font-size:12px!important;color:#2d2341!important}
#appShell .c4u-stock-actions-v4{display:flex!important;gap:8px!important;padding-top:2px!important}
#appShell .c4u-stock-actions-v4 .btn{flex:1!important;justify-content:center!important}

/* Aprovações: o botão de excluir fica discreto, mas visível */
#appShell [data-page="approvals"]{}

@media(max-width:900px){
  #appShell .c4u-detail-layout-v4{grid-template-columns:1fr!important;max-height:calc(100vh - 180px)!important;overflow:auto!important}
  #appShell .c4u-detail-media-v4{height:300px!important;border-right:0!important;border-bottom:1px solid #eee8f5!important}
  #appShell .c4u-detail-content-v4{overflow:visible!important}
  #appShell .c4u-detail-metrics-v4{grid-template-columns:1fr!important}
  #appShell .c4u-detail-info-grid-v4{grid-template-columns:1fr!important}
  #appShell .c4u-stock-filter-row-v4{align-items:stretch!important;flex-direction:column!important}
}
