/* Composição aprovada da bancada. Seletores escopados; nenhuma regra comercial. */
html.mwb-fixed-tabs body #shortcutBar { display:none!important; }
html.mwb-fixed-tabs body #workspaceTabs {
  position:fixed!important; top:var(--mwb-header-bottom,44px)!important;
  left:0!important; right:0!important; width:100%!important; max-width:none!important;
  margin:0!important; padding:5px 8px 0!important; box-sizing:border-box; z-index:199;
}
html.mwb-fixed-tabs body #workspaceTabs[hidden] { display:none!important; }
html.mwb-fixed-tabs body #sidebar { top:var(--mwb-content-top,84px)!important; height:calc(100dvh - var(--mwb-content-top,84px))!important; }
html.mwb-fixed-tabs body:has(#sidebar) #mainContent { margin-top:var(--mwb-content-offset,84px)!important; }
html.mwb-system.mg-system body :is(#clientesTableWrapper,#finReceberTableWrapper,#finPagarTableWrapper) table { min-width:850px; }
html.mwb-system.mg-system body #clientesTableWrapper table :is(td,th) { word-break:normal!important;overflow-wrap:normal!important; }
html.mwb-system.mg-system body #pageDashboard {
  --bg-secondary:var(--mg-raised); --bg-primary:var(--mg-surface); --text:var(--mg-text); --text-muted:var(--mg-muted);
}
html.mwb-system.mg-system body #pageDashboard>.page-header { box-shadow:none!important; }
html.mwb-system.mg-system body #pageDashboard :is(.data-card-header,.widget-controls button,.widget-drag-handle) { background:var(--mg-raised)!important; color:var(--mg-text)!important; border-color:var(--mg-line)!important; }
html.mwb-system.mg-system body #pageDashboard .size-btn-active { background:var(--mwb-accent-soft)!important; color:var(--mg-accent)!important; }
html.mwb-system.mg-system body #pageDashboard .widget-header-draggable { display:flex!important; flex-wrap:wrap!important; gap:10px!important; align-items:center!important; }
html.mwb-system.mg-system body #pageDashboard .widget-header-main { flex:1 0 150px; min-width:0; }
html.mwb-system.mg-system body #pageDashboard .widget-controls { position:static!important; flex:1 1 240px; min-width:0!important; display:flex!important; flex-wrap:wrap!important; justify-content:flex-start!important; gap:6px!important; }
html.mwb-system.mg-system body #pageDashboard [data-widget-key=comparativoDiario] [style*="min-width:280px"] { min-width:0!important; flex:1 1 100%!important; }
html.mwb-system.mg-system body #pageDashboard [data-widget-key=comparativoDiario] [style*="min-width:350px"] { min-width:0!important; flex:1 1 100%!important; }
html.mwb-system.mg-system body #pageDashboard .dash-freshness-main { color:var(--mg-text)!important; }
html.mwb-system.mg-system body #pageDashboard :is(.dash-freshness-meta,.dash-freshness-label) { color:var(--mg-muted)!important; }
html.mwb-system.mg-system[data-theme=light] body #pageDashboard .badge-success { color:#246f50!important; }
html.mwb-system.mg-system[data-theme=light] body #pageDashboard .badge-warning { color:#8a4d0a!important; }
.mwb-nav-toggle { display:none; }
@media(min-width:1101px) {
  html.mwb-system body #sidebar { width:230px!important; }
  html.mwb-system body:has(#sidebar) #mainContent { margin-left:230px!important; width:calc(100% - 230px)!important; padding:20px 26px!important; }
  html.mwb-system body .sidebar-nav { padding:8px!important; }
  html.mwb-system body .sidebar-nav>a, html.mwb-system body .sidebar-group-items a { padding:9px 12px!important; min-height:36px; font-size:12px; }
  html.mwb-system body .mwb-nav-toggle { display:block; width:calc(100% - 20px); margin:10px; background:var(--mg-raised); color:var(--mg-muted); border:1px solid var(--mg-line); border-radius:8px; padding:9px; cursor:pointer; }
  html.mwb-system.mwb-nav-compact body #sidebar { width:76px!important; }
  html.mwb-system.mwb-nav-compact body:has(#sidebar) #mainContent { margin-left:76px!important; width:calc(100% - 76px)!important; }
  html.mwb-system.mwb-nav-compact body #sidebar :is(.mwb-nav-label,.sidebar-arrow) { display:none; }
  html.mwb-system.mwb-nav-compact body #unifiedNavContexts { grid-template-columns:1fr; }
  html.mwb-system.mwb-nav-compact body #unifiedNavContexts button { overflow:hidden; padding:8px 0; font-size:9px; }
  html.mwb-system.mwb-nav-compact body #sidebar .sidebar-group-items a .mwb-nav-label { display:block; overflow:hidden; white-space:nowrap; width:24px; }
  html.mwb-system.mwb-nav-compact body #sidebar .mu-item { justify-content:center; padding-inline:10px!important; }
  html.mwb-system.mwb-nav-compact body #sidebar .mu-item .sidebar-icon { flex:0 0 22px; width:22px; text-align:center; }
  html.mwb-system.mwb-nav-compact body #sidebar .sidebar-group-toggle { padding:10px; }
  html.mwb-system body .dash-widgets-grid { display:grid!important; grid-template-columns:repeat(12,minmax(0,1fr))!important; gap:18px!important; }
  html.mwb-system body .dash-w-small { grid-column:span 3!important; }
  html.mwb-system body .dash-w-half { grid-column:span 6!important; }
  html.mwb-system body .dash-w-full { grid-column:1 / -1!important; }
  html.mwb-system:not(.mwb-dashboard-free) body [data-widget-key=faturamento] { grid-column:span 8!important; }
  html.mwb-system:not(.mwb-dashboard-free) body [data-widget-key=comparativoDiario] { grid-column:span 4!important; }
}
html.mwb-system body :is(#clientesTableWrapper,#pedidosCompraTableWrapper,#finReceberTableWrapper,#finPagarTableWrapper) { overflow:auto; max-width:100%; }
html.mwb-system body :is(#clientesTableWrapper,#finReceberTableWrapper,#finPagarTableWrapper) table td:first-child { position:sticky; left:0; background:var(--mg-surface); z-index:1; }
html.mwb-system body .mwb-task-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; color:var(--mg-muted); font-size:12px; }
html.mwb-system body .mwb-task-board { display:grid; grid-template-columns:repeat(3,minmax(230px,1fr)); gap:16px; overflow:auto; padding-bottom:12px; }
html.mwb-system body .mwb-task-board[hidden], html.mwb-system body .mwb-task-list[hidden] { display:none!important; }
html.mwb-system body .mwb-task-column { padding:12px; border:1px solid var(--mg-line); background:var(--mg-canvas); border-radius:12px; min-width:0; }
html.mwb-system body .mwb-task-column h3 { font-size:12px; margin:0 0 16px; color:var(--mg-muted); }
html.mwb-system body .mwb-task-card { border:1px solid var(--mg-line); border-radius:9px; background:var(--mg-surface); margin-bottom:10px; flex-wrap:wrap; overflow-wrap:anywhere; }
html.mwb-system body .mwb-task-card>[style*="flex:1"] { flex-basis:calc(100% - 50px)!important; }
html.mwb-system body .mwb-task-card [role=button] { min-width:30px; min-height:30px; display:grid; place-items:center; }
html.mwb-system body .mwb-task-card .btn-icon { width:auto!important; height:auto!important; min-height:32px; padding:6px 9px; font-size:11px; white-space:nowrap; border:1px solid var(--mg-line); background:var(--mg-raised); border-radius:7px; color:var(--mg-text); }
html.mwb-system body .mwb-task-card .btn-icon.danger { color:var(--danger,#e25757); }
html.mwb-system body .mwb-column-empty { font-size:12px; color:var(--mg-muted); }
html.mwb-system body #pageFinanceiro { position:relative; }
html.mwb-system body .mwb-fin-panel { background:var(--mg-surface); border:1px solid var(--mg-line); border-radius:12px; padding:18px; position:fixed; z-index:5000; inset:70px 12px 12px; overflow:auto; }
html.mwb-system body .mwb-detail-header { display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--mg-line); padding-bottom:14px; }
html.mwb-system body .mwb-detail-header h2 { font-size:16px; margin:0; }
html.mwb-system body .mwb-fin-panel dt { font-size:11px; color:var(--mg-muted); margin-top:18px; }
html.mwb-system body .mwb-fin-panel dd { margin:6px 0 0; font-size:14px; overflow-wrap:anywhere; }
@media(min-width:1280px) {
  html.mwb-system body .page.mwb-has-detail { padding-right:474px!important; }
  html.mwb-system body .wm-window.mwb-docked { position:fixed!important; left:auto!important; right:58px!important; top:112px!important; bottom:52px!important; height:auto!important; width:420px!important; min-width:0!important; border:1px solid var(--mg-line)!important; border-radius:12px!important; box-shadow:0 12px 35px #0003!important; }
  html.mwb-system body .mwb-docked .wm-resize { display:none; }
  html.mwb-system body .mwb-docked .wm-titlebar { cursor:default; }
  html.mwb-system body .mwb-docked .wm-body { overflow:auto!important; }
  html.mwb-system body .mwb-docked .modal-body { max-height:none!important; padding:16px!important; }
  html.mwb-system body .mwb-docked #clienteDadosGrid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html.mwb-system body .mwb-docked #pcDetalheContent [style*="grid-template-columns:repeat(3,minmax(170px"] { grid-template-columns:minmax(0,1fr)!important; }
  html.mwb-system body .mwb-has-detail .data-card-header { flex-wrap:wrap!important; gap:12px; }
  html.mwb-system body .mwb-has-detail .data-card-header h3 { flex:1 0 100%; }
  html.mwb-system body .page.mwb-fin-detail { padding-right:354px!important; }
  html.mwb-system body .mwb-fin-panel { position:absolute; inset:76px 0 auto auto; width:330px; max-height:calc(100vh - 180px); box-sizing:border-box; z-index:4; }
}
/* A mesma venda e os mesmos botões; resumo fixado à direita no espaço disponível. */
html.mwb-system.mg-system body.mi-sales #app :is(header,.card,.cli-details,.tot,.sale-step,.sale-smartbar,.sale-timeline) { background:var(--mg-surface)!important; color:var(--mg-text)!important; border-color:var(--mg-line)!important; box-shadow:none!important; }
html.mwb-system.mg-system body.mi-sales #app :is(label,.k,.lbl,.cli-detail label,.sale-alert small) { color:var(--mg-muted)!important; }
html.mwb-system.mg-system body.mi-sales #app .sale-step.active { background:var(--mwb-accent-soft)!important; color:var(--mg-accent)!important; }
html.mwb-system.mg-system body.mi-sales #app .sale-alert { background:var(--mg-raised)!important; color:var(--mg-text)!important; }
html.mwb-system.mg-system body.mi-sales #app .tot.big .val { color:var(--mg-accent)!important; }
html.mwb-system.mg-system body.mi-sales #app :is(.sale-alert b,.tot .val,.next-action) { color:var(--mg-text)!important; }
@media(max-width:760px) {
  html.mwb-system body .mwb-task-board { grid-template-columns:repeat(3,minmax(240px,85%)); scroll-snap-type:x proximity; }
  html.mwb-system body .mwb-task-column { scroll-snap-align:start; }
  html.mwb-system body #finDashboard>div[style*="grid-template-columns"] { grid-template-columns:minmax(0,1fr)!important; }
}
@media print {
  html.mwb-system body :is(.mwb-nav-toggle,.mwb-fin-panel,.mwb-task-toolbar) { display:none!important; }
  html.mwb-system body :is(.page.mwb-has-detail,.page.mwb-fin-detail) { padding-right:0!important; }
  html.mwb-system body .wm-window.mwb-docked { position:static!important; width:100%!important; height:auto!important; }
  html.mwb-system.mg-system body.mi-sales #app main { display:block!important; }
}

html.mwb-system body #sidebar .sidebar-group-toggle { justify-content:flex-start; gap:10px; }
html.mwb-system body #sidebar .sidebar-group-toggle .sidebar-icon { flex:0 0 22px; width:22px; text-align:center; }
html.mwb-system body #sidebar .sidebar-group-toggle .mwb-nav-label { flex:1; min-width:0; text-align:left; }
html.mwb-system body #sidebar .sidebar-group-toggle .sidebar-arrow { flex:0 0 12px; margin-left:auto; text-align:center; }

/* Keep email tabs and the TV preview reachable inside their available column. */
html.mwb-system body #clienteDadosGrid:has(#edCliFantasia) { display:block!important; }
html.mwb-system body #clienteDadosGrid:has(#edCliFantasia) > div:first-child { display:grid!important;grid-template-columns:120px minmax(0,1fr)!important;gap:8px; }
html.mwb-system body #clienteDadosGrid:has(#edCliFantasia) :is(input,select,textarea) { grid-column:auto!important;width:100%!important;max-width:100%;min-width:0!important;box-sizing:border-box; }
html.mwb-system body #clienteDadosGrid:has(#edCliFantasia) > div:last-child { flex-wrap:wrap; }
html.mwb-system body .wm-body:has(:is(#emailComporCorpo,#emailRespostaCorpo)) > div { padding:16px;box-sizing:border-box; }
html.mwb-system body .wm-body:has(:is(#emailComporCorpo,#emailRespostaCorpo)) .modal-header { display:none; }
html.mwb-system body #modalAprovacao { padding:12px;overflow:auto; }
html.mwb-system body #modalAprovacao > div { max-height:calc(100dvh - 24px);overflow-y:auto;min-width:0; }
@media(max-width:760px) {
  html.mwb-system body #clienteDadosGrid:has(#edCliFantasia) > div:first-child { grid-template-columns:minmax(0,1fr)!important; }
}
html.mwb-system body .email-ia-tabs { flex-wrap:wrap; }
html.mwb-system body .email-ia-tab { flex:1 1 90px;min-width:0;white-space:normal; }
html.mwb-system body #pageTvPainel > div[style*="grid-template-columns"] { grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)!important; }
html.mwb-system body #pageTvPainel > div[style*="grid-template-columns"] > div { min-width:0; }
@media(max-width:760px) {
  html.mwb-system body #pageTvPainel > div[style*="grid-template-columns"] { grid-template-columns:minmax(0,1fr)!important; }
}

/* Keep module navigation from covering confirmations in open windows. */
html.mwb-system body:has(.wm-window:not(.wm-minimized):not(.wm-closing)) #tenant-menu-button {
  visibility:hidden!important;
  pointer-events:none;
}
