/* ══════════════════════════════
   radar.css — Exclusivo de radar.html + radar.js
   NÃO duplicar em outras páginas
   Depende de style.css e nav.css (variáveis e reset)
══════════════════════════════ */

/* ══════════════════════════════
LAYOUT BASE DO RADAR
══════════════════════════════ */
body { overflow: hidden; }

.svg-wrap {
  contain: layout paint style;
  position: fixed;
  top: 64px; left: 240px; right: 0; bottom: 38px;
  overflow: hidden;
  cursor: grab;
  background: var(--bg-page);
}

.svg-wrap.dragging { cursor: grabbing; }

#radar {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

/* ══════════════════════════════
ZOOM MINI (controles sidebar)
══════════════════════════════ */
.zoom-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.zm-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease;
  flex-shrink: 0;
}

.zm-btn:hover {
  background: var(--verde-light);
  color: var(--verde-sicredi);
  border-color: var(--verde-sicredi);
}

.zm-range {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.zm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--verde-sicredi);
  border: 2px solid var(--branco);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  cursor: pointer;
}

.zm-range::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--verde-sicredi);
  border: 2px solid var(--branco);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  cursor: pointer;
}

/* ══════════════════════════════
CHIPS (filtros da sidebar)
══════════════════════════════ */
.chip-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-secundaria);
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease;
  background: transparent;
}

.chip:hover { background: var(--bg-neutral); }

.chip.active {
  background: var(--verde-light);
  font-weight: 700;
  border-color: var(--verde-border);
}

.chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════
FILTRO DE PROBABILIDADE
══════════════════════════════ */
.prob-filter { display: flex; flex-direction: column; gap: 6px; }

.prob-row { display: flex; align-items: center; gap: 6px; }

.prob-label {
  font-family: var(--font-secundaria);
  font-size: .64rem;
  color: var(--text-muted);
  min-width: 62px;
  flex-shrink: 0;
}

.prob-val {
  font-family: var(--font-principal);
  font-size: .68rem;
  font-weight: 700;
  color: var(--verde-sicredi);
  min-width: 14px;
  text-align: center;
}

/* ══════════════════════════════
FOOTER FIXO (exclusivo do radar)
══════════════════════════════ */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  font-size: .68rem;
  padding: 0 20px;
  /* herda background/color de nav.css */
}

/* ══════════════════════════════
DRAWER — OVERLAY
══════════════════════════════ */
.d-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background: rgba(0,0,0,0);
  transition: background .25s ease;
}

.d-overlay.open {
  pointer-events: all;
  background: rgba(0,24,10,.35);
}

/* ══════════════════════════════
DRAWER — PAINEL
══════════════════════════════ */
.drawer {
  position: fixed;
  top: 0; right: -740px; bottom: 0;
  width: min(720px, 72vw);
  max-width: 96vw;
  background: #f3f5f7;
  z-index: 510;
  transition: right .32s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 34px rgba(0,0,0,.18);
  border-left: 2px solid rgba(63,161,16,.35);
  overflow: hidden;
}

.drawer.open { right: 0; }

.drawer-scroll {
  overscroll-behavior: contain;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding: 18px 16px 24px;
}

.drawer-scroll::-webkit-scrollbar { width: 8px; }
.drawer-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

.drawer-card {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 28px rgba(0,0,0,.12);
  overflow: visible;
}

.drawer-card .card-body,
.drawer-card .section { overflow: visible; }

.drawer-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
}

.drawer-close:hover { background: rgba(22,163,74,.85); }

/* ── Tooltips dentro do drawer — forçar alinhamento à esquerda ── */
.drawer .tooltip-wrap { position: relative; }

.drawer .tooltip-box {
  left: 0 !important; right: auto !important;
  transform: none !important;
  width: min(420px, 85vw);
}

.drawer .tooltip-box::before {
  left: 16px !important; right: auto !important;
  transform: none !important;
}

