/* BEM Gestão P31.4.9 — organização por assuntos. Mantém Aurora Glass e regras financeiras. */
:root { --bem-topic-deep:#542476; --bem-topic-purple:#6a3490; --bem-topic-bg:#f5edf9; }
#screen-dashboard .bem-topic-welcome {position:relative;overflow:hidden;margin:6px 0 16px;padding:24px 22px 25px;border-radius:26px;color:#fff;background:linear-gradient(135deg,#713a9d 0%,#542171 76%);box-shadow:0 15px 35px rgba(65,23,96,.17);}
#screen-dashboard .bem-topic-welcome::after {content:"";position:absolute;width:210px;height:210px;border-radius:50%;right:-65px;top:-78px;background:rgba(255,255,255,.075);pointer-events:none;}
.bem-topic-welcome .bem-topic-eyebrow {font-size:12px;font-weight:800;letter-spacing:.11em;opacity:.96;}
.bem-topic-welcome h2 {font-size:clamp(22px,5.5vw,31px)!important;line-height:1.15!important;color:#fff!important;font-weight:800!important;margin:17px 0 10px!important;letter-spacing:-.03em;}
.bem-topic-welcome h2 span {display:block;}
.bem-topic-welcome p {font-size:14px!important;line-height:1.5!important;color:#f5e8ff!important;margin:0!important;max-width:430px;}
.bem-topic-quick-actions {display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:24px;}
.bem-topic-task {border:1px solid #e6d4ef;background:rgba(255,255,255,.96);border-radius:20px;min-height:75px;padding:13px 13px;display:grid;grid-template-columns:46px minmax(0,1fr) 20px;align-items:center;text-align:left;gap:12px;box-shadow:0 7px 20px rgba(66,31,89,.06);color:#432f53;font:inherit;cursor:pointer;min-width:0;}
.bem-topic-task-icon {width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:#f2e5f8;font-size:24px;}
.bem-topic-task span:nth-child(2),.bem-topic-tile {min-width:0;}
.bem-topic-task strong,.bem-topic-tile strong {display:block;color:#4b305e;font-weight:800;font-size:14px;line-height:1.34;overflow-wrap:anywhere;white-space:normal;}
.bem-topic-task small,.bem-topic-tile small {display:block;margin-top:4px;color:#675773;font-size:12px;line-height:1.43;overflow-wrap:anywhere;white-space:normal;}
.bem-topic-task b {font-size:25px;font-weight:600;color:#713a9d;}
.bem-topic-task:focus-visible,.bem-topic-tile:focus-visible {outline:3px solid #ffca53;outline-offset:2px;}
.bem-topic-task:active,.bem-topic-tile:active {transform:translateY(1px);}
.bem-topic-secondary {margin-top:2px;padding:0;border-radius:16px;}
.bem-topic-secondary summary {cursor:pointer;font-weight:800;letter-spacing:.01em;color:#654377;list-style:none;display:flex;justify-content:space-between;gap:9px;align-items:center;min-height:50px;padding:12px 14px;}
.bem-topic-secondary summary::-webkit-details-marker{display:none;}
.bem-topic-secondary .dashboard-action-grid{margin-top:10px;}
.bem-topic-section-head {margin:6px 0 16px;padding:21px 19px;border-radius:24px;background:linear-gradient(135deg,#783dac,#542172);color:#fff;box-shadow:0 11px 27px rgba(74,28,114,.12);}
.bem-topic-section-head>span {font-size:12px;font-weight:800;letter-spacing:.09em;}
.bem-topic-section-head h2 {font-size:clamp(19px,5vw,26px);margin:10px 0 7px;color:#fff!important;line-height:1.27!important;overflow-wrap:anywhere;}
.bem-topic-section-head p {margin:0;color:#f5e9fc!important;font-size:13px;line-height:1.55;}
.bem-topic-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin:0 0 19px;}
.bem-topic-tile {min-height:132px;border:1px solid #e6d6ee;background:#fff;box-shadow:0 7px 21px rgba(71,33,91,.06);border-radius:21px;padding:17px 13px;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:3px;text-align:left;text-decoration:none!important;font:inherit;cursor:pointer;color:#4b305e;overflow-wrap:anywhere;}
.bem-topic-tile>span:first-child{font-size:26px;line-height:1.2;margin-bottom:7px;}
.bem-topic-tile-pending {background:#f4eff8;cursor:default;border-style:dashed;}
.bem-topic-tile-pending strong {color:#665776;}
/* The dashboard already handles today's priorities; don't duplicate another command center inside Purchases. */
#screen-compras #purchaseTodayCommandShell {display:none!important;}
/* The original buttons remain reachable while all labels become legible. */
.purchase-workspace-tab,.market-buy-actions .market-action,.purchase-nf-btn,.notes-photo-actions button,.bem-market-claim-btn {white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.33!important;min-width:0!important;height:auto!important;}
.purchase-workspace-tab strong,.purchase-workspace-tab small {white-space:normal!important;overflow-wrap:anywhere!important;text-overflow:clip!important;}
.market-buy-copy,.market-buy-main,.market-buy-row,.bem-market-assignee-row,.notes-photo-actions,.notes-new-section-main {min-width:0!important;}
.market-buy-copy strong,.market-buy-copy b,.bem-market-assignee-row strong,.notes-photo-actions strong {overflow-wrap:anywhere!important;white-space:normal!important;}
.bem-market-assignee-avatar,.product-visual img {object-fit:contain;flex-shrink:0;}
/* Focus targets sized for inexperienced users; apply only to topic cards and action buttons. */
.bem-topic-task,.bem-topic-tile {touch-action:manipulation;}
@media(max-width:390px){.bem-topic-grid{grid-template-columns:1fr 1fr;gap:8px}.bem-topic-tile{padding:14px 11px;min-height:139px}.bem-topic-tile strong{font-size:12px}.bem-topic-tile small{font-size:11px}.bem-topic-task{grid-template-columns:43px minmax(0,1fr) 16px;gap:9px;padding:11px}.bem-topic-task strong{font-size:13px}.bem-topic-task small{font-size:12px}.bem-topic-section-head{padding:18px 15px;}}
@media(max-width:330px){.bem-topic-grid{grid-template-columns:1fr}.bem-topic-tile{min-height:88px;display:grid;grid-template-columns:36px 1fr;column-gap:12px;align-content:center}.bem-topic-tile>span:first-child{grid-row:span 2;margin:0}.bem-topic-tile small{grid-column:2;}}
@media(min-width:760px){.bem-topic-quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.bem-topic-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.bem-topic-task,.bem-topic-tile{transition:none!important;transform:none!important;}}

@media(max-width:430px){.bem-topic-grid{grid-template-columns:1fr;gap:9px}.bem-topic-tile{min-height:88px;display:grid;grid-template-columns:40px minmax(0,1fr);column-gap:13px;align-content:center;align-items:center;padding:13px 15px}.bem-topic-tile>span:first-child{grid-row:span 2;margin:0;font-size:26px}.bem-topic-tile strong{font-size:14px}.bem-topic-tile small{font-size:12px;grid-column:2}}

#adminNav .nav-btn{min-width:0!important}#adminNav .nav-btn small{max-width:100%;white-space:normal!important;overflow-wrap:anywhere!important;text-overflow:clip!important;font-size:11px;line-height:1.12;}
#moreMenuSheet .more-menu-item{min-width:0!important;height:auto!important}#moreMenuSheet .more-menu-item strong,#moreMenuSheet .more-menu-item small{white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.38!important}
#screen-compras .purchase-workspace-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}#screen-compras .purchase-workspace-tab{min-height:65px!important;padding:12px!important;flex-wrap:wrap!important;}
@media(min-width:760px){#screen-compras .purchase-workspace-tabs{grid-template-columns:repeat(4,minmax(0,1fr))!important}}

/* As mesmas entradas agora vivem na área correta; escondemos atalhos duplicados sem remover handlers. */
#moreMenuSheet .bem-topic-hidden-legacy-menu,#screen-controle .finance-hub-grid {display:none!important;}

.bem-manager-steps{background:#fff;border:1px solid #e4d3ef;border-radius:18px;padding:14px 16px;margin-bottom:13px;box-shadow:0 6px 15px rgba(75,35,105,.06)}
.bem-manager-steps>strong{display:block;font-size:12px;color:#713c92;letter-spacing:.06em;margin-bottom:9px;overflow-wrap:anywhere;}
.bem-manager-steps>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
.bem-manager-steps span{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:700;line-height:1.3;color:#4b365a;white-space:normal;overflow-wrap:anywhere;}
.bem-manager-steps span b{flex-shrink:0;background:#713c92;color:#fff;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;}
@media(max-width:360px){.bem-manager-steps>div{grid-template-columns:1fr}.bem-manager-steps span{font-size:13px;}}

/* Baixa de NF na mesma ficha: fornecedor, PIX, data e confirmação; legível no celular. */
.bem-payment-checkout{width:min(92vw,540px);max-height:min(92dvh,780px);overflow-y:auto;overscroll-behavior:contain;padding:24px;box-sizing:border-box;border-radius:24px;}
.bem-payment-checkout .financial-dates-modal-head{display:flex;align-items:flex-start;gap:14px;justify-content:space-between;margin-bottom:18px;}
.bem-payment-checkout .financial-dates-modal-head h2{font-size:clamp(19px,5vw,25px);line-height:1.28;overflow-wrap:anywhere;}
.bem-payment-checkout .financial-dates-modal-head p{font-size:13px;line-height:1.5;}
.bem-payment-summary{display:grid;grid-template-columns:34px minmax(0,1fr);gap:12px;padding:16px;border:1px solid #dbc7e8;border-radius:17px;background:#f8f3fb;align-items:center;}
.bem-payment-summary>span{font-size:25px;}
.bem-payment-summary>div{min-width:0;}
.bem-payment-summary strong,.bem-payment-summary small{display:block;overflow-wrap:anywhere;white-space:normal;line-height:1.45;}
.bem-payment-summary>b{grid-column:2;font-size:clamp(22px,6vw,29px);color:#512470;font-weight:800;}
.bem-payment-pix{background:#fff;border:1px solid #e6d8eb;border-radius:17px;padding:16px;margin:12px 0;display:grid;gap:9px;min-width:0;}
.bem-payment-pix-head{display:grid;gap:4px;}
.bem-payment-pix-head strong{color:#542875;font-size:13px;line-height:1.4;}
.bem-payment-pix-head small,.bem-payment-pix>small{color:#55455f;line-height:1.5;font-size:12px;}
.bem-payment-pix-value{overflow-wrap:anywhere;word-break:break-word;white-space:normal;font-size:15px;line-height:1.45;}
.bem-payment-pix button{min-height:49px;}
.bem-payment-checkout #financialPaymentForm{display:grid;gap:12px;}
.bem-payment-checkout #financialPaymentForm label{display:grid;gap:7px;}
.bem-payment-checkout #financialPaymentConfirmDate{min-height:50px;font-size:18px;padding:11px 14px;width:100%;box-sizing:border-box;}
.bem-payment-checkout #financialPaymentForm button{min-height:51px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;}
.bem-payment-safety{padding:13px;border-left:4px solid #8050a7;border-radius:10px;background:#f9f5fc;font-size:13px;line-height:1.5;color:#493451;}
@media(max-width:360px){.bem-payment-checkout{padding:16px 13px;}.bem-payment-pix,.bem-payment-summary{padding:12px;}}

/* BEM P31.5 — comprovantes na mesma ficha financeira */
.bem-receipt-field{display:grid;gap:8px;max-width:100%;padding:14px;border-radius:15px;background:rgba(116,73,168,.07);border:1px solid rgba(129,91,161,.2)}
.bem-receipt-field span{font-weight:800;line-height:1.4;overflow-wrap:anywhere}
.bem-receipt-field small{font-size:14px;line-height:1.45;color:inherit;opacity:.85}
.bem-receipt-field input[type="file"]{width:100%;min-width:0;max-width:100%;font:inherit;font-size:15px;white-space:normal;overflow-wrap:anywhere}
.bem-attach-receipt-btn{min-height:48px;padding:11px 15px;border-radius:13px;background:#eee8ff;border:1px solid #8362ae;color:#3a1c64;font-weight:800;line-height:1.4;white-space:normal;overflow-wrap:anywhere;text-align:center}
.financial-doc-card-actions>*{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}
@media(max-width:430px){.bem-payment-checkout{width:calc(100% - 12px);max-width:100%;box-sizing:border-box}.bem-payment-checkout .financial-dates-modal-head>*{min-width:0}}

/* Histórico de pagamentos no mesmo assunto, sem segunda navegação */
.weekly-receipt-history{margin:18px 0;padding:12px;border:1px solid rgba(122,81,174,.24);border-radius:17px;overflow:hidden}
.weekly-receipt-history>summary{cursor:pointer;padding:12px;font-weight:850;line-height:1.5;white-space:normal}
.weekly-receipt-history-rows{display:grid;gap:10px}
.weekly-receipt-history-row{display:grid;gap:10px;padding:13px;border-radius:13px;background:rgba(145,99,178,.07)}
.weekly-receipt-history-row>div:first-child{display:grid;gap:4px;min-width:0}
.weekly-receipt-history-row strong,.weekly-receipt-history-row small{overflow-wrap:anywhere}
.weekly-receipt-history-row small{font-size:14px;line-height:1.5}
.weekly-receipt-history-actions{display:flex;flex-wrap:wrap;gap:8px}
.weekly-receipt-history-actions a,.weekly-receipt-history-actions button,.weekly-proof-link{min-height:48px;padding:10px 14px;border-radius:12px;border:1px solid #916cbb;color:#3b215e;background:#eee8ff;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font:inherit;font-weight:800;line-height:1.4;white-space:normal;overflow-wrap:anywhere;max-width:100%}

/* P31.5 revisão mobile: filtros da NF sempre inteiros, sem último botão cortado. */
@media (max-width:430px) {
  #screen-financeiro .notes-filter-chips { display:flex;flex-wrap:wrap;overflow-x:visible;gap:7px;max-width:100%; }
  #screen-financeiro .notes-filter-chips button { flex:0 1 auto;white-space:normal;overflow-wrap:break-word;min-height:38px;font-size:11px;padding:9px 12px; }
}
