* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --fundo: #f4f5f7;
    --branco: #ffffff;
    --texto: #111827;
    --cinza: #6b7280;
    --borda: #e5e7eb;
    --verde: #16a34a;
    --verde-claro: #dcfce7;
    --vermelho: #dc2626;
    --vermelho-claro: #fee2e2;
    --azul: #2563eb;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--fundo);
    color: var(--texto);

    min-height: 100vh;

    padding:
        env(safe-area-inset-top)
        0
        env(safe-area-inset-bottom)
        0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: none;
}

.app {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;

    min-height: 100vh;

    padding:
        20px
        16px
        100px;
}


/* =========================
   CABEÇALHO
========================= */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 22px;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
}

.header p {
    color: var(--cinza);
    font-size: 14px;
    margin-top: 3px;
    text-transform: capitalize;
}

.btn-icon {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: var(--branco);

    font-size: 20px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06);
}


/* =========================
   RESUMO
========================= */

.resumo {
    margin-bottom: 18px;
}

.card {
    background: var(--branco);

    border-radius: 16px;

    padding: 18px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05);
}

.saldo {
    margin-bottom: 10px;
}

.titulo-card {
    display: block;

    font-size: 13px;

    color: var(--cinza);

    margin-bottom: 5px;
}

.saldo strong {
    font-size: 30px;
}

.resumo-duplo {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}

.entrada strong {
    color: var(--verde);
}

.saida strong {
    color: var(--vermelho);
}


/* =========================
   BOTÃO PRINCIPAL
========================= */

.btn-principal {
    width: 100%;

    height: 56px;

    border-radius: 16px;

    background: var(--azul);

    color: white;

    font-size: 17px;
    font-weight: 600;

    margin-bottom: 28px;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.25);
}

.btn-principal span {
    font-size: 23px;
    vertical-align: -1px;
}


/* =========================
   LISTA
========================= */

.lista-section {
    margin-bottom: 30px;
}

.titulo-lista {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.titulo-lista h2 {
    font-size: 19px;
}

.titulo-lista span {
    background: #e5e7eb;

    color: var(--cinza);

    min-width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 13px;
}

.lista {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.vazio {
    background: var(--branco);

    border-radius: 16px;

    padding: 38px 20px;

    text-align: center;

    color: var(--cinza);
}

.icone-vazio {
    font-size: 40px;

    margin-bottom: 10px;
}

.vazio h3 {
    color: var(--texto);

    font-size: 17px;

    margin-bottom: 5px;
}

.vazio p {
    font-size: 14px;
}


/* =========================
   LANÇAMENTO
========================= */

.lancamento {
    background: var(--branco);

    border-radius: 15px;

    padding: 15px;

    display: flex;

    align-items: center;

    gap: 12px;

    box-shadow:
        0 2px 7px rgba(0, 0, 0, 0.04);
}

.lancamento-icone {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 19px;
}

.lancamento-icone.entrada {
    background: var(--verde-claro);
}

.lancamento-icone.saida {
    background: var(--vermelho-claro);
}

.lancamento-info {
    flex: 1;
    min-width: 0;
}

.lancamento-info strong {
    display: block;

    font-size: 15px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.lancamento-info small {
    color: var(--cinza);

    font-size: 12px;
}

.lancamento-valor {
    font-weight: 700;

    white-space: nowrap;
}

.lancamento-valor.entrada {
    color: var(--verde);
}

.lancamento-valor.saida {
    color: var(--vermelho);
}


/* =========================
   MENU INFERIOR
========================= */

.menu-inferior {
    position: fixed;

    bottom: 0;
    left: 0;
    right: 0;

    height: 76px;

    background: rgba(255, 255, 255, 0.96);

    border-top: 1px solid var(--borda);

    display: flex;

    justify-content: space-around;
    align-items: center;

    padding-bottom: env(safe-area-inset-bottom);

    z-index: 50;
}

.menu-item {
    background: transparent;

    color: var(--cinza);

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 3px;

    min-width: 70px;
}

.menu-item span {
    font-size: 21px;
}

.menu-item small {
    font-size: 11px;
}

.menu-item.ativo {
    color: var(--azul);
}


/* =========================
   MODAL
========================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    z-index: 100;

    display: flex;

    align-items: flex-end;

    justify-content: center;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    width: 100%;
    max-width: 600px;

    max-height: 94vh;

    overflow-y: auto;

    background: var(--branco);

    border-radius:
        22px
        22px
        0
        0;

    padding: 20px 18px 30px;
}

.modal-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 21px;
}

.btn-fechar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #f3f4f6;

    font-size: 25px;

    color: var(--cinza);
}


/* =========================
   FORMULÁRIO
========================= */

.campo {
    margin-bottom: 17px;
}

.campo label {
    display: block;

    font-size: 13px;

    font-weight: 600;

    margin-bottom: 7px;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;

    border: 1px solid var(--borda);

    border-radius: 12px;

    padding: 13px;

    background: #fafafa;

    color: var(--texto);

    outline: none;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--azul);

    background: white;
}

#valor {
    font-size: 23px;

    font-weight: 600;
}


/* =========================
   TIPO
========================= */

.tipo-lancamento {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;
}

.tipo-btn {
    padding: 13px;

    border-radius: 12px;

    background: #f3f4f6;

    color: var(--cinza);

    font-weight: 600;
}

.tipo-btn.entrada-selecionada {
    background: var(--verde-claro);

    color: var(--verde);
}

.tipo-btn.saida-selecionada {
    background: var(--vermelho-claro);

    color: var(--vermelho);
}


/* =========================
   SALVAR
========================= */

.btn-salvar {
    width: 100%;

    height: 54px;

    border-radius: 14px;

    background: var(--azul);

    color: white;

    font-size: 16px;

    font-weight: 700;

    margin-top: 5px;
}


/* =========================
   DESKTOP
========================= */

@media (min-width: 700px) {

    .app {
        padding-top: 40px;
    }

    .modal-overlay {
        align-items: center;
    }

    .modal {
        border-radius: 22px;

        max-height: 90vh;
    }
}


/* =====================================================
   BOTÕES DE AÇÃO DOS LANÇAMENTOS
===================================================== */

.btn-editar-lancamento {
    border: none;

    background: #eef2ff;

    color: #2563eb;

    border-radius: 10px;

    padding: 8px 10px;

    font-size: 13px;

    font-weight: 700;

    white-space: nowrap;
}


/* Botão excluir */

.btn-excluir {
    width: 100%;

    height: 50px;

    margin-top: 10px;

    border-radius: 14px;

    background: #fee2e2;

    color: #dc2626;

    font-size: 16px;

    font-weight: 700;
}


/*
   O atributo hidden precisa vencer
   qualquer regra visual.
*/

[hidden] {
    display: none !important;
}