:root {
    --dark-blue: #363f5f;
    --green: #49AA26;
    --light-green: #3dd705;
}

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

body {
    background: #f0f2f5;
    font-family: 'Poppins', sans-serif;
}

.container {
    width: min(90vw, 800px);
    margin: auto;
}

h2 {
    margin-top: 3.2rem;
    margin-bottom: 0.25rem;
    color: var(--dark-blue);
    font-weight: normal;
}

header {
    background: #2D4A22;
    padding: 2rem 0 10rem;
    text-align: center;
}

#logo {
    color: #fff;
    font-weight: 100;
}

#balance {
    margin-top: -8rem;
}

#balance h2 {
    color: #fff;
    margin-top: 0;
}

.card {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 0.25rem;
    margin-bottom: 2rem;
    color: var(--dark-blue);
}

.card h3 {
    font-weight: normal;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card p {
    font-size: 2rem;
    line-height: 3rem;
    margin-top: 1rem;
}

.card.total {
    background: var(--green);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#transaction {
    display: block;
    width: 100%;
    overflow-x: auto;
}

#data-table {
    width: 100%;
    border-spacing: 0 0.5rem;
    color: #969cb3;
}

#data-table tbody td {
    background: #fff;
    padding: 1rem 2rem;
}

#data-table th {
    background: #fff;
    font-weight: normal;
    padding: 1rem 2rem;
    text-align: left;
}

table thead tr th:first-child, table tbody tr td:first-child {
    border-radius: 0.27rem 0 0 0.27rem;
}

table thead tr th:last-child, table tbody tr td:last-child {
    border-radius: 0 0.27rem 0.27rem 0;
}

table tbody tr {
    opacity: 0.7;
}

table tbody tr:hover {
    opacity: 1;
    transform: scale(1.02);
    transition: all 0.2s;
}

td.description {
    color: var(--dark-blue);
}

td.income {
    color: #12a454;
}

td.expense {
    color: #e92929;
}

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    color: var(--light-green);
}

button {
    width: 100%;
    height: 50px;
    border: none;
    color: white;
    background: var(--green);
    padding: 0;
    border-radius: 0.25rem;
    cursor: pointer;
}

button:hover {
    background: var(--light-green);
}

.button.new {
    margin-bottom: .8rem;
    display: inline-block;
}

.button.cancel {
    color: #e92929;
    border: 2px #e92929 solid;
    border-radius: 0.25rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.button.cancel:hover {
    opacity: 1;
}

.modal-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.modal {
    background: #f0F2f5;
    padding: 2.4rem;
    position: relative;
    z-index: 1;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: 0.4s;
}

#form {
    max-width: 500px;
}

#form h2 {
    margin-top: 0;
}

input {
    border: none;
    border-radius: 0.2rem;
    padding: 0.8rem;
    width: 100%;
}

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    /* Firefox */
}

.dark-mode-checkbox {
    position: absolute;
    left: -9999px;
}

.dark-mode-botao {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    left: 240px;
    color: #fff;
}

.dark-mode-botao::before, .dark-mode-botao::after {
    content: "";
    transition: all 0.2s ease;
}

.dark-mode-botao::before {
    display: inline-block;
    width: 2em;
    height: 1em;
    border: rgba(228, 228, 228, 0.473) solid 1px;
    border-radius: 1em;
}

.dark-mode-botao::after {
    position: absolute;
    top: 0.11em;
    left: 0.10em;
    width: 0.95em;
    height: 0.95em;
    background: #fff;
    border-radius: 100%;
}

.dark-mode-checkbox:checked+.dark-mode-botao::before {
    background: rgb(39, 39, 73);
    border: rgb(15, 15, 68) solid 1px;
}

.dark-mode-checkbox:checked+.dark-mode-botao::after {
    left: 1.10em;
}

.input-group {
    margin-top: 0.8rem;
}

.input-group small {
    opacity: 0.4;
}

.input-group.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-group.actions .button, .input-group.actions button {
    width: 48%;
}

.msg-error {
    font-size: 9pt;
    color: #e92929;
}

footer {
    text-align: center;
    padding: 4rem 0 2rem;
    color: var(--dark-blue);
    opacity: 0.6;
}

body.dark-mode-active {
    background: #0d1117;
}

.card.dark-mode-active {
    background: #cad0d8;
}

.card.total.dark-mode-active {
    background: #238636;
    color: #eee6e6;
}

a.dark-mode-active {
    color: #238636;
}

a:hover.dark-mode-active {
    color: var(--green);
}

#data-table tbody td.dark-mode-active, #data-table th.dark-mode-active {
    background: #161b22;
}

.modal.dark-mode-active {
    background: #0d1117;
}

input.dark-mode-active {
    background: #161b22;
    color: #cad0d8;
}

button.dark-mode-active {
    background: #238636;
}

button:hover.dark-mode-active {
    background: #33a84b;
}

.input-group small.dark-mode-active {
    color: #969cb3;
}

#form h2.dark-mode-active {
    color: #5d6683;
}

td.description.dark-mode-active {
    color: #969cb3;
}

@media (min-width: 800px) {
    html {
        font-size: 87.5%;
    }
    #balance {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    .dark-mode-botao::after {
        left: 0.11em;
    }
    .dark-mode-checkbox:checked+.dark-mode-botao::after {
        left: 1.11em;
    }
    .dark-mode-botao {
        left: 290px;
    }
}

@media (max-width: 500px) {
    html {
        font-size: 87.5%;
    }
    .dark-mode-botao {
        left: 85px;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 87.5%;
    }
    .dark-mode-botao {
        left: 65px;
    }
}

@media (max-width: 350px) {
    html {
        font-size: 87.5%;
    }
    .dark-mode-botao {
        left: 40px;
    }
}