/* ==========================================
   OLYMPO ADMIN V2
   CAIXA
========================================== */


/* ==========================================
   CABEÇALHO
========================================== */

.caixa-cabecalho {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.caixa-cabecalho h2 {
    margin: 5px 0 6px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.caixa-cabecalho p {
    margin: 0;
    color: #8f9baa;
    font-size: 14px;
}


/* ==========================================
   RESUMO
========================================== */

.caixa-resumo {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 26px;
}

.caixa-card {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;

    min-height: 145px;
    padding: 23px;

    background:
        linear-gradient(
            145deg,
            #172130 0%,
            #0d141d 100%
        );

    border: 1px solid #293543;
    border-radius: 15px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.caixa-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.28);
}

.caixa-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #303b48;
}

.caixa-card::after {
    content: "";

    position: absolute;
    right: -35px;
    bottom: -45px;

    width: 110px;
    height: 110px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.018);

    pointer-events: none;
}

.caixa-card span {
    color: #9ba6b3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.caixa-card strong {
    color: #ffffff;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.caixa-card small {
    color: #687585;
    font-size: 11px;
}


/* ==========================================
   SALDO
========================================== */

.caixa-card--saldo {
    border-color: rgba(212, 175, 55, 0.40);
}

.caixa-card--saldo::before {
    background: #d4af37;
}

.caixa-card--saldo strong {
    color: #d4af37;
}


/* ==========================================
   ENTRADA
========================================== */

.caixa-card--entrada {
    border-color: rgba(74, 150, 102, 0.32);
}

.caixa-card--entrada::before {
    background: #4a9666;
}

.caixa-card--entrada strong {
    color: #6fc28b;
}


/* ==========================================
   SAÍDA
========================================== */

.caixa-card--saida {
    border-color: rgba(176, 82, 82, 0.32);
}

.caixa-card--saida::before {
    background: #a94f4f;
}

.caixa-card--saida strong {
    color: #d47777;
}


/* ==========================================
   FORMULÁRIO
========================================== */

.caixa-formulario {
    position: relative;
    overflow: hidden;

    margin-bottom: 26px;
    padding: 28px;

    background:
        linear-gradient(
            145deg,
            #17202c 0%,
            #0e151e 100%
        );

    border: 1px solid #293543;
    border-radius: 15px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.20);
}

.caixa-formulario::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #d4af37;
}

.caixa-formulario__titulo {
    margin-bottom: 25px;
}

.caixa-formulario__titulo h2 {
    margin: 5px 0 6px;

    color: #ffffff;

    font-size: 21px;
    font-weight: 700;
}

.caixa-formulario__titulo p {
    margin: 0;

    color: #7f8b99;

    font-size: 13px;
    line-height: 1.5;
}


/* ==========================================
   CAMPOS
========================================== */

.caixa-formulario__campos {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.caixa-formulario__campos .campo,
.caixa-formulario__campos .form-grupo {
    min-width: 0;
}


/* ==========================================
   CAMPOS INPUT / SELECT
========================================== */

#form-caixa input,
#form-caixa select,
#form-caixa textarea {
    width: 100%;

    min-height: 44px;

    padding: 11px 13px;

    color: #ffffff;
    background: #0a1118;

    border: 1px solid #303b48;
    border-radius: 9px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

#form-caixa input:hover,
#form-caixa select:hover,
#form-caixa textarea:hover {
    border-color: #465363;
}

#form-caixa input:focus,
#form-caixa select:focus,
#form-caixa textarea:focus {
    border-color: #d4af37;

    background: #0d141d;

    box-shadow:
        0 0 0 3px rgba(212, 175, 55, 0.10);
}

#form-caixa textarea {
    min-height: 100px;
    resize: vertical;
}


/* ==========================================
   LABELS
========================================== */

#form-caixa label {
    display: block;

    margin-bottom: 7px;

    color: #aeb8c4;

    font-size: 12px;
    font-weight: 700;
}


/* ==========================================
   SELECT
========================================== */

#form-caixa #categoria-caixa {
    color: #ffffff !important;
    background-color: #0b1118 !important;
}

#form-caixa #categoria-caixa option {
    color: #ffffff !important;
    background-color: #111821 !important;
}


/* ==========================================
   AÇÕES DO FORMULÁRIO
========================================== */

.caixa-formulario__acoes {
    display: flex;
    justify-content: flex-end;

    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid #252e39;
}

.caixa-formulario__acoes .botao {
    min-width: 160px;
    min-height: 44px;
}


