/* V67 — correção estrutural. Mantém o grid estável da V65 e abre o menu sem duplicar margens. */
@media (min-width:901px){
    body.ux-v67 .main-container.v54-grid-layout,
    body.sidebar-collapsed.ux-v67 .main-container.v54-grid-layout{
        width:100%!important;
        max-width:none!important;
        margin:14px 0 0!important;
        padding:0 16px 38px!important;
        grid-template-columns:280px minmax(0,1fr)!important;
        column-gap:16px!important;
        box-sizing:border-box!important;
    }
    body.ux-v67 .main-container.v54-grid-layout>.app-sidebar,
    body.sidebar-collapsed.ux-v67 .main-container.v54-grid-layout>.app-sidebar{
        position:sticky!important;
        left:auto!important;
        top:82px!important;
        bottom:auto!important;
        width:280px!important;
        height:calc(100vh - 98px)!important;
        min-height:520px!important;
        transform:none!important;
        align-self:start!important;
    }
    body.ux-v67 .main-container.v54-grid-layout>:not(.app-sidebar),
    body.sidebar-collapsed.ux-v67 .main-container.v54-grid-layout>:not(.app-sidebar){
        grid-column:2!important;
        min-width:0!important;
        width:100%!important;
        box-sizing:border-box!important;
    }
    body.ux-v67 .sidebar-brand-copy,
    body.sidebar-collapsed.ux-v67 .sidebar-brand-copy,
    body.ux-v67 .sidebar-nav-copy,
    body.sidebar-collapsed.ux-v67 .sidebar-nav-copy,
    body.ux-v67 .sidebar-period-copy,
    body.sidebar-collapsed.ux-v67 .sidebar-period-copy{display:flex!important}
    body.ux-v67 .sidebar-logo,
    body.sidebar-collapsed.ux-v67 .sidebar-logo{display:grid!important}
    body.ux-v67 .sidebar-brand-row,
    body.sidebar-collapsed.ux-v67 .sidebar-brand-row{justify-content:flex-start!important;padding:12px 14px!important}
    body.ux-v67 .sidebar-nav-button,
    body.sidebar-collapsed.ux-v67 .sidebar-nav-button,
    body.ux-v67 .sidebar-period-button,
    body.sidebar-collapsed.ux-v67 .sidebar-period-button{justify-content:flex-start!important}
    body.ux-v67 .sidebar-nav-button,
    body.sidebar-collapsed.ux-v67 .sidebar-nav-button{padding:8px 10px!important}
    body.ux-v67 .sidebar-group-title,
    body.sidebar-collapsed.ux-v67 .sidebar-group-title{
        height:auto!important;margin:0!important;padding:0 10px 7px!important;
        color:#9DA3C6!important;background:transparent!important;overflow:visible!important
    }
    body.ux-v67 .sidebar-collapse-button,
    body.ux-v67 .sidebar-reopen-fab,
    body.ux-v67 .sidebar-toggle-top{display:none!important}
}

/* Resumo: duas áreas largas; o bloco mensal usa toda a largura. */
body.ux-v67 #tab-overview .overview-kpi-sections,
body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="complete"],
body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="executive"]{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:16px!important;
}
body.ux-v67 #tab-overview .overview-kpi-section{
    min-width:0!important;
    padding:18px!important;
}
body.ux-v67 #tab-overview .overview-kpi-section[data-tone="forecast"]{
    grid-column:1 / -1!important;
}
body.ux-v67 #tab-overview .overview-kpi-grid,
body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="complete"] .overview-kpi-grid,
body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="executive"] .overview-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
}
body.ux-v67 #tab-overview .overview-kpi-section[data-tone="forecast"] .overview-kpi-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
body.ux-v67 #tab-overview .overview-kpi-section-head strong{font-size:15px!important;line-height:1.25!important}
body.ux-v67 #tab-overview .overview-kpi-section-head span{font-size:10px!important;line-height:1.5!important}
body.ux-v67 #tab-overview .overview-kpi-grid .kpi-card{
    min-width:0!important;
    min-height:148px!important;
    padding:16px!important;
}
body.ux-v67 #tab-overview .overview-kpi-grid .kpi-card .kpi-title{
    min-height:30px!important;
    font-size:11px!important;
    line-height:1.35!important;
}
body.ux-v67 #tab-overview .overview-kpi-grid .kpi-card .kpi-value{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:8px 0!important;
    font-size:clamp(21px,1.75vw,29px)!important;
    line-height:1.08!important;
    letter-spacing:-.04em!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
}
body.ux-v67 #tab-overview .overview-kpi-grid .kpi-card .kpi-badge{
    max-width:100%!important;
    font-size:10px!important;
    line-height:1.4!important;
    white-space:normal!important;
}
/* Fallback caso os cards ainda não tenham sido agrupados pelo JavaScript. */
body.ux-v67 #tab-overview>:scope>.kpi-grid,
body.ux-v67 #tab-overview>.kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:14px!important;
}
body.ux-v67 #tab-overview>.kpi-grid>.kpi-card{min-width:0!important;min-height:144px!important;padding:16px!important}
body.ux-v67 #tab-overview>.kpi-grid .kpi-value{font-size:clamp(22px,1.8vw,30px)!important;white-space:nowrap!important}

