.kpis, .grade-meio, .grade-cards, .lista-orcamento, .grade-config {
    display: grid;
    gap: 12px;
}

.card-kpi,
.painel,
.card-frase,
.card-habito {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-kpi { color: var(--on-kpi); container-type: inline-size; }
.card-kpi.saldo { background: var(--grad-saldo); }
.card-kpi.receitas { background: var(--grad-receitas); }
.card-kpi.despesas { background: var(--grad-despesas); }
.card-kpi.meta { background: var(--grad-meta); }

.kpi-topo, .entidade-topo, .painel-topo, .pagina-topo, .acoes-inline, .acoes-modal, .filtros {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-topo { margin-bottom: 10px; color: var(--on-kpi); }

.kpi-icone, .blob {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

.kpi-icone {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.blob { color: white; }

.card-kpi h2 {
    font-size: clamp(0.7rem, 9.6cqi, 1.45rem);
    font-weight: 800;
    margin: 2px 0 8px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
}
.card-kpi p, .painel p, .kpi-sub { color: var(--muted); font-size: 13px; }
.card-kpi p, .card-kpi .kpi-sub { color: var(--on-kpi-muted); }

.porcentagem.positiva { color: var(--green); font-weight: 700; }
.porcentagem.negativa { color: var(--red); font-weight: 700; }
.porcentagem.neutra { color: var(--on-kpi-muted); font-weight: 600; }

.barra-meta {
    height: 7px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    overflow: hidden;
    margin: 8px 0;
}

.barra-meta span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--purple), #c084fc);
}

.barra-meta.atencao span { background: var(--amber); }
.barra-meta.estourado span { background: var(--red); }
.aviso-linha { color: var(--amber) !important; font-weight: 600; }

.painel-topo, .pagina-topo {
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    min-width: 0;
}

.painel-topo > div, .pagina-topo > div { min-width: 0; flex: 1 1 160px; }

.filtro { max-width: 100%; }
.filtro select { max-width: 100%; }

.pagina-topo { margin-bottom: 16px; }
.pagina-topo h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.pagina-acoes, .pagina-topo > div { min-width: 0; }

.filtro select,
.filtros select,
.filtros input,
.campo input,
.campo select,
.campo textarea,
.orc-form input {
    background: var(--input);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    width: 100%;
}

.filtro select { width: auto; border-radius: 999px; padding: 8px 12px; }

.filtros, .grade-config { align-items: end; flex-wrap: wrap; }
.filtros label, .campo { display: grid; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.campo textarea { min-height: 84px; resize: vertical; }
.campo-curto { max-width: 220px; margin-bottom: 12px; }

.chart-box { position: relative; height: 240px; min-width: 0; }
.chart-box canvas, .donut-box canvas { max-width: 100%; }

.donut-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 18px 28px;
    width: 100%;
    min-width: 0;
}
.lista-categorias {
    flex: 1 1 240px;
    min-width: min(100%, 240px);
    width: auto;
    display: grid;
    gap: 10px;
}
.donut-box {
    position: relative;
    width: 188px;
    height: 188px;
    flex: 0 0 188px;
}
.donut-box canvas { width: 100% !important; height: 100% !important; position: relative; z-index: 0; }
.donut-centro {
    position: absolute;
    inset: 24%;
    z-index: 1;
    border-radius: 50%;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
    background: transparent;
}
.donut-centro span { color: var(--muted); font-size: 12px; }
.donut-centro strong {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow-wrap: normal;
}

.lista-transacoes, .lista-notificacoes { width: 100%; display: grid; gap: 10px; }

.transacao-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.categoria-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.transacao-item.simples { grid-template-columns: minmax(0, 1fr) auto; }

.categoria-cor { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.categoria-nome {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}
.categoria-nome i { margin-right: 6px; width: 1em; text-align: center; }
.categoria-pct { flex: 0 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.categoria-valor { flex: 0 0 auto; font-weight: 700; white-space: nowrap; }
.categoria-info small, .transacao-info span, .transacao-meta small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.transacao-info strong { display: block; overflow-wrap: anywhere; }
.transacao-icone {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
}
.transacao-icone.receita { background: rgba(34, 211, 162, 0.16); }
.transacao-icone.despesa { background: rgba(244, 114, 182, 0.16); }
.transacao-valor { font-weight: 700; white-space: nowrap; }
.transacao-valor.receita, .busca-item em.receita { color: var(--green); }
.transacao-valor.despesa, .busca-item em.despesa { color: var(--pink); }
.transacao-meta { text-align: right; }

.menu-ancora { position: relative; }
.menu-linha {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 15;
    min-width: 140px;
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px;
    box-shadow: var(--shadow);
}
.menu-linha button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    border-radius: 10px;
    padding: 8px 10px;
}
.menu-linha button:hover { background: rgba(255, 255, 255, 0.06); }

.tabela-wrap { display: none; width: 100%; overflow-x: auto; }
.tabela-sempre { display: block; }
.tabela-transacoes { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela-transacoes th, .tabela-transacoes td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    vertical-align: middle;
}
.tabela-transacoes th { font-size: 12px; font-weight: 600; }
.selo {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.06);
}
.selo.receita { color: var(--green); }
.selo.despesa { color: var(--pink); }

.ver-todas, .link-btn {
    color: var(--blue);
    background: transparent;
    border: 0;
    font-weight: 600;
}

.vazio, .sem-transacoes { color: var(--muted); }
.vazio {
    text-align: center;
    padding: 28px 16px;
    display: grid;
    justify-items: center;
    gap: 8px;
}
.vazio h2 { color: var(--text); }
.vazio-icone {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--grad-brand);
    color: white;
    font-size: 24px;
}
.vazio.compacto { padding: 12px; }

.btn-primario, .btn-secundario, .btn-perigo, .btn-google, .btn-receita, .btn-despesa {
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 700;
    border: 0;
}
.btn-primario, .btn-google { background: var(--grad-brand); color: white; }
.btn-secundario {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-secundario.ativo { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }
.btn-perigo { background: transparent; color: var(--red); border: 1px solid rgba(251, 113, 133, 0.45); }
.btn-receita, .btn-despesa { display: block; width: 100%; text-align: center; margin-top: 8px; color: white; }
.btn-receita { background: var(--green-2); }
.btn-despesa { background: var(--btn-despesa); }

.avatar, .avatar-iniciais {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: #22324d;
    color: white;
    font-weight: 700;
    flex: 0 0 auto;
}
.avatar.grande, .avatar-iniciais.grande { width: 56px; height: 56px; }
.avatar.enorme, .avatar-iniciais.enorme { width: 96px; height: 96px; font-size: 28px; }

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--red);
    color: white;
    font-size: 10px;
    display: grid;
    place-items: center;
}

