/* BMCenter Finanças — contrato estrutural único de layout v110 */
:root{
  --bm-sidebar-width:clamp(220px,17.5vw,242px);
  --bm-content-gap:14px;
  --bm-table-date:94px;
  --bm-table-amount:108px;
  --bm-table-action:160px;
}
html[data-bmf-layout],html[data-bmf-layout] body,html[data-bmf-layout] #app{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
html[data-bmf-layout] *,html[data-bmf-layout] *::before,html[data-bmf-layout] *::after{box-sizing:border-box}
html[data-bmf-layout] body{margin:0}
html[data-bmf-layout] #app,
html[data-bmf-layout] #app .app-shell,
html[data-bmf-layout] #app .main,
html[data-bmf-layout] #app .content,
html[data-bmf-layout] #app .page,
html[data-bmf-layout] #app .page-card,
html[data-bmf-layout] #app .fa-main,
html[data-bmf-layout] #app .fa-page,
html[data-bmf-layout] #app .fa-generic,
html[data-bmf-layout] #app .settings-panel,
html[data-bmf-layout] #app .integration-card{min-width:0;max-width:100%}
html[data-bmf-layout] #app img,html[data-bmf-layout] #app svg,html[data-bmf-layout] #app canvas{max-width:100%}
html[data-bmf-layout] #app input,html[data-bmf-layout] #app select,html[data-bmf-layout] #app textarea,html[data-bmf-layout] #app button{min-width:0;max-width:100%}

/* DESKTOP: uma única estrutura web para todas as rotas. */
html[data-bmf-layout="desktop"],html[data-bmf-layout="desktop"] body{overflow-x:hidden!important}
html[data-bmf-layout="desktop"] body{padding-bottom:0!important}
html[data-bmf-layout="desktop"] #app .fa-bottom,html[data-bmf-layout="desktop"] #app .v33-bottom{display:none!important;visibility:hidden!important;pointer-events:none!important}
html[data-bmf-layout="desktop"] #app .app-shell{display:grid!important;grid-template-columns:var(--bm-sidebar-width) minmax(0,1fr)!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:100vh!important;overflow-x:hidden!important}
html[data-bmf-layout="desktop"] #app .sidebar{display:flex!important;width:auto!important;min-width:0!important;max-width:100%!important}
html[data-bmf-layout="desktop"] #app .main{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;overflow-x:hidden!important}
html[data-bmf-layout="desktop"] #app .content{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;padding-left:clamp(12px,1.4vw,22px)!important;padding-right:clamp(12px,1.4vw,22px)!important;overflow-x:hidden!important}
html[data-bmf-layout="desktop"] #app .page,html[data-bmf-layout="desktop"] #app .page-card,html[data-bmf-layout="desktop"] #app .fa-page,html[data-bmf-layout="desktop"] #app .fa-generic{width:100%!important;min-width:0!important;max-width:100%!important}

/* Cabeçalhos, barras e grupos de ação nunca extrapolam a área útil. */
html[data-bmf-layout="desktop"] #app .topbar{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:64px!important;padding:8px clamp(12px,1.4vw,22px)!important;overflow:visible!important}
html[data-bmf-layout="desktop"] #app .topbar .search-box{flex:1 1 260px!important;width:auto!important;min-width:190px!important;max-width:none!important}
html[data-bmf-layout="desktop"] #app .topbar .date-box{flex:0 1 226px!important;width:auto!important;min-width:180px!important;max-width:226px!important}
html[data-bmf-layout="desktop"] #app .topbar .action-btn{flex:0 1 128px!important;width:auto!important;min-width:104px!important;max-width:142px!important;padding-left:9px!important;padding-right:9px!important;white-space:nowrap!important}
html[data-bmf-layout="desktop"] #app .topbar .bell{flex:0 0 40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;margin-left:auto!important}
html[data-bmf-layout="desktop"] #app .page-header,
html[data-bmf-layout="desktop"] #app .page-head,
html[data-bmf-layout="desktop"] #app .page-actions,
html[data-bmf-layout="desktop"] #app .toolbar,
html[data-bmf-layout="desktop"] #app .filters,
html[data-bmf-layout="desktop"] #app .filter-row,
html[data-bmf-layout="desktop"] #app .forecast-nav-wrap{min-width:0!important;max-width:100%!important;flex-wrap:wrap!important}
html[data-bmf-layout="desktop"] #app .page-header{align-items:flex-start!important;gap:12px!important}
html[data-bmf-layout="desktop"] #app .page-header>div:first-child{flex:1 1 360px!important;min-width:0!important}
html[data-bmf-layout="desktop"] #app .page-actions{flex:0 1 auto!important;display:flex!important;justify-content:flex-end!important;gap:7px!important}
html[data-bmf-layout="desktop"] #app .page-actions>*{flex:0 1 auto!important;white-space:nowrap!important}