.drawer .tooltip-box.wide   { width: min(520px, 85vw); }

.drawer .tooltip-box.right-align        { left: 0 !important; right: auto !important; }
.drawer .tooltip-box.right-align::before{ left: 16px !important; right: auto !important; }

.drawer .tooltip-box.up {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0 !important;
  transform: none !important;
}

.drawer .tooltip-box.up::before { left: 16px !important; transform: none !important; }

/* ══════════════════════════════
HERO DA IMAGEM
══════════════════════════════ */
.hero-wrapper {
  position: relative;
  line-height: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #146E37, #3FA110 50%, #003815);
}

.nav-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.30);
  transition: background .2s, transform .2s;
  z-index: 10;
}

.nav-btn:hover {
  background: rgba(22,163,74,0.75);
  transform: translateY(-50%) scale(1.08);
}

.nav-btn:active {
  background: rgba(22,163,74,0.95);
  transform: translateY(-50%) scale(0.96);
}

.nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.nav-btn--prev { left: 12px; }
.nav-btn--next { right: 12px; }
.nav-btn svg   { width: 18px; height: 18px; pointer-events: none; }

/* ══════════════════════════════
CARD BODY — CONTEÚDO DO ACHADO
══════════════════════════════ */
.card-body { padding: 24px 22px; }

.section { margin-bottom: 18px; padding: 1px; }
.section:last-child { margin-bottom: 0; }

.divider { border: none; border-top: 1px solid #e5e7eb; margin: 14px 0; }

.finding-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 10px;
  line-height: 1.3;
}