.menu-flutuante, .painel-notificacoes, .busca-painel {
    position: fixed;
    right: 16px;
    top: 72px;
    width: min(86vw, 280px);
    background: #101c33;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 8px;
    z-index: 60;
    box-shadow: 0 18px 50px rgba(2, 8, 20, 0.45);
    animation: subir 0.2s ease;
}
.menu-flutuante a,
.menu-flutuante button {
    min-height: 44px;
    font-weight: 600;
}
.menu-flutuante a:hover,
.menu-flutuante button:hover { background: rgba(255, 255, 255, 0.06); }
.menu-flutuante i { width: 1.15em; text-align: center; color: #d5e2f7; }
.menu-flutuante .sair-btn,
.menu-flutuante .sair-btn i { color: #fb7185; }
#toggle-notificacoes { justify-content: flex-start; }
#toggle-notificacoes .switch { margin-left: auto; }
.menu-flutuante.ancorado-baixo { top: auto; bottom: 92px; }
.painel-notificacoes { width: min(88vw, 360px); }
.busca-painel { left: 16px; right: 16px; width: auto; max-height: 50vh; overflow: auto; }
.busca-item, .item-notificacao {
    width: 100%;
    display: grid;
    gap: 2px;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    border-radius: 12px;
    padding: 10px;
}
.busca-item span, .item-notificacao span { color: var(--muted); font-size: 12px; }
.item-notificacao.nao-lida { background: rgba(79, 140, 255, 0.12); }
.busca-vazio { color: var(--muted); padding: 10px; }

.switch {
    width: 36px;
    height: 20px;
    border-radius: 99px;
    background: #334155;
    position: relative;
    margin-left: auto;
    flex: 0 0 auto;
}
.switch.ligado { background: var(--purple-2); }
.switch::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 3px;
    left: 3px;
}
.switch.ligado::after { left: 18px; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: end center;
    background: rgba(2, 6, 16, 0.78);
    isolation: isolate;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(2, 6, 16, 0.78);
}
#modal .modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(92vh, 820px);
    overflow: auto;
    background: #101c33;
    background-color: #101c33;
    background-image: none;
    color: #eef4ff;
    opacity: 1;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px 24px 0 0;
    padding: 20px 18px 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
    animation: subir-painel 0.22s ease;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { color: inherit; font-size: 1.25rem; }
#modal .campo {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    color: #c5d4ee;
    font-size: 13px;
    font-weight: 600;
}
#modal .campo input,
#modal .campo select,
#modal .campo textarea {
    background: #0c1729;
    background-color: #0c1729;
    color: #eef4ff;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 14px;
    padding: 12px 14px;
    width: 100%;
    opacity: 1;
}
.form-grade { display: grid; gap: 12px; }
.seletor-tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo-btn {
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: #0c1729;
    border-radius: 12px;
    padding: 10px;
    color: #eef4ff;
    font-weight: 700;
}
.tipo-btn.ativo { background: var(--grad-nav); border-color: transparent; color: white; }
.erro-campo { color: var(--red); min-height: 1em; }
.acoes-modal { justify-content: flex-end; flex-wrap: wrap; }
.texto-modal { margin-bottom: 8px; }
.dica { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    z-index: 70;
    background: var(--card-solid);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 16px;
    max-width: min(92vw, 420px);
    box-shadow: var(--shadow);
}

