/* -----------------------------------------------------------------------
 * Layout geral da página de avaliação
 * --------------------------------------------------------------------- */
.eleag-avaliacao .eleag-loading {
    display: flex;
    align-items: center;
    padding: 12px 0;
    color: #646970;
}

.eleag-avaliacao .postbox-header .hndle {
    margin-left: 1em;
    margin-right: 1em;
}

.eleag-avaliacao .eleag-empty {
    color: #646970;
    padding: 4px 0;
}

/* -----------------------------------------------------------------------
 * Container do gráfico — fiel ao layout Figma
 * --------------------------------------------------------------------- */
.eleag-chart-container {
    background: #f9f9fb;
    border: 1px solid #e3e3e3;
    border-radius: 5px;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .eleag-chart-container {
        padding: 16px;
    }
}

/* -----------------------------------------------------------------------
 * Legendas do gráfico (topo)
 * --------------------------------------------------------------------- */
.eleag-chart-captions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.eleag-chart-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s ease;
}

.eleag-chart-legend__trace {
    display: inline-block;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    flex-shrink: 0;
}

.eleag-chart-legend__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e3e3e3;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f7;
}

.eleag-chart-legend__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eleag-chart-legend__trace--bom {
    background-color: #00c940;
}

.eleag-chart-legend__trace--regular {
    background-color: #f29f05;
}

.eleag-chart-legend__trace--ruim {
    background-color: #980900;
}

.eleag-chart-legend__trace--nao-sabe {
    background-color: #94a0a9;
}

.eleag-chart-legend__label {
    font-family: Lato, sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 16px;
    color: #707070;
    text-transform: uppercase;
    white-space: nowrap;
}

.eleag-chart-legend--news {
    display: flex;
    align-items: center;
    gap: 6px;
}

.eleag-chart-legend--news .eleag-chart-legend__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #f9f9fb;
    color: #00c940;
    flex-shrink: 0;
}

.eleag-chart-legend--news .eleag-chart-legend__icon svg {
    width: 12px;
    height: 12px;
}

/* -----------------------------------------------------------------------
 * Área de scroll — Y-labels fixos à esquerda + canvas com scroll
 * --------------------------------------------------------------------- */
.eleag-chart-scroll-area {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-top: 26px;
    margin-bottom: 10px;
}

/* -----------------------------------------------------------------------
 * Labels do eixo Y (HTML, fora do scroll)
 * --------------------------------------------------------------------- */
.eleag-chart-y-labels {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 180px;
    background: #f9f9fb;
    z-index: 1;
    pointer-events: none;
}

.eleag-chart-y-labels__offset {
    position: absolute;
    left: 20px;
    top: 0;
}

.eleag-chart-y-labels__item {
    position: absolute;
    right: 8px;
    transform: translateY(-50%);
    font-family: Roboto, sans-serif;
    font-size: 14px;
    line-height: 1;
    color: #707070;
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
 * Wrapper do gráfico (para scrollbar horizontal no mobile)
 * --------------------------------------------------------------------- */
.eleag-chart-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    left: -25px;
    margin-right: -25px;
}

@media (max-width: 768px) {
    .eleag-chart-y-labels {
        height: 180px;
        /* mesma altura mínima do canvas no mobile */
    }

    .eleag-chart-wrapper {
        overflow-x: auto;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE e Edge */
    }

    .eleag-chart-wrapper::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }
}

/* -----------------------------------------------------------------------
 * Área do canvas do gráfico
 * --------------------------------------------------------------------- */
.eleag-chart-graph {
    position: relative;
    height: 260px;
    width: 100%;
}

@media (max-width: 768px) {
    .eleag-chart-graph {
        min-width: 600px;
        /* Garante que o gráfico tenha largura mínima no mobile */
    }
}

/* -----------------------------------------------------------------------
 * Modal de tooltip de ponto
 * --------------------------------------------------------------------- */
.eleag-chart-point-modal {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
}

.eleag-chart-point-modal__content {
    background: #ffffff;
    border: 1px solid #f9f9fb;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 2px 2px 4px 0px rgba(0, 0, 0, 0.1);
    font-family: Roboto, sans-serif;
    font-size: 12px;
    line-height: 20px;
    color: #404346;
    min-width: 180px;
}

p.eleag-chart-point-modal__category {
    font-weight: 700;
    font-size: 12px;
    font-style: normal;
    line-height: 20px;
    color: #404346;
    margin: 0 0 4px 0;
}

p.eleag-chart-point-modal__percentage,
p.eleag-chart-point-modal__sample,
p.eleag-chart-point-modal__margin,
p.eleag-chart-point-modal__date {
    margin: 0 0 2px 0;
    font-weight: 400;
    font-size: 12px;
    font-style: normal;
    line-height: 20px;
    color: #404346;
}