.finding-context {
  font-size: .78rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.finding-context strong { color: #f59e0b; }

.counter-line {
  font-size: .76rem;
  color: #64748b;
  margin-top: 10px;
}

/* ── STEEP label / badge ── */
.steep-label {
  font-size: .95rem;
  font-weight: 600;
  color: #3b6fa0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.steep-badge {
  background: #e8f0fb;
  color: #1a3a5c;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .78rem;
  font-weight: 700;
}

/* ── Descrição ── */
.description {
  font-size: .87rem;
  line-height: 1.72;
  color: #374151;
  text-align: justify;
}

/* ── Block title ── */
.block-title {
  font-size: .92rem;
  font-weight: 700;
  color: #1a3a5c;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

/* ══════════════════════════════
PROBABILIDADE — BARRAS SEGMENTADAS
══════════════════════════════ */
.progress-item  { margin-bottom: 10px; }

.progress-track { display: flex; gap: 4px; }

.progress-seg {
  flex: 1;
  height: 12px;
  border-radius: 4px;
  background: #e2e8f0;
}

.progress-seg.filled-sgreen { background: #44e980; }   /* verde claro — curto prazo  */
.progress-seg.filled-green  { background: #16a34a; }   /* verde escuro — médio prazo */

/* ══════════════════════════════
TRL TRACK (barras equalizer)
══════════════════════════════ */
.trl-track {
  display: flex;
  gap: 3px;
  align-items: flex-end;
}

.trl-seg {
  flex: 1;
  border-radius: 4px 4px 0 0;    /* arredondado só no topo */
  background: #e2e8f0;
}

.trl-seg.filled { background: #16a34a; }

.trl-numbers {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* ══════════════════════════════
CHARTS DO DRAWER
══════════════════════════════ */
.chart-wrap { position: relative; width: 100%; }

/* ══════════════════════════════
ANÁLISE DO COMITÊ
══════════════════════════════ */
.committee-text {
  font-size: .87rem;
  line-height: 1.75;
  color: #374151;
  background: #f9fafb;
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 4px solid #44e980;
}

/* ══════════════════════════════
LINKS LIST
══════════════════════════════ */
.links-list { list-style: none; }
.links-list li { margin-bottom: 10px; }

.links-list a {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  font-size: .83rem;
  color: #1a7acc;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
}

.links-list a:hover { text-decoration: underline; }
.link-icon { flex-shrink: 0; font-size: 1rem; }

/* ══════════════════════════════
TIMELINE
══════════════════════════════ */
.timeline { position: relative; padding-left: 22px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 4px; bottom: 4px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}

.timeline-item            { position: relative; margin-bottom: 16px; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -19px; top: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #1a7acc;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #1a7acc;
}

.timeline-dot.dot-create { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.timeline-dot.dot-change { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }

.timeline-date { font-size: .72rem; font-weight: 700; color: #1a3a5c; margin-bottom: 1px; }
.timeline-desc { font-size: .8rem; color: #6b7280; line-height: 1.5; }

.timeline-tag {
  display: inline-block;
  font-size: .65rem; font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  margin-right: 4px;
  vertical-align: middle;
}

.tag-create { background: #dcfce7; color: #15803d; }
.tag-change  { background: #fef3c7; color: #b45309; }

/* ══════════════════════════════
TOOLTIPS
══════════════════════════════ */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  background: #1a3a5c;
  color: #fff;
  border-radius: 50%;
  font-size: .68rem; font-weight: 700;
  flex-shrink: 0;
  cursor: help;
}

.tooltip-box {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: #1a3a5c;
  color: #e8edf3;
  font-size: .76rem;
  line-height: 1.55;
  padding: 13px 15px;
  border-radius: 9px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  z-index: 9999;
  pointer-events: none;
}

.tooltip-box::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 16px;
  border: 7px solid transparent;
  border-bottom-color: #1a3a5c;
}

.tooltip-box.up {
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.tooltip-box.up::before {
  bottom: auto; top: 100%;
  left: 50%; transform: translateX(-50%);
  border-bottom-color: transparent;
  border-top-color: #1a3a5c;
}

.tooltip-box.wide {
  width: min(730px, calc(100vw - 80px));
  left: 50%;
  transform: translateX(-50%);
}

.tooltip-box.wide::before { left: 50%; transform: translateX(-50%); }

.tooltip-box.right-align        { left: auto; right: 0; }
.tooltip-box.right-align::before{ left: auto; right: 12px; }

.tooltip-wrap:hover > .tooltip-box { display: block; }

/* ── Entradas de texto dentro de tooltip ── */
.steep-entry { display: block; padding: 2px 0; }

.steep-highlight {
  background: rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 3px 6px;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-top: 6px;
}

/* ── Tabela TRL dentro de tooltip ── */
.trl-table { width: 100%; border-collapse: collapse; margin-top: 8px; }

.trl-table th {
  font-size: .65rem; color: #7dd3fc;
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding: 3px 4px; text-align: left; white-space: nowrap;
}

.trl-table td {
  font-size: .65rem; color: #cbd5e1;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
}

.trl-table tr.trl-active td { color: #fff; background: rgba(255,255,255,.13); font-weight: 700; }

/* ══════════════════════════════
CONTRIBUIÇÕES
══════════════════════════════ */
.contrib-textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  outline: none;
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
}

.d-cta {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  text-align: center;
  background: var(--verde-sicredi);
  color: var(--branco);
  border: none;
  border-radius: 9px;
  font-family: var(--font-principal);
  font-size: .84rem; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease;
}

.d-cta:hover { background: var(--verde-escuro); }

/* ══════════════════════════════
RESPONSIVO RADAR
══════════════════════════════ */
@media (max-width: 840px) {
  .tooltip-box      { width: 240px; }
  .tooltip-box.wide { width: 300px; }
}

@media (max-width: 720px) {
  .sidebar    { display: none; }
  .svg-wrap   { left: 0; }
  .navbar-nav { display: none; }
  .drawer     { width: 100%; max-width: 100%; }
  .drawer-scroll  { padding: 0; }
  .drawer-card    { border-radius: 0; }
  .hero-wrapper   { border-radius: 0; }
  .hero-img       { height: 190px; }
  .card-body      { padding: 18px 16px; }
}