/* Dashboard executivo — camada final de clareza visual.
   Somente apresentação: não altera dados, Firebase, mapa ou regras. */

html.dashboard-command-premium-mode body #dashboard,
html body.dashboard-command-premium #dashboard{
  gap:16px !important;
  padding:18px 22px 26px !important;
}

html body.dashboard-command-premium #dashboard .dashboard-executive-header{
  order:-20;
  width:100%;
  min-width:0;
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:18px 20px;
  border:1px solid rgba(111,224,157,.18);
  border-radius:12px;
  background:#07130e;
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}

.dashboard-executive-copy{
  min-width:0;
}

.dashboard-executive-eyebrow{
  display:block;
  margin-bottom:5px;
  color:#50d889;
  font-size:10px;
  font-weight:850;
  letter-spacing:.08em !important;
  text-transform:uppercase;
}

.dashboard-executive-copy h1{
  margin:0;
  color:#f3fbf6;
  font-size:clamp(22px,2vw,29px);
  font-weight:800;
  line-height:1.05;
}

.dashboard-executive-copy p{
  margin:7px 0 0;
  color:rgba(224,240,231,.67);
  font-size:13px;
  line-height:1.4;
}

.dashboard-executive-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
}

.dashboard-executive-actions a{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 14px;
  border:1px solid rgba(96,211,143,.25);
  border-radius:8px;
  background:rgba(30,129,70,.10);
  color:#dff8e8;
  font-size:12px;
  font-weight:750;
  text-decoration:none;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}

.dashboard-executive-actions a:first-child{
  background:#168545;
  border-color:#279f5a;
  color:#fff;
}

.dashboard-executive-actions a:hover{
  background:#1b9550;
  border-color:#45ba73;
  color:#fff;
}

/* Indicadores principais: ordem visual label > número > contexto. */
html body.dashboard-command-premium #dashboard > .stats-grid,
html.dashboard-command-premium-mode body #dashboard > .stats-grid{
  order:-10;
  grid-template-columns:repeat(5,minmax(140px,1fr)) !important;
  gap:12px !important;
}

html body.dashboard-command-premium #dashboard > .stats-grid > .command-kpi-card,
html.dashboard-command-premium-mode body #dashboard > .stats-grid > .command-kpi-card{
  position:relative;
  padding:16px 18px !important;
  border:1px solid rgba(120,204,153,.16) !important;
  border-radius:12px !important;
  background:#081510 !important;
  box-shadow:none !important;
}

html body.dashboard-command-premium #dashboard > .stats-grid > .command-kpi-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  border-radius:12px 0 0 12px;
  background:#36c873;
}

html body.dashboard-command-premium #dashboard > .stats-grid > .command-kpi-card[data-tone="blue"]::before{background:#4a9fea;}
html body.dashboard-command-premium #dashboard > .stats-grid > .command-kpi-card[data-tone="yellow"]::before{background:#d6ad39;}

html body.dashboard-command-premium #dashboard .command-kpi-card > .label{
  order:-2;
  color:rgba(217,235,224,.69) !important;
  font-size:10px !important;
  font-weight:800 !important;
  letter-spacing:.045em !important;
  text-transform:uppercase;
}

html body.dashboard-command-premium #dashboard .command-kpi-card > strong{
  order:-1;
  color:#f4fbf6 !important;
  font-size:30px !important;
  font-weight:820 !important;
  letter-spacing:-.035em !important;
}

html body.dashboard-command-premium #dashboard .command-kpi-card > .command-stat-growth{
  color:rgba(204,225,212,.58) !important;
  font-size:11px !important;
  font-weight:650 !important;
}

/* Mapa mantém contexto territorial sem dominar a página. */
html body.dashboard-command-premium #dashboard > .dashboard-map-card,
html body.dashboard-command-premium #dashboard > .dashboard-card-map,
html.dashboard-command-premium-mode body #dashboard > .dashboard-map-card,
html.dashboard-command-premium-mode body #dashboard > .dashboard-card-map{
  min-height:430px !important;
  padding:16px !important;
  border:1px solid rgba(120,204,153,.16) !important;
  border-radius:14px !important;
  background:#07130e !important;
  box-shadow:none !important;
}

html body.dashboard-command-premium #dashboard .dashboard-map-card .card-head{
  min-height:38px;
  margin-bottom:10px !important;
}

html body.dashboard-command-premium #dashboard .dashboard-map-card .card-head h3{
  color:#f2faf5 !important;
  font-size:17px !important;
  font-weight:780 !important;
}

html body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
html body.dashboard-command-premium #dashboard #dashboardMiniMap,
html.dashboard-command-premium-mode body #dashboard #dashboardMapPreviewPanel,
html.dashboard-command-premium-mode body #dashboard #dashboardMiniMap{
  height:340px !important;
  min-height:340px !important;
  max-height:340px !important;
  border-radius:10px !important;
}

/* Indicadores em duas linhas amplas, em vez de quatro colunas estreitas. */
html body.dashboard-command-premium #dashboard > #dashboardCommandAnalytics,
html.dashboard-command-premium-mode body #dashboard > #dashboardCommandAnalytics{
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:14px !important;
  align-items:stretch !important;
}

#dashboardCommandAnalytics > #cmdChartPeriod{
  grid-column:span 6 !important;
}

#dashboardCommandAnalytics > #cmdChartEvolution{
  grid-column:span 6 !important;
}

#dashboardCommandAnalytics > #cmdRecentActivity{
  grid-column:span 8 !important;
}

#dashboardCommandAnalytics > #cmdRankBairros{
  grid-column:span 4 !important;
}

