
:root{
  --bg: #0b1220;
  --panel: #0f1a2b;
  --panel-2: #0c1626;
  --card: rgba(255,255,255,.06);
  --card-2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted-2: rgba(255,255,255,.52);

  --accent: #63b3ff;
  --accent-2: #7cf7c6;
  --warn: #ffd166;

  --radius: 14px;
  --shadow: 0 10px 24px rgba(0,0,0,.35);

  --map-fill: rgba(255,255,255,.08);
  --map-stroke: rgba(255,255,255,.22);
  --map-hover: rgba(99,179,255,.28);
  --map-selected: rgba(99,179,255,.52);
  --map-text: rgba(255,255,255,.78);
}

.is-hidden{ display:none !important; }

body{
  background: radial-gradient(1200px 800px at 20% 10%, rgba(99,179,255,.18), transparent 60%),
              radial-gradient(900px 700px at 80% 20%, rgba(124,247,198,.12), transparent 55%),
              var(--bg);
  color: var(--text);
}

.small-note{
  font-size: .92rem;
  color: var(--muted);
  margin-top: .6rem;
}

.search, .dash-select{
  background: rgba(0,0,0,.22);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: .6rem .75rem;
  outline: none;
}

.search{
  min-width: 220px;
  flex: 1 0 220px;
}

.dash-select{
  min-width: 150px;
}

/* Header */
.app-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,179,255,.9), rgba(124,247,198,.8));
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
}

