/* ── Aventum Economia Widgets ── */
.ew-widget {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: #1C1710;
    background: #fff;
    border: 1px solid #e8e3dc;
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .ew-widget {
        background: #1a1a1a;
        border-color: #2e2e2e;
        color: #e8e3dc;
    }
}

/* Label */
.ew-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9e420e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c85b1a;
    display: inline-block;
}

/* Valor grande (Ibovespa) */
.ew-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
}
.ew-unit {
    font-size: 14px;
    font-weight: 400;
    color: #9e8e80;
}

/* Badge */
.ew-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
}
.ew-badge.ew-up   { background: #d4edda; color: #1a6634; }
.ew-badge.ew-down { background: #f8d7da; color: #721c24; }
.ew-badge.ew-sm   { font-size: 10px; padding: 1px 5px; }

@media (prefers-color-scheme: dark) {
    .ew-badge          { background: #333; color: #ccc; }
    .ew-badge.ew-up    { background: #1a3d26; color: #6fcf97; }
    .ew-badge.ew-down  { background: #3d1a1a; color: #eb5757; }
}

/* Câmbio */
.ew-cambio-list { display: flex; flex-direction: column; gap: 8px; }
.ew-cambio-row  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ew-cambio-name { display: flex; align-items: center; gap: 6px; flex: 1; font-weight: 600; font-size: 13px; }
.ew-cambio-price { font-weight: 700; font-size: 13px; margin-left: auto; }
.ew-flag { font-size: 16px; line-height: 1; }

/* Tabelas (Inflação / Juros) */
.ew-table { width: 100%; }
.ew-table-head,
.ew-table-row {
    display: grid;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 1px solid #f0ebe4;
    align-items: center;
}
.ew-inflacao .ew-table-head,
.ew-inflacao .ew-table-row { grid-template-columns: 1fr 80px 80px; }
.ew-juros .ew-table-head,
.ew-juros .ew-table-row    { grid-template-columns: 1fr 90px; }
.ew-table-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9e8e80; border-bottom: 2px solid #e8e3dc; }
.ew-table-row:last-child { border-bottom: none; }
.ew-table-name { font-size: 12px; font-weight: 600; }
.ew-table-name small { font-weight: 400; color: #9e8e80; margin-left: 4px; }
.ew-highlight { font-weight: 700; color: #c85b1a; }

@media (prefers-color-scheme: dark) {
    .ew-table-head { color: #6e6660; border-color: #2e2e2e; }
    .ew-table-row  { border-color: #2a2a2a; }
    .ew-highlight  { color: #e07240; }
}

/* Ações */
.ew-acoes-col { margin-bottom: 12px; }
.ew-acoes-head { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.ew-up-text   { color: #1a6634; }
.ew-down-text { color: #721c24; }
@media (prefers-color-scheme: dark) {
    .ew-up-text   { color: #6fcf97; }
    .ew-down-text { color: #eb5757; }
}
.ew-acoes-row {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 6px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0ebe4;
    font-size: 12px;
}
.ew-acoes-row:last-child { border-bottom: none; }
.ew-acoes-ticker { font-weight: 700; font-size: 11px; color: #c85b1a; }
.ew-acoes-name   { font-size: 11px; color: #6e6660; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ew-acoes-price  { font-weight: 600; white-space: nowrap; }
.ew-acoes-divider { border-top: 2px solid #e8e3dc; margin: 8px 0; }
@media (prefers-color-scheme: dark) {
    .ew-acoes-ticker  { color: #e07240; }
    .ew-acoes-name    { color: #6e6660; }
    .ew-acoes-row     { border-color: #2a2a2a; }
    .ew-acoes-divider { border-color: #2e2e2e; }
}

/* Footer */
.ew-footer {
    font-size: 10px;
    color: #afa89e;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f0ebe4;
}
@media (prefers-color-scheme: dark) {
    .ew-footer { border-color: #2a2a2a; color: #4e4840; }
}

/* Erro */
.ew-error { color: #721c24; font-size: 12px; margin: 0; }

/* Sparkline canvas */
.ew-sparkline-wrap { margin: 10px 0 4px; }
.ew-sparkline { display: block; width: 100% !important; height: 40px !important; }