html body.dashboard-command-premium #dashboard .command-chart-card,
html body.dashboard-command-premium #dashboard .command-ranking-card{
  min-width:0 !important;
  border:1px solid rgba(120,204,153,.16) !important;
  border-radius:12px !important;
  background:#081510 !important;
  box-shadow:none !important;
  overflow:hidden !important;
}

html body.dashboard-command-premium #dashboard .command-chart-card{
  min-height:275px !important;
  padding:18px !important;
}

html body.dashboard-command-premium #dashboard .command-card-head{
  min-height:44px;
  align-items:flex-start !important;
  gap:12px !important;
}

html body.dashboard-command-premium #dashboard .command-card-head h3{
  max-width:none !important;
  color:#f2faf5 !important;
  font-size:16px !important;
  font-weight:780 !important;
  line-height:1.15 !important;
}

html body.dashboard-command-premium #dashboard .command-card-head > span{
  color:rgba(209,230,217,.58) !important;
  font-size:11px !important;
  line-height:1.25 !important;
  text-align:right;
}

html body.dashboard-command-premium #dashboard .command-chart-shell,
html body.dashboard-command-premium #dashboard .command-chart-card.is-large .command-chart-shell,
html body.dashboard-command-premium #dashboard .command-chart-card.is-medium .command-chart-shell{
  width:100% !important;
  height:205px !important;
  min-height:205px !important;
  margin-top:4px !important;
}

html body.dashboard-command-premium #dashboard .command-chart-shell canvas{
  width:100% !important;
  max-width:100% !important;
}

html body.dashboard-command-premium #dashboard #cmdRecentActivity{
  min-height:270px !important;
}

html body.dashboard-command-premium #dashboard .command-activity-table{
  overflow:hidden !important;
}

html body.dashboard-command-premium #dashboard .command-activity-row{
  grid-template-columns:minmax(110px,1fr) minmax(100px,1fr) minmax(90px,.8fr) minmax(92px,.8fr) minmax(90px,.7fr) !important;
  gap:12px !important;
  min-height:37px !important;
}

html body.dashboard-command-premium #dashboard #cmdRankBairros{
  min-height:270px !important;
  padding:18px !important;
}

html body.dashboard-command-premium #dashboard .command-rank-row{
  min-height:35px !important;
  gap:10px !important;
}

html body.dashboard-command-premium #dashboard .command-mini-action{
  min-height:30px !important;
  border-radius:7px !important;
  background:rgba(33,142,78,.10) !important;
}

@media(max-width:1180px){
  html body.dashboard-command-premium #dashboard > .stats-grid,
  html.dashboard-command-premium-mode body #dashboard > .stats-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }

  #dashboardCommandAnalytics > #cmdRecentActivity,
  #dashboardCommandAnalytics > #cmdRankBairros{
    grid-column:span 6 !important;
  }
}

@media(max-width:900px){
  html body.dashboard-command-premium #dashboard,
  html.dashboard-command-premium-mode body #dashboard{
    padding:14px !important;
  }

  html body.dashboard-command-premium #dashboard .dashboard-executive-header{
    align-items:flex-start;
  }

  .dashboard-executive-actions{
    flex-wrap:wrap;
    justify-content:flex-end;
  }

  #dashboardCommandAnalytics > #cmdChartPeriod,
  #dashboardCommandAnalytics > #cmdChartEvolution,
  #dashboardCommandAnalytics > #cmdRecentActivity,
  #dashboardCommandAnalytics > #cmdRankBairros{
    grid-column:span 12 !important;
  }
}

@media(max-width:680px){
  html body.dashboard-command-premium #dashboard .dashboard-executive-header{
    display:block !important;
    padding:16px;
  }

  .dashboard-executive-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    margin-top:14px;
  }

  html body.dashboard-command-premium #dashboard > .stats-grid,
  html.dashboard-command-premium-mode body #dashboard > .stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  html body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
  html body.dashboard-command-premium #dashboard #dashboardMiniMap{
    height:300px !important;
    min-height:300px !important;
    max-height:300px !important;
  }
}

@media(max-width:430px){
  html body.dashboard-command-premium #dashboard > .stats-grid,
  html.dashboard-command-premium-mode body #dashboard > .stats-grid{
    grid-template-columns:1fr !important;
  }
}

/* Trava de especificidade contra as camadas históricas do dashboard. */
html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard > .dashboard-map-card,
html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard > .dashboard-card-map,
html body.dashboard-command-premium #dashboard > .dashboard-map-card.dashboard-card-map{
  min-height:430px !important;
  height:auto !important;
}

html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard #dashboardMiniMap,
html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard #dashboardMiniMap.leaflet-container,
html body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
html body.dashboard-command-premium #dashboard #dashboardMiniMap{
  flex:0 0 340px !important;
  height:340px !important;
  min-height:340px !important;
  max-height:340px !important;
}

html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard > #dashboardCommandAnalytics,
html body.dashboard-command-premium.dashboard-operational-clean #dashboard > #dashboardCommandAnalytics,
html body.dashboard-command-premium #dashboard > #dashboardCommandAnalytics{
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  grid-auto-columns:minmax(0,1fr) !important;
  gap:14px !important;
}

@media(max-width:900px){
  html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard > #dashboardCommandAnalytics,
  html body.dashboard-command-premium.dashboard-operational-clean #dashboard > #dashboardCommandAnalytics,
  html body.dashboard-command-premium #dashboard > #dashboardCommandAnalytics{
    grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  }
}

@media(max-width:680px){
  html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
  html.dashboard-command-premium-mode body.dashboard-command-premium #dashboard #dashboardMiniMap,
  html body.dashboard-command-premium #dashboard #dashboardMapPreviewPanel,
  html body.dashboard-command-premium #dashboard #dashboardMiniMap{
    flex-basis:300px !important;
    height:300px !important;
    min-height:300px !important;
    max-height:300px !important;
  }
}
