/* ── Percurso de Aprendizagem ──────────────────────────────────── */

.perc-pag {
    padding: 20px 24px;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.perc-cabecalho {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.perc-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cor-texto, #1e293b);
    margin: 0;
}

/* Seletor de ano */
.perc-anos {
    display: flex;
    gap: 6px;
}

.perc-ano-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}

.perc-ano-btn:hover:not(:disabled) {
    background: #e0e7ff;
    border-color: #6366f1;
}

.perc-ano-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.perc-ano-sel {
    background: var(--cor-primaria, #2563eb) !important;
    color: #fff !important;
    border-color: var(--cor-primaria, #2563eb) !important;
}

/* Layout principal */
.perc-corpo {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* ── Grafo SVG ──────────────────────────────────────────────────── */

.perc-grafo-wrap {
    flex: 0 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    padding: 12px;
    overflow: auto;
}

.perc-grafo-svg {
    display: block;
    width: 430px;
    height: auto;
    user-select: none;
}

/* Arestas */
.perc-aresta {
    fill: none;
    stroke: #d1d5db;
    stroke-width: 2;
}

.perc-aresta-comp {
    stroke: #86efac;
    stroke-width: 2.5;
}

.perc-aresta-refc {
    stroke: #c4b5fd;
    stroke-width: 1.5;
    stroke-dasharray: 5 3;
}

/* Texto nos nós */
.perc-svg-icone {
    text-anchor: middle;
    dominant-baseline: central;
    font-size: 14px;
    pointer-events: none;
}

.perc-svg-label {
    text-anchor: middle;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
}

/* ── Painel lateral ─────────────────────────────────────────────── */

.perc-painel {
    flex: 1 1 250px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.perc-painel-vazio {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.perc-painel-vazio p {
    margin: 0 0 16px;
}

/* Legenda */
.perc-legenda {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    font-size: 12px;
    color: #374151;
}

.perc-leg-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.perc-leg-rev, .perc-leg-nor, .perc-leg-ref, .perc-leg-des, .perc-leg-comp, .perc-leg-bloq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.perc-leg-rev  { background: #ffedd5; color: #9a3412; border: 1.5px solid #f97316; }
.perc-leg-nor  { background: #dbeafe; color: #1e3a8a; border: 1.5px solid #3b82f6; }
.perc-leg-ref  { background: #ede9fe; color: #4c1d95; border: 1.5px solid #8b5cf6; }
.perc-leg-des  { background: #fef9c3; color: #78350f; border: 1.5px solid #eab308; }
.perc-leg-comp { background: #dcfce7; color: #166534; border: 1.5px solid #22c55e; }
.perc-leg-bloq { background: #f3f4f6; color: #9ca3af; border: 1.5px solid #d1d5db; }

/* Detalhe do nó */
.perc-painel-detalhe {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.perc-pan-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.perc-pan-tit {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.perc-pan-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.perc-pan-rev { background: #ffedd5; color: #9a3412; }
.perc-pan-nor { background: #dbeafe; color: #1e3a8a; }
.perc-pan-ref { background: #ede9fe; color: #4c1d95; }
.perc-pan-des { background: #fef9c3; color: #78350f; }

.perc-pan-desc {
    font-size: 13px;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

.perc-pan-prog {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0;
}

.perc-pan-prog-bar {
    height: 7px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.perc-pan-prog-fill {
    height: 100%;
    background: var(--cor-primaria, #2563eb);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.perc-pan-prog-txt {
    font-size: 11px;
    color: #6b7280;
}

.perc-pan-prereq {
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    padding: 6px 10px;
    border-radius: 5px;
}

.perc-pan-label { font-weight: 600; }

.perc-pan-acoes {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 4px;
}

.perc-btn-ir {
    display: block;
    background: var(--cor-primaria, #2563eb);
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.1s;
}
.perc-btn-ir:hover { background: #1d4ed8; }

.perc-btn-breve {
    display: block;
    text-align: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #9ca3af;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.perc-btn-bloq {
    display: block;
    text-align: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.perc-btn-comp {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #16a34a;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s;
}
.perc-btn-comp:hover { background: #dcfce7; }

.perc-btn-reset {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #a16207;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.perc-btn-reset:hover { background: #fef08a; }

/* ── Barra de progresso ─────────────────────────────────────────── */

.perc-progresso {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.perc-prog-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.perc-prog-barra {
    height: 9px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.perc-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 5px;
    transition: width 0.35s ease;
}

.perc-breve {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
}