/* ==========================================
   GRÁFICO
========================================== */

.caixa-grafico {
    position: relative;
    overflow: hidden;

    margin-bottom: 26px;
    padding: 26px;

    background:
        linear-gradient(
            145deg,
            #141d28 0%,
            #0f161e 100%
        );

    border: 1px solid #293543;
    border-radius: 15px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18);
}

.caixa-grafico::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #d4af37;
}


/* ==========================================
   CABEÇALHO DO GRÁFICO
========================================== */

.caixa-grafico__cabecalho {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 22px;
}

.caixa-grafico__cabecalho h2 {
    margin: 5px 0 6px;

    color: #ffffff;

    font-size: 20px;
    font-weight: 700;
}

.caixa-grafico__cabecalho p {
    margin: 0;

    color: #7f8b99;

    font-size: 13px;
}


/* ==========================================
   FILTROS DO GRÁFICO
========================================== */

.caixa-filtros {
    display: flex;
    gap: 5px;

    padding: 4px;

    background: #090e14;

    border: 1px solid #29333e;
    border-radius: 9px;
}

.caixa-filtro {
    min-width: 45px;
    min-height: 33px;

    padding: 0 12px;

    color: #7f8b99;
    background: transparent;

    border: 0;
    border-radius: 6px;

    cursor: pointer;

    font-size: 11px;
    font-weight: 700;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.caixa-filtro:hover {
    color: #ffffff;
    background: #18212c;
}

.caixa-filtro:active {
    transform: scale(0.97);
}

.caixa-filtro.ativo {
    color: #080c11;
    background: #d4af37;

    box-shadow:
        0 2px 8px rgba(212, 175, 55, 0.16);
}


/* ==========================================
   ÁREA DO GRÁFICO
========================================== */

.caixa-grafico__area {
    position: relative;

    width: 100%;
    min-height: 310px;

    padding: 18px 14px 12px;

    background:
        linear-gradient(
            180deg,
            #0b1016 0%,
            #090e14 100%
        );

    border: 1px solid #252e39;
    border-radius: 11px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.015);
}


/* ==========================================
   LEGENDA
========================================== */

.caixa-grafico__legenda {
    display: flex;
    justify-content: flex-end;
    gap: 20px;

    margin-bottom: 8px;
    padding-right: 8px;
}

.caixa-grafico__legenda span {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #788491;

    font-size: 10px;
    font-weight: 600;
}

.caixa-grafico__legenda i {
    display: block;

    width: 7px;
    height: 7px;

    border-radius: 50%;
}

.legenda-entrada {
    background: #6fc28b;
}

.legenda-saida {
    background: #d47777;
}


/* ==========================================
   GRÁFICO
========================================== */

.grafico-caixa {
    position: relative;

    display: block;

    width: 100%;
    height: 250px;

    min-height: 250px;
}

.grafico-caixa canvas {
    display: block;

    width: 100%;
    height: 250px;

    cursor: crosshair;
}


/* ==========================================
   SVG - COMPATIBILIDADE
========================================== */

.grafico-caixa svg {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 250px;
}


/* ==========================================
   LINHAS
========================================== */

.grafico-caixa__linha {
    fill: none;

    stroke-width: 2.5;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================
   PONTOS
========================================== */

.grafico-caixa__ponto {
    cursor: pointer;

    stroke-width: 2;

    transition:
        r 0.2s ease,
        stroke-width 0.2s ease,
        opacity 0.2s ease;
}

.grafico-caixa__ponto:hover {
    stroke-width: 3;
    opacity: 0.85;
}


/* ==========================================
   GRADE
========================================== */

.grafico-caixa__grade {
    stroke: #1b242e;
    stroke-width: 1;
    opacity: 0.8;
}


/* ==========================================
   TEXTOS
========================================== */

.caixa-grafico__texto {
    fill: #788491;

    font-size: 11px;
    font-weight: 500;
}


/* ==========================================
   TOOLTIP DO GRÁFICO
========================================== */

.grafico-caixa__tooltip {
    pointer-events: none;
}

.grafico-caixa__tooltip rect {
    fill: #121a24;

    stroke: #d4af37;
    stroke-width: 1.2;
}

.grafico-caixa__tooltip #grafico-tooltip-tipo {
    fill: #d4af37;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;
}

.grafico-caixa__tooltip #grafico-tooltip-valor {
    fill: #ffffff;

    font-size: 15px;
    font-weight: 700;
}