/* Tabela de campanhas: cabe em desktop sem esmagar colunas. */
body.ux-v67 #tab-overview .panel.compact-panel,
body.ux-v67 #tab-overview>.panel{width:100%!important;min-width:0!important;overflow:hidden!important}
@media (min-width:1180px){
    body.ux-v67 #tab-overview .table-container{
        width:100%!important;
        overflow-x:hidden!important;
        overflow-y:auto!important;
    }
    body.ux-v67 #tab-overview .data-table{
        width:100%!important;
        min-width:0!important;
        table-layout:fixed!important;
    }
    body.ux-v67 #tab-overview .data-table col:nth-child(1){width:24%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(2){width:8%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(3){width:10%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(4){width:8%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(5){width:8%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(6){width:8%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(7){width:15%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(8){width:15%!important}
    body.ux-v67 #tab-overview .data-table col:nth-child(9){width:4%!important}
}
body.ux-v67 #tab-overview .data-table th,
body.ux-v67 #tab-overview .data-table td{padding:13px 8px!important}
body.ux-v67 #tab-overview .data-table th{
    font-size:9px!important;line-height:1.3!important;letter-spacing:.035em!important;white-space:normal!important
}
body.ux-v67 #tab-overview .data-table th small{font-size:8px!important;line-height:1.25!important}
body.ux-v67 #tab-overview .data-table td{font-size:10.5px!important;line-height:1.35!important}
body.ux-v67 #tab-overview .data-table td:first-child{
    padding-left:14px!important;padding-right:12px!important;font-size:11px!important;font-weight:750!important;
    white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important
}
body.ux-v67 #tab-overview .compact-number-stack strong{font-size:13px!important}
body.ux-v67 #tab-overview .compact-number-stack small{font-size:8px!important;line-height:1.25!important}
body.ux-v67 #tab-overview .metric-line{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;
    gap:6px!important;padding:5px 7px!important;white-space:normal!important
}
body.ux-v67 #tab-overview .metric-line .metric-label{
    min-width:0!important;font-size:8px!important;line-height:1.2!important;white-space:normal!important
}
body.ux-v67 #tab-overview .metric-line .metric-value{font-size:10.5px!important;white-space:nowrap!important}
body.ux-v67 #tab-overview .overview-details-panel{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;padding-left:18px!important
}

@media (max-width:1250px) and (min-width:901px){
    body.ux-v67 #tab-overview .overview-kpi-sections,
    body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="complete"],
    body.ux-v67 #tab-overview .overview-kpi-sections[data-ui-mode="executive"]{grid-template-columns:1fr!important}
    body.ux-v67 #tab-overview .overview-kpi-section[data-tone="forecast"]{grid-column:auto!important}
    body.ux-v67 #tab-overview .overview-kpi-section[data-tone="forecast"] .overview-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:1179px){
    body.ux-v67 #tab-overview .table-container{overflow-x:auto!important}
    body.ux-v67 #tab-overview .data-table{min-width:1040px!important}
}
@media (max-width:760px){
    body.ux-v67 #tab-overview .overview-kpi-grid,
    body.ux-v67 #tab-overview .overview-kpi-section[data-tone="forecast"] .overview-kpi-grid,
    body.ux-v67 #tab-overview>.kpi-grid{grid-template-columns:1fr!important}
}