:root{
  --bg: #0b1020;
  --panel: #0f1730;
  --card: #111c38;
  --stroke: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.45);
  --accent: #7aa7ff;
  --accent2: #46d3b0;

  --radius: 16px;
  --radius2: 12px;
  --shadow: 0 12px 34px rgba(0,0,0,.35);

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  --max: 1200px;
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(122,167,255,.18), transparent 60%),
              radial-gradient(1100px 700px at 90% 70%, rgba(70,211,176,.12), transparent 55%),
              var(--bg);
  color: var(--text);
}

code{
  font-family: var(--mono);
  font-size: .92em;
  background: rgba(255,255,255,.06);
  padding: .15rem .35rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.10);
}

.app-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11,16,32,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.brand{
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 240px;
}
.brand-mark{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(122,167,255,.95), rgba(70,211,176,.85));
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
}
.brand-title{ font-weight: 800; letter-spacing: .2px; }
.brand-subtitle{ font-size: .92rem; color: var(--muted); margin-top: .15rem; }

.controls{ display:flex; align-items:center; gap:.65rem; }

.btn{
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: .62rem .9rem;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.btn:hover{ background: rgba(255,255,255,.12); }
.btn:active{ transform: translateY(1px); }
.btn:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,167,255,.18);
  border-color: rgba(122,167,255,.6);
}

.btn-link{
  background: transparent;
  border-color: rgba(255,255,255,.12);
}
.btn-link:hover{ background: rgba(255,255,255,.08); }

.app-main{
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.card{
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(17,28,56,.92), rgba(15,23,48,.92));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 640px;
  display:flex;
  flex-direction: column;
}

.card-title{
  padding: .9rem 1rem;
  font-weight: 750;
  color: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--stroke);
}

.list-toolbar{
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--stroke);
  display: grid;
  gap: .55rem;
}

.search{
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: .65rem .75rem;
  outline: none;
}
.search:focus{
  border-color: rgba(122,167,255,.6);
  box-shadow: 0 0 0 3px rgba(122,167,255,.18);
}

.small-note{ color: var(--muted); font-size: .9rem; line-height: 1.35; }
.hint{ color: var(--muted2); font-size: .9rem; line-height: 1.35; }

.list{
  padding: .75rem 1rem 1rem;
  overflow: auto;
  display: grid;
  gap: .7rem;
  flex: 1;
}

.item{
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}
.item[open]{ background: rgba(255,255,255,.06); border-color: rgba(122,167,255,.22); }
.item.selected{ border-color: rgba(70,211,176,.35); box-shadow: 0 0 0 3px rgba(70,211,176,.12); }

.item > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: .75rem .8rem;
  display: grid;
  gap: .25rem;
}
.item > summary::-webkit-details-marker{ display:none; }

.row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: .75rem;
}
.title{
  font-weight: 800;
  letter-spacing: .15px;
}
.subtitle{
  color: var(--muted);
  font-size: .88rem;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: .25rem .55rem;
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  font-weight: 650;
  white-space: nowrap;
}
.badge.accent{ border-color: rgba(122,167,255,.25); }
.badge.green{ border-color: rgba(70,211,176,.22); }

.details{
  padding: .75rem .8rem .9rem;
  border-top: 1px solid var(--stroke);
  display: grid;
  gap: .65rem;
}

.kv{
  display:grid;
  grid-template-columns: 1fr;
  gap: .25rem;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: .65rem .7rem;
}
.kv-label{ font-size: .78rem; color: var(--muted2); }
.kv-value{ font-weight: 750; color: rgba(255,255,255,.90); }

.pill-row{
  display:flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.pill{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: .82rem;
  font-weight: 650;
}
.pill.theme{ border-color: rgba(70,211,176,.22); }
.pill.platform{ border-color: rgba(122,167,255,.25); }

.link-row{
  display:flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.link{
  display:inline-flex;
  align-items:center;
  gap: .45rem;
  border-radius: 12px;
  padding: .5rem .65rem;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-weight: 650;
}
.link:hover{ background: rgba(255,255,255,.1); }
.link img{ width: 18px; height: 18px; }

.empty-state{
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
}
.empty-title{ font-weight: 800; color: rgba(255,255,255,.88); margin-bottom: .35rem; }
.empty-desc{ max-width: 520px; margin: 0 auto; line-height: 1.4; }

.app-footer{
  max-width: var(--max);
  margin: 0 auto;
  padding: .75rem 1.25rem 1.25rem;
  color: var(--muted);
  display:flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.kbd{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: .12rem .45rem;
  color: rgba(255,255,255,.85);
  font-weight: 650;
}
.muted{ color: var(--muted2); }

@media (max-width: 980px){
  .app-main{ grid-template-columns: 1fr; }
  .card{ min-height: 520px; }
}

: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;
}

.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;
}

:root {
}

.app-header .app-title small {
  opacity: .85;
}

.graph-overlay {
  pointer-events: none;
}

.dash-details{
  padding: 12px;
  min-height: 220px; /* antes 160px */
}

#nodeDetails .kv{
  padding: 12px 12px;
  gap: .35rem;
  border-radius: 14px;
}

#nodeDetails .link-row{
  width: 100%;
  min-height: 92px;               
  padding: 10px 10px;             
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.10);
}

#nodeDetails a.link[data-open-inf]{
  width: 100%;
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  text-decoration: none;
}

#nodeDetails a.link[data-open-inf] .title{
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: .15px;
  color: rgba(255,255,255,.92);
}

#nodeDetails a.link[data-open-inf] .subtitle{
  margin-top: 2px;
  font-size: .86rem;
  color: rgba(255,255,255,.68);
  font-weight: 650;
}

.br-real-wrap,
.br-map,
.map-wrap {
  overflow: hidden;
}

#brMapReal {
  width: 100%;
  height: auto;
  display: block;
}

#brMapReal path.shape,
#brMapReal path[id^="shape_"],
#brMapReal a[data-state] path,
#brMapReal a[data-uf] path {
  display: block !important;
  opacity: 1 !important;

  /* desenho do mapa */
  fill: rgba(255, 255, 255, 0.06) !important;
  stroke: rgba(255, 255, 255, 0.22) !important;
  stroke-width: 1 !important;

  /* cliques */
  pointer-events: auto;
  cursor: pointer;
}

/* Hover */
#brMapReal a[data-state]:hover path.shape,
#brMapReal a[data-uf]:hover path.shape,
#brMapReal a[data-state]:hover path[id^="shape_"],
#brMapReal a[data-uf]:hover path[id^="shape_"] {
  fill: rgba(255, 255, 255, 0.10) !important;
  stroke: rgba(255, 255, 255, 0.35) !important;
}

#brMapReal circle.icon_state,
#brMapReal circle[id^="icon_"] {
  opacity: 1 !important;
  pointer-events: auto;
  cursor: pointer;
}

/* Labels (UF) */
#brMapReal text {
  opacity: 1 !important;
  pointer-events: none; 
}

#brMapReal a.is-active path,
#brMapReal a.active path,
#brMapReal a.selected path,
#brMapReal a.is-selected path,
#brMapReal a[aria-pressed="true"] path {
  fill: rgba(59, 130, 246, 0.22) !important;      
  stroke: rgba(59, 130, 246, 0.55) !important;
  stroke-width: 1.2 !important;
}

#brMapReal a.is-active circle,
#brMapReal a.active circle,
#brMapReal a.selected circle,
#brMapReal a.is-selected circle,
#brMapReal a[aria-pressed="true"] circle {
  stroke: rgba(59, 130, 246, 0.90) !important;
  stroke-width: 2 !important;
}