.grafico-caixa__tooltip #grafico-tooltip-data {
    fill: #7f8b99;

    font-size: 10px;
    font-weight: 500;
}


/* ==========================================
   HISTÓRICO
========================================== */

.caixa-lista {
    position: relative;
    overflow: hidden;

    padding: 28px;

    background:
        linear-gradient(
            145deg,
            #141d28 0%,
            #0e151e 100%
        );

    border: 1px solid #293543;
    border-radius: 15px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18);
}

.caixa-lista::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #d4af37;
}

.caixa-lista__cabecalho {
    margin-bottom: 22px;
}

.caixa-lista__cabecalho h2 {
    margin: 5px 0 6px;

    color: #ffffff;

    font-size: 20px;
    font-weight: 700;
}

.caixa-lista__cabecalho p {
    margin: 0;

    color: #7f8b99;

    font-size: 13px;
}


/* ==========================================
   FILTROS DO HISTÓRICO
========================================== */

.caixa-historico-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 20px;
    margin-bottom: 22px;

    padding-bottom: 18px;

    border-bottom: 1px solid #252e39;
}

.caixa-historico-filtro {
    position: relative;

    padding: 9px 16px;

    color: #8f9baa;
    background: #111821;

    border: 1px solid #2b3542;
    border-radius: 8px;

    cursor: pointer;

    font-size: 12px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.caixa-historico-filtro:hover {
    color: #ffffff;

    border-color: #657080;

    background: #17212c;
}

.caixa-historico-filtro.ativo {
    color: #0b1018;

    background: #d4af37;

    border-color: #d4af37;

    box-shadow:
        0 4px 12px rgba(212, 175, 55, 0.14);
}

.caixa-historico-filtro:active {
    transform: translateY(1px);
}


/* ==========================================
   LISTA DE MOVIMENTAÇÕES
========================================== */

#container-caixa {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ==========================================
   ITEM DO HISTÓRICO
========================================== */

.caixa-lista .item-caixa,
.caixa-lista .historico-item,
.caixa-lista .movimentacao-item {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin: 0;

    min-height: 92px;

    padding: 17px 20px 17px 18px;

    background:
        linear-gradient(
            145deg,
            #17212c 0%,
            #101820 100%
        );

    border: 1px solid #2a3542;
    border-radius: 12px;

    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* ==========================================
   BARRA LATERAL ENTRADA / SAÍDA
========================================== */

.caixa-lista .item-caixa::before,
.caixa-lista .historico-item::before,
.caixa-lista .movimentacao-item::before {
    content: "";

    position: absolute;

    top: 10px;
    bottom: 10px;
    left: 0;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background: #4a9666;
}

.caixa-lista .item-caixa--saida::before {
    background: #a94f4f;
}


/* ==========================================
   HOVER HISTÓRICO
========================================== */

.caixa-lista .item-caixa:hover,
.caixa-lista .historico-item:hover,
.caixa-lista .movimentacao-item:hover {
    transform: translateY(-2px);

    border-color: #3b4857;

    background:
        linear-gradient(
            145deg,
            #1a2531 0%,
            #121b25 100%
        );

    box-shadow:
        0 9px 20px rgba(0, 0, 0, 0.18);
}


/* ==========================================
   ÍCONE
========================================== */

.caixa-lista .item-caixa__icone {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 44px;

    width: 44px;
    height: 44px;

    border-radius: 11px;

    background: #101821;

    border: 1px solid #2b3744;

    color: #d4af37;

    font-size: 18px;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}


/* ==========================================
   PRINCIPAL
========================================== */

.caixa-lista .item-caixa__principal {
    flex: 1;
    min-width: 0;
}


/* ==========================================
   TOPO DO ITEM
========================================== */

.caixa-lista .item-caixa__topo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 9px;

    margin-bottom: 7px;
}


/* ==========================================
   TIPO
========================================== */

.caixa-lista .item-caixa__tipo {
    display: inline-flex;
    align-items: center;

    min-height: 23px;

    padding: 4px 9px;

    border-radius: 6px;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.caixa-lista .item-caixa__tipo--entrada {
    color: #79d394;

    background: rgba(74, 150, 102, 0.13);

    border: 1px solid rgba(74, 150, 102, 0.28);
}

.caixa-lista .item-caixa__tipo--saida {
    color: #e08787;

    background: rgba(169, 79, 79, 0.13);

    border: 1px solid rgba(169, 79, 79, 0.28);
}


/* ==========================================
   DESCRIÇÃO
========================================== */

.caixa-lista .item-caixa__descricao {
    display: block;

    margin-bottom: 5px;

    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================
   DETALHES
========================================== */

.caixa-lista .item-caixa__detalhes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 5px 13px;

    color: #778492;

    font-size: 11px;
}

.caixa-lista .item-caixa__detalhes span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.caixa-lista .item-caixa__detalhes span + span::before {
    content: "•";

    color: #414d5a;
}


/* ==========================================
   VALOR
========================================== */

.caixa-lista .item-caixa__valor {
    flex: 0 0 auto;

    min-width: 120px;

    padding-left: 18px;

    text-align: right;

    border-left: 1px solid #293441;
}

.caixa-lista .item-caixa--entrada .item-caixa__valor {
    color: #6fc28b;
}

.caixa-lista .item-caixa--saida .item-caixa__valor {
    color: #d47777;
}


/* ==========================================
   VALOR / TEXTO PRINCIPAL
========================================== */

.caixa-lista .item-caixa__valor strong {
    display: block;

    font-size: 17px;
    font-weight: 700;

    line-height: 1.2;
}

.caixa-lista .item-caixa__valor small {
    display: block;

    margin-top: 5px;

    color: #647180;

    font-size: 10px;
}


/* ==========================================
   ESTADO VAZIO
========================================== */

.caixa-lista .estado-vazio {
    padding: 50px 20px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            #101821 0%,
            #0c131b 100%
        );

    border: 1px dashed #303a46;
    border-radius: 11px;
}

.caixa-lista .estado-vazio strong {
    display: block;

    margin-bottom: 7px;

    color: #ffffff;

    font-size: 14px;
}

.caixa-lista .estado-vazio p {
    margin: 0;

    color: #737f8d;

    font-size: 13px;
}


/* ==========================================
   RESPONSIVO
========================================== */

@media (max-width: 1000px) {

    .caixa-resumo {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 700px) {

    .caixa-cabecalho {
        align-items: stretch;
        flex-direction: column;
    }

    .caixa-resumo {
        grid-template-columns: 1fr;
    }

    .caixa-formulario,
    .caixa-lista,
    .caixa-grafico {
        padding: 20px;
    }

    .caixa-formulario__campos {
        grid-template-columns: 1fr;
    }

    .caixa-formulario__acoes {
        justify-content: stretch;
    }

    .caixa-formulario__acoes .botao {
        width: 100%;
    }

    .caixa-grafico__cabecalho {
        align-items: stretch;
        flex-direction: column;
    }

    .caixa-filtros {
        width: 100%;
    }

    .caixa-filtro {
        flex: 1;
    }

    .caixa-grafico__area {
        overflow-x: auto;

        padding: 14px 8px 10px;
    }

    .grafico-caixa {
        min-width: 560px;
        height: 240px;
    }

    .grafico-caixa canvas {
        min-width: 560px;
        height: 240px;
    }

    .grafico-caixa svg {
        min-width: 560px;
    }

    .caixa-grafico__legenda {
        justify-content: flex-start;
        padding-left: 4px;
    }

    .caixa-historico-filtros {
        gap: 7px;
    }

    .caixa-historico-filtro {
        flex: 1 1 auto;

        padding: 10px 12px;
    }

    .caixa-lista .item-caixa,
    .caixa-lista .historico-item,
    .caixa-lista .movimentacao-item {
        align-items: flex-start;
        flex-wrap: wrap;

        padding: 16px;
    }

    .caixa-lista .item-caixa__icone {
        flex: 0 0 42px;

        width: 42px;
        height: 42px;
    }

    .caixa-lista .item-caixa__principal {
        min-width: calc(100% - 62px);
    }

    .caixa-lista .item-caixa__valor {
        width: 100%;
        min-width: 0;

        padding-top: 13px;
        padding-left: 0;

        text-align: left;

        border-top: 1px solid #293441;
        border-left: 0;
    }

}


@media (max-width: 420px) {

    .caixa-formulario,
    .caixa-lista,
    .caixa-grafico {
        padding: 16px;
    }

    .caixa-card {
        min-height: 130px;
        padding: 18px;
    }

    .caixa-card strong {
        font-size: 22px;
    }

    .caixa-historico-filtros {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .caixa-historico-filtro {
        width: 100%;
    }

    .caixa-lista .item-caixa__descricao {
        max-width: 100%;
    }

    .caixa-lista .item-caixa__detalhes {
        gap: 5px 8px;
    }

}