/* BEM GESTÃO • P31.4.4 • CAMADA FINAL DE COMPATIBILIDADE
   Uma única camada FINAL sem recriar a identidade aprovada.
   Não interfere em salário, pagamentos, banco, login ou BEM DIRECT. */
:root{--bem-aura:#69369a;--bem-aura-deep:#3f204f;--bem-aura-ink:#2a1734}
html body{box-sizing:border-box;overflow-x:clip}
html body *{box-sizing:border-box}
/* Compras: mesmo Aurora Glass dos Pedidos, preservando as ações e os estados antigos. */
html body #screen-compras .purchase-market-list{gap:14px!important;padding:4px clamp(8px,2vw,18px) 22px!important}
html body #screen-compras .market-sector-title{position:relative!important;top:auto!important;z-index:1!important;padding:12px 15px!important;border-radius:17px!important;background:linear-gradient(110deg,#f3eaf9,#f9f4fc)!important;color:#552b73!important;font-size:clamp(12px,3.1vw,15px)!important;line-height:1.35!important}
html body #screen-compras .market-buy-row{background:linear-gradient(150deg,#fff,#fcfaff)!important;border:1px solid #e6d9ef!important;border-radius:24px!important;box-shadow:0 12px 30px rgba(68,38,92,.09),inset 0 1px 0 #fff!important;overflow:visible!important;padding:clamp(12px,3.3vw,19px)!important;grid-template-areas:'main' 'actions' 'origin'!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important;min-width:0!important}
html body #screen-compras .market-buy-main{display:grid!important;grid-template-columns:clamp(68px,19vw,89px) minmax(0,1fr)!important;gap:14px!important;grid-area:main!important;min-width:0!important}
html body #screen-compras .market-buy-main .product-thumb{width:clamp(68px,19vw,89px)!important;min-width:0!important;height:clamp(68px,19vw,89px)!important;max-width:100%!important;flex-basis:auto!important;background:linear-gradient(140deg,#fff,#f5eef9)!important;border-radius:19px!important;border:1px solid #e8daef!important;padding:6px!important}
html body #screen-compras .market-buy-main .product-thumb img{object-fit:contain!important;object-position:center!important;max-width:100%!important;width:100%!important;height:100%!important}
html body #screen-compras .market-buy-copy small{max-width:100%!important;width:max-content!important;font-size:clamp(11px,2.6vw,13px)!important;font-weight:800!important;white-space:normal!important}
html body #screen-compras .market-buy-copy strong{font-size:clamp(17px,4.15vw,21px)!important;line-height:1.25!important;overflow-wrap:anywhere!important}
html body #screen-compras .market-buy-copy b{font-size:clamp(18px,4.5vw,23px)!important}
html body #screen-compras .market-buy-actions{display:grid!important;grid-area:actions!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;min-width:0!important;width:100%!important;gap:10px!important}
html body #screen-compras .market-buy-actions .market-action{min-height:56px!important;width:100%!important;white-space:normal!important;overflow-wrap:break-word!important;padding:10px 8px!important;font-size:clamp(12px,3.1vw,15px)!important;line-height:1.25!important;letter-spacing:0!important;border-radius:15px!important}
html body #screen-compras .market-action.undo{grid-column:1/-1!important}
html body #screen-compras .market-action.missing{background:linear-gradient(135deg,#fff9f8,#fff1ef)!important;color:#a22d3b!important;-webkit-text-fill-color:#a22d3b!important;border:1.5px solid #e4aab2!important}
html body #screen-compras .market-buy-row.is-bought{border-color:#b8dfc9!important;background:#fafffb!important}
html body #screen-compras .market-buy-row.is-missing{border-color:#eaccc8!important;background:#fffafa!important}
html body #screen-compras .market-origin{grid-area:origin!important;margin:0!important;border-top:1px solid #e9dfee!important;padding-top:10px!important}
html body #screen-compras .market-origin summary{font-size:clamp(12px,2.8vw,14px)!important;line-height:1.45!important}
html body #screen-compras .purchase-market-finish-bar{position:relative!important;bottom:auto!important;z-index:1!important;border-radius:23px!important;background:linear-gradient(125deg,#392542,#28172e)!important;color:#fff!important;padding:clamp(14px,3vw,19px)!important;max-width:100%!important}
html body #screen-compras .purchase-market-finish-bar>div{display:block!important;min-width:0!important}
html body #screen-compras .purchase-market-finish-bar strong{font-size:clamp(12px,3vw,15px)!important;color:#fff!important}
html body #screen-compras .purchase-market-finish-bar small{font-size:clamp(11px,2.7vw,13px)!important;color:#f5e7fb!important}
html body #screen-compras .purchase-market-finish-bar .primary-btn{width:100%!important;min-height:58px!important;color:#fff!important;-webkit-text-fill-color:#fff!important;background:linear-gradient(120deg,#6c2b9d,#853eb8)!important;font-size:clamp(13px,3.4vw,17px)!important;white-space:normal!important;line-height:1.25!important}
html body .product-photo-fallback{font-size:30px!important;color:#8969a1!important}
/* Janela da conversa sempre prevalece sobre seta de menu antiga. */
html body.bem-request-chat-open #navRevealBtn,html body.bem-request-chat-open #adminNav,html body.bem-request-chat-open #managerNav,html body.bem-request-chat-open #appBackBtn{display:none!important;visibility:hidden!important;pointer-events:none!important}
html body .request-chat-overlay{z-index:2147483000!important;max-width:100dvw!important;width:100dvw!important;max-height:100dvh!important;overflow:hidden!important}
html body .request-chat-overlay .request-chat-compose{min-width:0!important;max-width:100%!important}
html body .request-chat-overlay .request-chat-help{font-size:clamp(11px,2.8vw,13px)!important;line-height:1.35!important;overflow-wrap:anywhere!important}
/* Cadastro explícito de foto, disponível em Ajustes > Fotos dos responsáveis. */
.bem-photo-panel[hidden]{display:none!important}
.bem-photo-panel{position:fixed!important;inset:0!important;z-index:2147483100!important;overflow-y:auto!important;background:rgba(34,12,49,.78)!important;padding:calc(env(safe-area-inset-top,0px) + 16px) 12px calc(env(safe-area-inset-bottom,0px) + 18px)!important;display:flex!important;align-items:flex-start!important;justify-content:center!important}
.bem-photo-panel-box{width:min(100%,570px)!important;max-height:calc(100dvh - 30px)!important;overflow:auto!important;background:#fff!important;border-radius:23px!important;padding:clamp(14px,3vw,23px)!important;box-shadow:0 25px 80px #12052380!important;font-family:Poppins,system-ui,sans-serif!important;color:#2a1734!important}
.bem-photo-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid #e7d8ef;padding-bottom:12px}
.bem-photo-panel-head h2{font-size:clamp(18px,5vw,25px)!important;line-height:1.15!important;margin:4px 0!important}
.bem-photo-panel-head small{font-size:11px!important;font-weight:800;color:#6e378c}
.bem-photo-panel-head button{border-radius:13px!important;border:1px solid #d6bee5!important;background:#f6ecfb!important;color:#562773!important;padding:11px!important;min-height:47px!important;font-size:12px!important;font-weight:900!important;white-space:nowrap!important}
.bem-photo-panel-lead{font-size:14px!important;line-height:1.5!important;color:#4c3f54!important;margin:16px 0!important}
.bem-photo-panel-users{display:grid!important;gap:11px!important}
.bem-photo-user{display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;grid-template-areas:'photo name' 'btn btn'!important;gap:9px 12px!important;align-items:center!important;padding:12px!important;border:1px solid #e5d6ee!important;border-radius:17px!important;background:linear-gradient(130deg,#fff,#faf6fc)!important}
.bem-photo-user-picture{grid-area:photo!important;display:grid!important;place-items:center!important;width:58px!important;height:58px!important;border-radius:50%!important;background:#efe2f7!important;color:#582780!important;font-size:20px!important;font-weight:900!important;overflow:hidden!important}
.bem-photo-user-picture img{width:100%!important;height:100%!important;object-fit:cover!important}
.bem-photo-user-name{grid-area:name!important;min-width:0!important}
.bem-photo-user-name strong{display:block!important;font-size:clamp(13px,3.6vw,17px)!important;overflow-wrap:anywhere!important}
.bem-photo-user-name small{display:block!important;font-size:12px!important;color:#756781!important;line-height:1.4!important}
.bem-photo-user>button{grid-area:btn!important;min-height:51px!important;border:0!important;border-radius:13px!important;background:linear-gradient(130deg,#5a2787,#7d40ae)!important;color:#fff!important;font:900 13px/1.3 Poppins,system-ui,sans-serif!important;white-space:normal!important}
.bem-photo-panel-note{margin:16px 0 0!important;color:#74657e!important;font-size:12px!important;line-height:1.4!important}
/* Legibilidade em aparelhos antigos e fontes ampliadas. */
@media(max-width:480px){html body #screen-compras .purchase-market-finish-bar{grid-template-columns:minmax(0,1fr)!important;gap:8px!important}html body #screen-compras .market-buy-row{padding:13px!important;gap:11px!important}}
@media(max-width:360px){html body #screen-compras .market-buy-main{grid-template-columns:65px minmax(0,1fr)!important;gap:10px!important}html body #screen-compras .market-buy-main .product-thumb{width:65px!important;height:65px!important}html body #screen-compras .market-buy-actions{gap:6px!important}}
@media(prefers-reduced-motion:reduce){html body #screen-compras .market-buy-row{transition:none!important}}

/* P31.4.6-R2 — alertas fiscais e autocomplete: correção pontual, sem redesenhar Aurora Glass. */
html body #screen-compras .purchase-manual-add[open]{overflow:visible!important;position:relative!important;z-index:60!important}
html body #screen-compras .purchase-manual-form{overflow:visible!important}
html body #screen-compras .purchase-manual-form label:first-child{position:relative!important;z-index:61!important}
html body #screen-compras .purchase-manual-form .autocomplete-host{min-width:0!important;width:100%!important;position:relative!important;z-index:65!important}
html body #screen-compras .purchase-manual-form .autocomplete-panel{display:block;position:absolute!important;z-index:70!important;top:calc(100% + 5px)!important;left:0!important;right:0!important;max-height:min(300px,45dvh)!important;overflow-y:auto!important;background:#fff!important;border:1.5px solid #dbc8e9!important;border-radius:14px!important;box-shadow:0 18px 40px rgba(51,19,67,.22)!important}
html body #screen-compras .purchase-manual-form .autocomplete-panel.hidden{display:none!important}
html body #screen-compras .purchase-manual-form .autocomplete-option{min-height:45px!important;display:block!important;white-space:normal!important;overflow-wrap:anywhere!important}
html body #screen-compras .bem-nf-urgent{animation:bem-nf-entire-alert-r2 1.65s ease-in-out infinite!important;transform-origin:center center!important;outline:2px solid transparent!important;outline-offset:2px!important;will-change:filter,outline-color!important}
@keyframes bem-nf-entire-alert-r2{0%,100%{filter:brightness(1);outline-color:rgba(203,34,47,.13)}50%{filter:brightness(1.11) drop-shadow(0 0 12px rgba(205,18,39,.48));outline-color:#d21830}}
@media(prefers-reduced-motion:reduce){html body #screen-compras .bem-nf-urgent{animation:none!important;outline:3px solid #c62232!important;filter:none!important}}


/* P31.4.7 candidato — somente etapa de compra encerrada; Aurora Glass intacto. */
html body #purchaseRoundClosureNotice{display:block;border:1px solid #dac5e6;border-radius:22px;padding:14px;margin:18px 0;background:linear-gradient(145deg,#fff,#f7f0fb);box-shadow:0 10px 30px rgba(69,30,93,.07)}
html body #purchaseRoundClosureNotice.hidden,html body #purchaseRoundNextSteps.hidden{display:none!important}
html body #purchaseRoundClosedDetails{border-radius:16px;background:#f3e9f9;border:1px solid #dfc8ee;color:#402251;overflow:hidden}
html body #purchaseRoundClosedDetails summary{cursor:pointer;list-style:none;font-weight:900;line-height:1.45;padding:15px 16px;font-size:clamp(14px,3.8vw,17px)}
html body #purchaseRoundClosedDetails summary::-webkit-details-marker{display:none}
html body .bem-purchase-closed-items{padding:8px 16px 14px;display:grid;gap:10px}
html body .bem-purchase-closed-items>div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:14px;border-top:1px solid #ddc5e9;padding-top:10px}
html body .bem-purchase-closed-items small{color:#665072;font-weight:700}
html body #purchaseRoundNextSteps{margin-top:16px}
html body .bem-purchase-post-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
html body .bem-purchase-post-actions button{white-space:normal;min-height:52px;padding:11px;font-size:clamp(13px,3.2vw,16px);line-height:1.25;text-align:center}
html body .bem-purchase-post-actions #purchaseRoundCreateNew{background:#71379e;color:#fff}
@media(max-width:360px){html body .bem-purchase-post-actions{grid-template-columns:minmax(0,1fr)}}


/* P31.4.8: fluxo consistente de compra, sem redesenhar a identidade Aurora. */
html body #purchaseRoundClosureNotice.hidden,
html body #purchaseRoundNextSteps.hidden,
html body #purchaseRoundNoBought.hidden,
html body #purchaseRoundLinkedOrders.hidden,
html body #purchaseRoundNoInvoiceHelp.hidden,
html body #purchaseMarketResponsibles.hidden{display:none!important}
html body #purchaseRoundClosureNotice.bem-closure-workspace{
  display:grid!important;gap:16px;border:3px solid #762bb6;border-radius:24px;
  padding:clamp(15px,3vw,25px);margin:16px 0 20px;
  background:linear-gradient(155deg,#fff 20%,#f4e9fb 100%);
  box-shadow:0 10px 28px rgba(83,29,115,.15),0 0 0 4px rgba(122,54,160,.055)
}
html body .bem-closure-title{display:flex;gap:13px;align-items:center;color:#3a1b50}
html body .bem-closure-title small{display:block;font-weight:900;letter-spacing:.09em;color:#704391;font-size:12px}
html body .bem-closure-title strong{font-size:clamp(19px,4.6vw,27px);font-weight:1000;line-height:1.24;display:block}
html body .bem-closure-check{font-weight:1000;font-size:26px;min-width:46px;height:46px;border-radius:15px;display:grid;place-items:center;color:#fff;background:#06754d;box-shadow:0 6px 15px rgba(0,120,77,.2)}
html body .bem-closure-nf-alarm{
  display:flex;align-items:center;gap:15px;
  padding:18px;border:3px solid #b31a42;border-radius:20px;
  color:#64122d;background:#fff0f3;
  box-shadow:0 0 0 0 rgba(196,30,74,0);
  animation:bemNfReminderStrong 1.2s ease-in-out 10;
}
html body .bem-closure-nf-alarm strong{font-size:clamp(17px,4.5vw,25px);font-weight:1000;line-height:1.25;display:block}
html body .bem-closure-nf-alarm p{margin:6px 0 0;font-size:clamp(14px,3.4vw,18px);line-height:1.4;color:#672940}
html body .bem-closure-alert-icon{background:#c92651;color:white;display:grid;place-items:center;border-radius:16px;width:52px;min-width:52px;height:52px;font-size:32px;font-weight:900}
@keyframes bemNfReminderStrong{
  0%,100%{border-color:#b31a42;box-shadow:0 0 0 0 rgba(196,30,74,.08)}
  50%{border-color:#ee4d7b;box-shadow:0 0 0 8px rgba(196,30,74,.16),0 0 22px rgba(196,30,74,.18)}
}
@media(prefers-reduced-motion:reduce){html body .bem-closure-nf-alarm{animation:none!important}}
html body #purchaseRoundNoInvoiceHelp{border:2px solid #c69c59;background:#fff7e8;padding:15px;border-radius:15px;color:#53330a}
html body #purchaseRoundNoInvoiceHelp strong{font-size:17px}html body #purchaseRoundNoInvoiceHelp p{margin:5px 0 0;font-size:15px}
html body #purchaseRoundNoBought{background:#fff5e5;border:2px solid #d5ab6c;border-radius:18px;padding:16px;color:#4d3212}
html body #purchaseRoundNoBought p{line-height:1.4;margin:6px 0 12px}
html body #purchaseRoundNoBought button{width:100%;min-height:48px}
html body #purchaseRoundLinkedOrders{display:grid;gap:10px;border:2px solid #dfc0e9;border-radius:16px;padding:15px}
html body #purchaseRoundLinkedOrders > strong{color:#4a2562;font-size:16px}
html body #purchaseRoundClosureNotice .bem-purchase-closed-details{margin-top:2px}
html body #purchaseRoundClosureNotice .bem-purchase-post-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
html body #purchaseRoundClosureNotice .bem-purchase-post-actions button{min-height:57px;font-size:clamp(14px,3.3vw,18px);font-weight:900;white-space:normal}
html body .bem-market-result{display:flex;align-items:center;justify-content:center;min-height:52px;border-radius:15px;padding:12px;font-size:clamp(16px,3.6vw,20px);font-weight:1000;line-height:1.2}
html body .bem-market-result.bought{background:#006b49;color:#fff;box-shadow:0 6px 16px rgba(2,96,61,.2)}
html body .bem-market-result.missing{background:#fce3e7;color:#8b1f3b;border:2px solid #ae4060}
html body .bem-market-responsibles{background:linear-gradient(155deg,#fff,#f7f0fa);border:2px solid #ceb3e2;border-radius:20px;padding:14px;display:grid;gap:10px;margin:12px 0}
html body .bem-market-assignee-heading{font-size:14px;color:#5b2f78;font-weight:1000;letter-spacing:.035em}
html body .bem-market-assignee-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid #dfcbe9;border-radius:15px;padding:12px;color:#3c2451}
html body .bem-market-assignee-row>div{flex:1;min-width:145px}
html body .bem-market-assignee-row small{font-weight:850;font-size:12px;display:block;color:#6b537b}
html body .bem-market-assignee-row strong{font-size:16px;display:block;line-height:1.3}
html body .bem-market-assignee-avatar{width:51px;min-width:51px;height:51px;display:grid;place-items:center;border-radius:50%;background:#7331af;color:#fff;font-size:19px;font-weight:900;overflow:hidden;border:3px solid #ead7f3}
html body .bem-market-assignee-avatar img{height:100%;width:100%;object-fit:cover}
html body .bem-market-assigned-tag{font-size:12px;font-weight:900;color:#603782;background:#f4eafa;padding:8px 10px;border-radius:10px}
html body .bem-market-claim-btn{border:0;background:linear-gradient(110deg,#682b9b,#994cbd);color:#fff;min-height:48px;padding:11px 16px;border-radius:13px;font-size:15px;font-weight:1000;cursor:pointer}
@media(max-width:400px){html body #purchaseRoundClosureNotice .bem-purchase-post-actions{grid-template-columns:minmax(0,1fr)}}

/* Correção de prioridade: recolhimento efetivo, mesmo com display:grid destacado. */
html body #purchaseRoundClosureNotice.bem-closure-workspace.hidden{display:none!important}
