/* RESET */

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


body {
    font-family: Arial, sans-serif;
    background: #0f1117;
    color: #ffffff;
}


/* ESTRUTURA */

.app {
    display: flex;
    min-height: 100vh;
}


/* MENU LATERAL */

.sidebar {
    width: 240px;
    background: #171923;
    padding: 30px 20px;
    border-right: 1px solid #272a36;
}


.sidebar h1 {
    color: #8b5cf6;
    font-size: 24px;
    margin-bottom: 40px;
}


.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.sidebar nav a {
    text-decoration: none;
    color: #a7a9b4;
    padding: 14px;
    border-radius: 10px;
    transition: 0.3s;
}


.sidebar nav a:hover,
.sidebar nav a.active {
    background: #272033;
    color: #ffffff;
}


/* CONTEÚDO */

.main {
    flex: 1;
    padding: 35px;
}


/* CABEÇALHO */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}


.header p {
    color: #a7a9b4;
    margin-bottom: 6px;
}


.header h2 {
    font-size: 28px;
}


/* BOTÃO */

.btn-primary {
    background: #8b5cf6;
    border: none;
    color: white;
    padding: 13px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
}


.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}


/* CARDS */

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}


.card {
    background: #171923;
    border: 1px solid #272a36;
    border-radius: 15px;
    padding: 25px;
}


.card span {
    color: #a7a9b4;
    font-size: 14px;
}


.card h3 {
    font-size: 26px;
    margin-top: 12px;
}


/* PAINÉIS */

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}


.panel {
    background: #171923;
    border: 1px solid #272a36;
    border-radius: 15px;
    padding: 25px;
    min-height: 300px;
}


.panel h3 {
    margin-bottom: 25px;
}


.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* LEGENDA */

.legend {
    display: flex;
    gap: 15px;
    color: #a7a9b4;
    font-size: 12px;
}


.legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}


.legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}


.legend-income {
    background: #22c55e;
}


.legend-expense {
    background: #ef4444;
}


/* GRÁFICO */

.chart {
    height: 220px;
    border-radius: 10px;
    background: #11131b;

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

    gap: 70px;

    padding: 20px 30px;
}


.chart-bar-container {
    height: 180px;

    display: flex;
    flex-direction: column;

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

    gap: 8px;

    min-width: 80px;
}


.chart-bar {
    width: 55px;

    min-height: 4px;

    border-radius: 8px 8px 3px 3px;

    transition: height 0.5s ease;
}


.income-bar {
    background: #22c55e;
}


.expense-bar {
    background: #ef4444;
}


.chart-bar-container > span {
    color: #a7a9b4;
    font-size: 12px;
}


.chart-value {
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}


/* TRANSAÇÕES */

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

    padding: 15px 0;

    border-bottom: 1px solid #272a36;
}


.transaction strong {
    display: block;
    margin-bottom: 5px;
}


.transaction small {
    color: #777b89;
}


.transaction-right {
    display: flex;
    align-items: center;
    gap: 15px;
}


.transaction.income .transaction-right > span {
    color: #22c55e;
    font-weight: bold;
}


.transaction.expense .transaction-right > span {
    color: #ef4444;
    font-weight: bold;
}


.transaction.empty {
    border-bottom: none;
}


/* BOTÃO EXCLUIR */

.delete-button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: 0.2s;
}


.delete-button:hover {
    opacity: 1;
    transform: scale(1.15);
}


/* MODAL */

.modal {
    display: none;

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

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

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

    z-index: 9999;
}


.modal.active {
    display: flex;
}


.modal-content {
    width: 90%;
    max-width: 500px;

    background: #171923;

    border: 1px solid #272a36;

    border-radius: 15px;

    padding: 30px;

    color: white;
}


.modal-header {
    display: flex;

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

    margin-bottom: 25px;
}


.modal-header h2 {
    margin: 0;
}


.close-modal {
    background: none;
    border: none;

    color: white;

    font-size: 30px;

    cursor: pointer;
}


/* FORMULÁRIO */

#transactionForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


#transactionForm label {
    color: #a7a9b4;

    font-size: 14px;

    margin-top: 8px;
}


#transactionForm input,
#transactionForm select {
    width: 100%;

    background: #11131b;

    border: 1px solid #272a36;

    color: white;

    padding: 13px;

    border-radius: 8px;

    outline: none;
}


#transactionForm input:focus,
#transactionForm select:focus {
    border-color: #8b5cf6;
}


#transactionForm button {
    margin-top: 20px;
}


/* RESPONSIVIDADE */

@media (max-width: 900px) {

    .sidebar {
        width: 190px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .app {
        flex-direction: column;
    }


    .sidebar {
        width: 100%;
    }


    .sidebar h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }


    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
    }


    .sidebar nav a {
        white-space: nowrap;
        padding: 10px;
        font-size: 13px;
    }


    .main {
        padding: 15px;
    }


    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }


    .header h2 {
        font-size: 22px;
    }


    .panel-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }


    .chart {
        gap: 35px;
    }


    .chart-bar {
        width: 45px;
    }


    .transaction {
        gap: 10px;
    }


    .transaction-right {
        gap: 8px;
    }

}