/* Tabelas: todas obedecem ao mesmo contrato, sem rolagem horizontal da página. */
html[data-bmf-layout="desktop"] #app .table-wrap,
html[data-bmf-layout="desktop"] #app .forecast-table-wrap,
html[data-bmf-layout="desktop"] #app .record-table-wrap,
html[data-bmf-layout="desktop"] #app .transaction-table-wrap,
html[data-bmf-layout="desktop"] #app .page-card>div[style*="overflow:auto"]{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;overflow-y:visible!important}
html[data-bmf-layout="desktop"] #app table.data-table,
html[data-bmf-layout="desktop"] #app table.tx-table,
html[data-bmf-layout="desktop"] #app table.record-table{display:table!important;width:100%!important;min-width:0!important;max-width:100%!important;border-collapse:collapse!important;table-layout:fixed!important}
html[data-bmf-layout="desktop"] #app table.data-table thead,
html[data-bmf-layout="desktop"] #app table.tx-table thead,
html[data-bmf-layout="desktop"] #app table.record-table thead{display:table-header-group!important;visibility:visible!important}
html[data-bmf-layout="desktop"] #app table.data-table tbody,
html[data-bmf-layout="desktop"] #app table.tx-table tbody,
html[data-bmf-layout="desktop"] #app table.record-table tbody{display:table-row-group!important;width:auto!important}
html[data-bmf-layout="desktop"] #app table.data-table tr,
html[data-bmf-layout="desktop"] #app table.tx-table tr,
html[data-bmf-layout="desktop"] #app table.record-table tr{display:table-row!important;width:auto!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;border-radius:0!important;box-shadow:none!important;grid-template-columns:none!important;gap:0!important;cursor:default!important}
html[data-bmf-layout="desktop"] #app table.data-table th,
html[data-bmf-layout="desktop"] #app table.data-table td,
html[data-bmf-layout="desktop"] #app table.tx-table th,
html[data-bmf-layout="desktop"] #app table.tx-table td,
html[data-bmf-layout="desktop"] #app table.record-table th,
html[data-bmf-layout="desktop"] #app table.record-table td{display:table-cell!important;position:static!important;min-width:0!important;max-width:none!important;height:auto!important;margin:0!important;grid-column:auto!important;grid-row:auto!important;vertical-align:middle!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:normal!important;word-break:normal!important;white-space:normal!important}
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] th[data-bm-role="date"],
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="date"]{width:var(--bm-table-date)!important;min-width:var(--bm-table-date)!important;max-width:var(--bm-table-date)!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] th[data-bm-role="amount"],
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="amount"]{width:var(--bm-table-amount)!important;min-width:var(--bm-table-amount)!important;max-width:var(--bm-table-amount)!important;text-align:right!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] th[data-bm-role="action"],
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="action"]{width:var(--bm-table-action)!important;min-width:var(--bm-table-action)!important;max-width:var(--bm-table-action)!important;text-align:right!important;overflow:visible!important}
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="action"]>div,
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="action"]>.record-row-actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-end!important;align-items:center!important;gap:4px!important;width:100%!important;max-width:100%!important}
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="action"] button,
html[data-bmf-layout="desktop"] #app table[data-bm-responsive="1"] td[data-bm-role="action"] a{flex:0 1 auto!important;width:auto!important;min-width:0!important;max-width:100%!important;height:29px!important;padding:0 7px!important;font-size:8.5px!important;line-height:1!important;white-space:nowrap!important}
html[data-bmf-layout="desktop"] #app table.bm-table-dense th,
html[data-bmf-layout="desktop"] #app table.bm-table-dense td{padding-left:6px!important;padding-right:6px!important;font-size:9.5px!important}
html[data-bmf-layout="desktop"] #app table.data-table td::before,
html[data-bmf-layout="desktop"] #app table.tx-table td::before,
html[data-bmf-layout="desktop"] #app table.record-table td::before,
html[data-bmf-layout="desktop"] #app table.data-table tr::after{display:none!important;content:none!important}

