body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cartao-resumo {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.cartao-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.limite-grafico {
    position: relative;
    width: 140px;
    height: 140px;
    flex: 0 0 140px;
}

.limite-grafico svg {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.grafico-trilha,
.grafico-gasto {
    fill: none;
    stroke-width: 12;
}

.grafico-trilha {
    stroke: #e8edf3;
}

.grafico-gasto {
    stroke: #111111;
    stroke-linecap: round;
}

.grafico-centro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.grafico-centro strong {
    font-size: 28px;
    line-height: 1;
}

.grafico-centro span {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.limite-legenda {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 160px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legenda-item p {
    margin: 4px 0 0;
    color: #666;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.legenda-cor {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 14px;
}

.legenda-cor-gasto {
    background: #111111;
}

.legenda-cor-disponivel {
    background: #cfd8e3;
}

.cartao-detalhes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 18px;
    margin-bottom: 16px;
}

.gasto-item {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 8px;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: black;
    color: white;
    cursor: pointer;
}

.alerta {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alerta-sucesso {
    background: #e8f7ec;
    border: 1px solid #b7e4c7;
    color: #1f6f3d;
}

.alerta-erro {
    background: #fdecec;
    border: 1px solid #f5b5b5;
    color: #a12626;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-conteudo {
    position: relative;
    z-index: 2;
    background: white;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 120px auto 0;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.modal-conteudo h2 {
    margin-bottom: 12px;
}

.modal-conteudo p {
    margin-bottom: 20px;
}

.modal-acoes {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .cartao-topo {
        justify-content: center;
    }

    .limite-legenda {
        width: 100%;
    }
}