p.eleag-chart-point-modal__date {
    margin-bottom: 0;
}

/* -----------------------------------------------------------------------
 * Modal de notícias
 * --------------------------------------------------------------------- */
.eleag-chart-news-modal {
    position: fixed;
    z-index: 10000;
    pointer-events: all;
}

.eleag-chart-news-modal__content {
    background: #ffffff;
    border: 1px solid #f9f9fb;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 2px 2px 4px 0px rgba(0, 0, 0, 0.1);
    font-family: Barlow, sans-serif;
    font-size: 12px;
    line-height: 20px;
    color: #404346;
    max-width: 300px;
}

p.eleag-chart-news-modal__title {
    font-weight: 400;
    font-size: 12px;
    font-style: normal;
    line-height: 20px;
    color: #404346;
    margin: 0 0 12px 0;
}

.eleag-chart-news-modal__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eleag-chart-news-modal__item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.eleag-chart-news-modal__item svg {
    flex-shrink: 0;
    margin-top: 3px;
}

.eleag-chart-news-modal__item a {
    color: #404346;
    text-decoration: none;
    font-weight: 700;
    line-height: 20px;
}

.eleag-chart-news-modal__item a:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------
 * Scrollbar customizada para mobile
 * --------------------------------------------------------------------- */
.eleag-chart-scrollbar {
    display: none;
    width: 100%;
    height: 8px;
    background: #e3e3e3;
    border-radius: 100px;
    position: relative;
}

@media (max-width: 768px) {
    .eleag-chart-scrollbar {
        display: block;
    }
}

.eleag-chart-scrollbar__track {
    width: 100%;
    height: 100%;
    position: relative;
}

.eleag-chart-scrollbar__thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #94a0a9;
    border-radius: 100px;
    transition: width 0.1s ease, left 0.1s ease;
}

/* -----------------------------------------------------------------------
 * Rodapé do gráfico
 * --------------------------------------------------------------------- */
.eleag-chart-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    font-family: Roboto, sans-serif;
    font-size: 12px;
    line-height: 20px;
    color: #707070;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .eleag-chart-footer {
        margin-top: 26px;
    }
}

.eleag-chart-footer__info {
    display: flex;
    flex-direction: column;
}

.eleag-chart-footer__updated {
    font-weight: 400;
}

.eleag-chart-footer__date {
    font-weight: 400;
}

.eleag-chart-footer__sources {
    font-weight: 400;
}

/* -----------------------------------------------------------------------
 * Filtro do gráfico
 * --------------------------------------------------------------------- */
.eleag-chart-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.eleag-chart-filter label {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
}

/* -----------------------------------------------------------------------
 * Modal de edição (padrão reutilizado de cadastro-mandatos)
 * --------------------------------------------------------------------- */
.eleag-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eleag-modal {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .25);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.eleag-modal--posts {
    max-width: 560px;
}

.eleag-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #dcdcde;
}

.eleag-modal__header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d2327;
}

.eleag-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #787c82;
    font-size: 20px;
    line-height: 1;
}

.eleag-modal__close:hover:not(:disabled) {
    color: #1d2327;
}

.eleag-modal__body {
    padding: 16px 24px 8px;
}

.eleag-modal__footer {
    padding: 12px 24px 20px;
    display: flex;
    gap: 8px;
}

/* -----------------------------------------------------------------------
 * Listagem de posts no modal
 * --------------------------------------------------------------------- */
.eleag-posts-list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.eleag-posts-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}

.eleag-posts-list li:last-child {
    border-bottom: none;
}

.eleag-posts-list__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.eleag-posts-list__title {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eleag-posts-list__url {
    font-size: 12px;
    color: #2271b1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------
 * Botão de excluir (vermelho)
 * --------------------------------------------------------------------- */
.eleag-btn-delete {
    color: #b32d2e !important;
    border-color: #b32d2e !important;
}

.eleag-btn-delete:hover:not(:disabled) {
    background: #b32d2e !important;
    color: #fff !important;
}

/* -----------------------------------------------------------------------
 * Badge de posts na listagem
 * --------------------------------------------------------------------- */
.eleag-posts-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background-color: #2271b1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

/* -----------------------------------------------------------------------
 * Evita flash de template não compilado antes do Vue montar
 * --------------------------------------------------------------------- */
[v-cloak] {
    display: none;
}

/* -----------------------------------------------------------------------
 * Campos numéricos de porcentagem — flex de 4 colunas
 * --------------------------------------------------------------------- */
.eleag-pct-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.eleag-pct-grid>div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 calc(25% - 12px);
    min-width: 150px;
}

.eleag-pct-grid input {
    width: 100%;
}

@media (max-width: 1100px) {
    .eleag-pct-grid>div {
        flex: 1 1 calc(50% - 12px);
    }
}