/* Janelas desktop seguem o mesmo limite de viewport. */
html[data-bmf-layout="desktop"] .modal-backdrop,
html[data-bmf-layout="desktop"] .bm-v58-modal-bg,
html[data-bmf-layout="desktop"] .fa-modal-bg,
html[data-bmf-layout="desktop"] .record-backdrop,
html[data-bmf-layout="desktop"] .obligation-modal-backdrop{align-items:center!important;justify-content:center!important;padding:18px!important}
html[data-bmf-layout="desktop"] .modal,
html[data-bmf-layout="desktop"] .bm-v58-modal,
html[data-bmf-layout="desktop"] .fa-modal,
html[data-bmf-layout="desktop"] .record-modal{max-width:min(760px,calc(100vw - 36px))!important;max-height:calc(100vh - 36px)!important}

/* MOBILE: o shell e as tabelas são cartões expansíveis; uma regra para todas as páginas. */
html[data-bmf-layout="mobile"],html[data-bmf-layout="mobile"] body{overflow-x:hidden!important;background:#eef2f7!important}
html[data-bmf-layout="mobile"] body{padding:0!important}
html[data-bmf-layout="mobile"] #app{min-height:100dvh!important;overflow:visible!important}
html[data-bmf-layout="mobile"] #app .app-shell{display:block!important;width:100%!important;max-width:100%!important;min-height:100dvh!important}
html[data-bmf-layout="mobile"] #app .sidebar{display:none!important;width:0!important;min-width:0!important}
html[data-bmf-layout="mobile"] #app .main,html[data-bmf-layout="mobile"] #app .content{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding-left:0!important;padding-right:0!important;overflow:visible!important}
html[data-bmf-layout="mobile"] #app .fa-app{width:calc(100% - 10px)!important;max-width:100%!important;min-height:100dvh!important;height:auto!important;margin:5px auto 0!important;padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;overflow:visible!important}
html[data-bmf-layout="mobile"] #app .fa-main,html[data-bmf-layout="mobile"] #app .fa-generic,html[data-bmf-layout="mobile"] #app .page,html[data-bmf-layout="mobile"] #app .page-card{width:100%!important;max-width:100%!important;min-width:0!important;min-height:0!important;height:auto!important;overflow:visible!important}
html[data-bmf-layout="mobile"] #app .fa-main{padding-bottom:14px!important}
html[data-bmf-layout="mobile"] #app .settings-grid,html[data-bmf-layout="mobile"] #app .integration-list{grid-template-columns:1fr!important;width:100%!important;max-width:100%!important}
html[data-bmf-layout="mobile"] #app .fa-bottom{position:fixed!important;left:5px!important;right:5px!important;bottom:0!important;z-index:300000!important;padding-bottom:env(safe-area-inset-bottom)!important}
html[data-bmf-layout="mobile"] #app select,html[data-bmf-layout="mobile"] #app input,html[data-bmf-layout="mobile"] #app textarea,html[data-bmf-layout="mobile"] #app button{pointer-events:auto!important;touch-action:manipulation}

html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"]{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;border:0!important;border-collapse:separate!important;background:transparent!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] thead{display:none!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody{display:grid!important;width:100%!important;gap:7px!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row="1"]{position:relative!important;display:grid!important;grid-template-columns:68px minmax(0,1fr) auto 18px!important;align-items:center!important;gap:7px!important;width:100%!important;min-width:0!important;min-height:52px!important;height:auto!important;margin:0!important;padding:9px 10px!important;border:1px solid #e1e8f1!important;border-radius:13px!important;background:#fff!important;box-shadow:0 3px 10px rgba(25,50,84,.04)!important;cursor:pointer!important;overflow:hidden!important;touch-action:pan-y!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row="1"]::after{content:'›'!important;display:block!important;grid-column:4!important;grid-row:1!important;color:#78879b!important;font:700 21px/1 Inter,Arial,sans-serif!important;text-align:center!important;transform-origin:center!important;transition:transform .14s ease!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]::after{transform:rotate(90deg)!important;align-self:start!important;margin-top:4px!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row="1"]>td{display:none!important;min-width:0!important;width:auto!important;max-width:none!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;white-space:normal!important;overflow-wrap:anywhere!important;vertical-align:middle!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="date"],
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="primary"],
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="amount"]{display:block!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="date"]{grid-column:1!important;color:#69778d!important;font-size:8.5px!important;white-space:nowrap!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="primary"]{grid-column:2!important;color:#203554!important;font-size:10px!important;font-weight:800!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td[data-bm-role="amount"]{grid-column:3!important;color:#263b5a!important;font-size:9.5px!important;font-weight:850!important;text-align:right!important;white-space:nowrap!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="closed"]>td::before{display:none!important;content:none!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]{grid-template-columns:1fr 1fr!important;align-items:start!important;padding:12px!important;gap:10px 12px!important;overflow:visible!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]::after{grid-column:2!important;grid-row:1!important;justify-self:end!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td{display:grid!important;grid-template-columns:1fr!important;gap:3px!important;padding:8px 9px!important;border-radius:9px!important;background:#f7f9fc!important;color:#263b5a!important;font-size:9.5px!important;line-height:1.35!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td::before{content:attr(data-bm-label)!important;display:block!important;color:#8490a2!important;font-size:7.5px!important;font-weight:700!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td[data-bm-role="primary"]{padding-right:28px!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td[data-bm-role="action"]{grid-column:1/-1!important;display:flex!important;flex-wrap:wrap!important;justify-content:flex-end!important;align-items:center!important;gap:7px!important;background:transparent!important;padding:2px 0 0!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td[data-bm-role="action"]::before{display:none!important;content:none!important}
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td[data-bm-role="action"] button,
html[data-bmf-layout="mobile"] #app table[data-bm-responsive="1"] tbody tr[data-bm-row-state="open"]>td[data-bm-role="action"] a{min-height:34px!important}

/* Seletor compartilhado: não é modal/backdrop, portanto não entra nos observadores legados de janelas. */
.bm-choice-popover{position:fixed;z-index:3100000;display:flex;flex-direction:column;left:var(--bm-choice-left,calc(50% - 210px));top:var(--bm-choice-top,18vh);width:var(--bm-choice-width,420px);max-width:calc(100vw - 20px);max-height:min(520px,72vh);overflow:hidden;border:1px solid #dce5f0;border-radius:16px;background:#fff;box-shadow:0 22px 65px rgba(20,38,68,.25);font-family:Inter,Arial,sans-serif}
.bm-choice-popover>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 15px 11px;border-bottom:1px solid #edf1f6;background:#fff}.bm-choice-popover h2{margin:0;color:#20324e;font-size:15px;line-height:1.25}.bm-choice-popover p{margin:4px 0 0;color:#758299;font-size:10px;line-height:1.4}.bm-choice-close{flex:0 0 34px;width:34px;height:34px;border:0;border-radius:9px;background:#f2f5f9;color:#52627a;font-size:20px;cursor:pointer}.bm-choice-list{display:grid;gap:6px;min-height:0;overflow-y:auto;padding:9px;-webkit-overflow-scrolling:touch}.bm-choice-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:46px;padding:9px 11px;border:1px solid #dfe6ef;border-radius:10px;background:#fff;color:#20324e;text-align:left;cursor:pointer}.bm-choice-option span{font-size:11px;font-weight:750}.bm-choice-option small{font-size:8.5px;color:#7b879b}.bm-choice-option.selected{border-color:#7da9fb;background:#f3f7ff}.bm-choice-empty{padding:18px;color:#7b879b;font-size:10px;text-align:center}
html[data-bmf-layout="mobile"] .bm-choice-popover{left:8px!important;right:8px!important;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:min(68dvh,560px)!important;border-radius:17px!important;box-shadow:0 -8px 36px rgba(20,38,68,.22)!important}
html[data-bmf-layout="mobile"] .bm-choice-popover>header{padding:14px!important}.bm-choice-popover .bm-choice-option:focus{outline:2px solid rgba(8,114,249,.22);outline-offset:1px}