.brand-title{
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-subtitle{
  font-size: .9rem;
  color: var(--muted);
  margin-top: 2px;
}

.controls{
  display:flex;
  gap: 10px;
  align-items:center;
}

.btn{
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .55rem .8rem;
  border-radius: 12px;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.btn:hover{
  background: rgba(255,255,255,.12);
}

.btn:active{
  transform: translateY(1px);
}

.btn-link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
}

/* Layout principal */
.dash2{
  padding: 16px 18px 22px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.dash2-top{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.dash2-filters{
  display:flex;
  flex-wrap:nowrap;
  gap: 10px;
  align-items:center;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.dash2-filters > *{
  flex: 0 0 auto;
}

.dash2-filters .search{
  flex: 1 0 220px;
}

.dash-inline{
  display:flex;
  align-items:center;
  gap: 8px;

  white-space:nowrap;  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  padding: .55rem .7rem;
  border-radius: 12px;
  user-select:none;
}

.dash-inline span{
  color: var(--muted);
  font-size: .92rem;
}

.help-tip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.help-tip:focus{
  outline: 2px solid rgba(255,255,255,.18);
  outline-offset: 2px;
}

.dash-inline input[type="checkbox"]{
  transform: translateY(1px);
}

.dash-val{
  min-width: 18px;
  text-align:center;
  color: var(--text);
  font-weight: 600;
}

#minDegree{
  width: 100px;
}

.dash2-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.kpi{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 12px 12px;
  box-shadow: var(--shadow);
}

.kpi-label{
  color: var(--muted);
  font-size: .92rem;
}

.kpi-val{
  margin-top: 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: .3px;
}

/* Corpo (3 colunas) */
.dash2-body{
  display:grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 12px;
  align-items:stretch;
}

.dash2-left,
.dash2-center,
.dash2-right{
  display:flex;
  flex-direction:column;
}

.dash2-left > .card,
.dash2-center > .card,
.dash2-right > .card{
  flex: 1 1 auto;
}

/* Card base */
.card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.card-title{
  font-weight: 750;
  margin-bottom: 10px;
}

/* Mapa */
.br-real-wrap{
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  padding: 10px;
  overflow: hidden;
}

.br-real{
  width: 100%;
  height: auto;
  display:block;
}

.br-real text{
  pointer-events:none;
  user-select:none;
}

.br-real--simple .br-silhouette{
  fill: rgba(255,255,255,.02);
  stroke: rgba(255,255,255,.10);
  stroke-width: 1;
}

.br-real--simple .uf{
  fill: var(--map-fill);
  stroke: var(--map-stroke);
  stroke-width: 1;
  cursor: pointer;
  transition: fill .14s ease, stroke .14s ease, opacity .14s ease;
}

.br-real--simple .uf:hover{
  fill: var(--map-hover);
}

.br-real--simple .uf-txt text{
  font-size: 12px;
  font-weight: 700;
  fill: var(--map-text);
  opacity: .88;
}

.br-real--simple .br-region-labels text{
  font-size: 10px;
  fill: rgba(255,255,255,.45);
  letter-spacing: .7px;
}

.br-real--codepen .shape,
.br-real--codepen .uf{
  fill: var(--map-fill);
  stroke: var(--map-stroke);
  stroke-width: 1;
  cursor: pointer;
  transition: fill .14s ease, stroke .14s ease, opacity .14s ease;
}

.br-real--codepen .shape:hover,
.br-real--codepen .uf:hover{
  fill: var(--map-hover);
}

.br-real--codepen .icon_state{
  fill: rgba(0,0,0,.18);
  stroke: rgba(255,255,255,.25);
  stroke-width: 1;
}

.br-real--codepen .label_icon_state{
  font-size: 12px;
  font-weight: 800;
  fill: var(--map-text);
}

.br-real--codepen .label_state{
  display:none;
}

.uf.active,
.uf.is-active,
.uf.selected,
.uf.is-selected,
.uf[aria-pressed="true"],
.uf[data-active="true"]{

  fill: var(--map-selected) !important;
  stroke: rgba(255,255,255,.40) !important;
}

.br-real--codepen a.uf.active .shape,
.br-real--codepen a.uf.is-active .shape,
.br-real--codepen a.uf.selected .shape,
.br-real--codepen a.uf.is-selected .shape,
.br-real--codepen a.uf[aria-pressed="true"] .shape{
  fill: var(--map-selected) !important;
  stroke: rgba(255,255,255,.40) !important;
}

.dash-list{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.dash-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.14);
  border-radius: 12px;
  padding: 10px 10px;
}

.dash-item .name{
  font-weight: 650;
}

.dash-item .meta{
  color: var(--muted);
  font-size: .9rem;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(99,179,255,.16);
  color: rgba(255,255,255,.92);
  font-weight: 800;
}

.dash-graph-card{
  min-height: 530px;
  display:flex;
  flex-direction:column;
}

.workflow-strip{
  display:none;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

.wf-box{
  flex: 1 1 220px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  border-radius: 12px;
  padding: 10px;
}

.wf-k{
  color: var(--muted);
  font-size: .88rem;
}

.wf-v{
  margin-top: 4px;
  font-weight: 700;
}

.dash-graph-wrap--workflow{
  min-height: 420px;
  height: clamp(360px, 45vh, 560px);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(0,0,0,.10);
  overflow:hidden;
  flex: 1 1 auto;
}

.dash-graph-footer{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

#graphSvg{
  display:block;
  width:100%;
  height:100%;
}

.dash-details{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 10px;
  min-height: 160px;
}

.empty-state{
  padding: 14px 10px;
}

.empty-title{
  font-weight: 800;
}

.empty-desc{
  margin-top: 6px;
  color: var(--muted);
}

.dash-legend{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.dash-legend--inline{
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.legend-item{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
}

.legend-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display:inline-block;
  border: 1px solid rgba(255,255,255,.22);
}

.legend-dot.pol{ background: rgba(130,170,255,1); }
.legend-dot.inf{ background: rgba(88,224,198,1); }
.legend-dot.other{ background: rgba(220,226,238,0.95); }

.legend-line{
  width: 22px;
  height: 2px;
  display:inline-block;
  background: rgba(255,255,255,.35);
  border-radius: 999px;
}

@media (max-width: 1280px){
  .dash2-body{
    grid-template-columns: 340px 1fr 340px;
  }
}

@media (max-width: 1100px){
  .dash2-kpis{
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .dash2-body{
    grid-template-columns: 1fr;
  }
  .dash2-left, .dash2-right{
    order: 2;
  }
  .dash2-center{
    order: 1;
  }
}

@media (max-width: 520px){
  .search{ min-width: 100%; }
  .dash-select{ min-width: 100%; }
  .dash2-kpis{ grid-template-columns: 1fr; }
}

.is-hidden { display: none !important; }

.br-real-wrap {
  position: relative;
}

.br-real-wrap svg.br-real {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.br-real--simple .uf-txt text,
.br-real--simple .br-region-labels text {
  pointer-events: none;
}

#brMapReal [data-uf],
#brMapReal .state,
#brMapReal .shape,
#brMapReal path.uf {
  cursor: pointer;
}

#brMapReal .shape,
#brMapReal path.uf {
  fill: rgba(255,255,255,0.08);
  stroke: rgba(255,255,255,0.28);
  stroke-width: 1;
  transition: fill .18s ease, stroke .18s ease, opacity .18s ease;
}

#brMapReal .state:hover .shape,
#brMapReal path.uf:hover {
  fill: #039be5;
}

#brMapReal .is-selected.shape,
#brMapReal path.uf.is-selected {
  fill: #fd7132 !important;
}

#brMapReal .state.is-selected .label_icon_state {
  fill: #fff !important;
}

html, body { height: 100%; }
body { min-height: 100vh; }

.dash2 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash2-center{
  flex: 1 1 auto; 
  min-height: 0;    
  align-items: stretch; 
}

.dash2-center{
  align-items: stretch;
}

.dash2-left,
.dash2-mid,
.dash2-right{
  height: 100%;
  min-height: 0;
}

.dash2-left .card,
.dash2-mid .card,
.dash2-right .card{
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dash2-left .card > .card-body,
.dash2-mid  .card > .card-body,
.dash2-right .card > .card-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
