:root {
    --bg-color: #f6f8fa;
    --text-color: #1d1f27;
    --main-color: #3a3dbe;
}
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body {
    padding: 2rem;
    font-family: "Poppins", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}
h1 {
    text-align: center;
    font-size: 1.5rem;
}
h3, header {
    margin-bottom: 0.5rem;
}
main {
    max-width: 400px;
    margin: 1rem auto;
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}
header {
    background-color: var(--main-color);
    color: #fff;
    padding: 1rem;
    text-align: center;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
}
header div {
    padding: 5px;
}
header div:first-child {
    flex-basis: 100%;
    font-size: 2.25rem;
    font-weight: 600;
}
header div:nth-child(n+2) {
    flex-basis: 50%;
    font-size: 1.25rem;
    font-weight: 500;
}
header h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
form input:not(#type),
form button {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 5px;
    height: 42px;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
}
form button {
    background-color: var(--main-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}
form label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
form div:nth-child(-n + 2) {
    flex-basis: 100%;
}
#amountDiv, #dateDiv {
    width: calc(50% - 5px);
}
input#type {
    appearance: none;
    position: absolute;
}
.option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #eee;
    border-radius: 5px;
    position: relative;
}
.option span {
    width: 50%;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}
.option::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    background-color: #fff;
    height: calc(100% - 10px);
    width: calc(50% - 10px);
    transform: translateX(5px);
    border-radius: inherit;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
    transition: all 200ms ;
}
input#type:checked ~ .option::before {
    left: 50%;
}
ul {
    list-style-type: none;
}
ul li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 10px;
    position: relative;
}
ul li:hover {
    background: rgba(0, 0, 0, 0.1);
}
.name {
    flex: 1;
}
.name h4 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
}
.name p {
    font-size: 0.8rem;
    color: #555;
}
.amount {
    font-weight: 600;
}
.amount.income {
    color: yellowgreen;
}
.amount.expense {
    color: indianred;
}
.action {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #f00;
    color: #fff;
    height: 100%;
    width: 50px;
    display: grid;
    place-items: center;
    transform: scaleX(0);
    transform-origin: right;
    transition: all 300ms;
}
ul li:hover .action {
    transform: scaleX(1);
}
.action svg {
    width: 36px;
    height: 36px;
    cursor: pointer;
}
#status {
    text-align: center;
    margin-bottom: 0.5rem;
}

/* media queries */
@media (max-width: 400px) {
    main, body h1 {
        scale: 0.9;
    }   
    body {
        padding: 0.5rem;
    }
    main {
        margin: 0 auto;
    }
}
@media (max-width: 350px) {
    main, body h1 {
        scale: 0.8;
    }   
    body {
        padding: 5px;
    }
}