:root {
  --dark-color: #363f5f;
  --light-green: #49AA26;
  --dark-green: #368519;
  --red: #e92929;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} 

html {
  font-size: 93.75%;
}

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

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

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

}
/* Links & Buttons =======================================*/
a {
  color: var(--light-green);
  text-decoration: none;
  display: inline-block;
}
a:hover {
  color: #3dd705;
}

.button.new {
  width: fit-content;
  border: none;
  
  text-align: left;
  color: var(--light-green);
  margin-bottom: .8rem;
  
  cursor: pointer;
}

button {
  width: 100%;
  color: #fff;
  background: transparent;
}

.button.cancel {
  color: var(--red);
  border: solid 1px var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .4;
}
.button.cancel:hover {
  opacity: 1;
}

button[type="submit"] {
  background: var(--light-green);
  border: solid 1px var(--light-green);
}
button[type="submit"]:hover {
  background: var(--dark-green);
  border: solid 1px var(--dark-green);
}


/* Header =======================================*/
header {
  background: #2D4A22;
  padding: 6rem 0 14rem;
  text-align: center;
}

/* Balance =======================================*/
#balance {
  margin-top: -8rem;
}

/* Card =======================================*/
.card {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: .25rem;

  margin-bottom: 2rem;

  color: var(--dark-color);
}

.card h3 {
  font-weight: 500;
  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(--light-green);
  color: #fff;
}
#transactions {
  display: block;
  width: 100%;

  overflow-x: auto;
}

/* table =======================================*/
table {
  width: 100%;
  border-spacing: 0 .5rem;
  color: #969cb3;
}

table th:first-child, 
table td:first-child {
  border-radius: .25rem 0 0 .25rem;
}
table th:last-child, 
table td:last-child {
  border-radius: 0 .25rem .25rem 0;
}

table th {
  background: #fff;
  font-weight: 500;
  padding: 1rem 2rem;

  text-align: left;
}

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

table tr {
  opacity: 0.7;
}
table tr:hover {
  opacity: 1;
}

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

td.income {
  color: #12a454;
}

td.expense {
  color: #e92929;
}
/* Modal =======================================*/
.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: 1000;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  max-width: 500px;
  width: 90%;
  background: #f0f2f5;
  padding: 2em;
  border-radius: .25rem;
}
.modal h2 {
  margin-bottom: 1rem;
}
/* Form =======================================*/

input {
  padding: .8rem;
  border: none;
  border-radius: .25rem;

}

.input-group {
  width: 100%;
  display: flex;
  justify-content: stretch;
  flex-direction: column;

  margin-bottom: .8rem;
}

.input-group small {
  opacity: .4 ;
}

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

.input-group.actions .button,
.input-group.actions button {
  width: 48%;
  padding: 1rem 0;
  border-radius: .25rem;
  cursor: pointer;
}

/* Footer =======================================*/
footer {
  text-align: center;
  line-height: 1.5rem;
  font-size: .9rem;
  padding: 4rem 0 2em;
  color: var(--dark-color);

  opacity: .6;
}

@media (min-width: 800px) {
  html {
    font-size: 87.75%;
  }

  #balance {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}