.login-tela {
    --bg: #07111f;
    --text: #eef4ff;
    --muted: #93a4c3;
    --card: rgba(16, 28, 51, 0.92);
    --line: rgba(148, 163, 184, 0.16);
    --input: #0c1729;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at top right, rgba(79, 140, 255, 0.2), transparent 32%),
        radial-gradient(circle at 0% 80%, rgba(139, 124, 255, 0.18), transparent 28%),
        #07111f;
    color: #eef4ff;
}
.login-card {
    width: min(100%, 460px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 28px 22px;
    box-shadow: var(--shadow);
}
.login-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--grad-brand);
    color: white;
    margin-bottom: 12px;
    font-size: 22px;
}
.marca { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #b7c9ee; font-size: 12px; }
.login-card h1 { font-size: 1.7rem; margin: 6px 0; }
.sub { color: var(--muted); margin-bottom: 16px; }
.aviso {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}
.btn-google { width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.btn-google.carregando .icone-google { animation: girar 1s linear infinite; }
.btn-cancelar, #btn-demo, #btn-cancelar-google { width: 100%; margin-top: 8px; }
.divisor { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; color: var(--muted); margin: 16px 0; }
.divisor::before, .divisor::after { content: ""; height: 1px; background: var(--line); }
.demo-box {
    border: 1px dashed rgba(245, 158, 11, 0.55);
    border-radius: 18px;
    padding: 14px;
    background: rgba(245, 158, 11, 0.06);
}
.demo-box h2 { font-size: 1rem; margin-bottom: 6px; }
.mensagem-login { min-height: 20px; font-size: 13px; margin: 8px 0; }
.mensagem-login.erro { color: var(--red); }
.mensagem-login.sucesso { color: var(--green); }

.card-frase { background: linear-gradient(160deg, #1a2744, #12233d); color: var(--on-kpi); }
.card-habito { background: linear-gradient(160deg, #3f3a12, #1d2412); color: var(--on-kpi); }
.meta-item { margin: 12px 0; }
.meta-item span, .meta-item strong { display: block; }
.resumo-rapido blockquote { margin-top: 12px; color: var(--muted); font-size: 13px; }
.anel {
    --p: 0;
    width: 112px;
    height: 112px;
    margin: 12px auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--pink) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
}
.anel strong {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card-solid);
}
.grade-cards { grid-template-columns: 1fr; }
.card-entidade { display: grid; gap: 8px; }
.valor-conta { font-size: 1.3rem; }
.orc-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.orc-form input { flex: 1; min-width: 120px; }
.lista-simples { padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.perfil-layout { display: grid; gap: 18px; }
.perfil-foto { display: grid; justify-items: center; gap: 10px; }
.sobre { display: grid; justify-items: start; gap: 8px; }
.oculto { display: none !important; }

.esqueletos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skeleton {
    border-radius: 16px;
    min-height: 92px;
    background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.12), rgba(255,255,255,.04));
    background-size: 200% 100%;
    animation: brilho 1.2s linear infinite;
}
.skeleton.bloco, .skeleton.linha { grid-column: 1 / -1; }
.skeleton.bloco { min-height: 200px; }
.skeleton.linha { min-height: 64px; }

.conteudo > section, .conteudo > div, .conteudo > header { animation: subir 0.28s ease; }
