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

body{
  font-family: Arial, Helvetica, sans-serif;
  background:#f5f5f5;
  padding:30px;
  color:#222;
}

.container{
  max-width:1200px;
  margin:auto;
}

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

.logo{
  font-size:22px;
  font-weight:bold;
}

.btn-add{
  background:#0d1025;
  color:#fff;
  border:none;
  padding:12px 18px;
  border-radius:8px;
  cursor:pointer;
  font-weight:bold;
}

.btn-add:hover{
  opacity:.9;
}

.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:15px;
  margin-bottom:20px;
}

.stat-card{
  background:#fff;
  padding:18px;
  border-radius:10px;
  border:1px solid #e8e8e8;
}

.stat-card h2{
  font-size:28px;
  margin-bottom:5px;
}

.stat-card p{
  color:#777;
  font-size:14px;
}

.filters{
  display:flex;
  gap:10px;
  margin-bottom:25px;
}

.filters input,
.filters select{
  padding:12px;
  border:1px solid #ddd;
  border-radius:8px;
}

.filters input{
  flex:1;
}

.books-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:20px;
}

.book-card{
  background:#fff;
  border-radius:10px;
  border:1px solid #e6e6e6;
  padding:15px;
}

.book-card img{
  width:100%;
  height:260px;
  object-fit:contain;
  background:white;
  border:1px solid #eee;
  padding:8px;
  border-radius:10px;
}

.book-card h3{
  font-size:16px;
  margin-bottom:6px;
}

.book-card .author{
  color:#666;
  font-size:14px;
  margin-bottom:8px;
}

.book-card .status{
  display:inline-block;
  padding:5px 10px;
  border-radius:20px;
  font-size:12px;
  margin-bottom:10px;
  background:#eee;
}

.book-card .stars{
  color:#f5b301;
  margin-bottom:10px;
}

.book-card .comment{
  font-size:13px;
  color:#555;
  margin-bottom:12px;
}

.actions{
  display:flex;
  gap:8px;
}

.actions button{
  flex:1;
  padding:8px;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-size:13px;
}

.edit{
  background:#ececec;
}

.delete{
  background:#ffebeb;
  color:#c60000;
}

.empty{
  grid-column:1/-1;
  text-align:center;
  color:#888;
  padding:50px 0;
}

@media(max-width:768px){

  body{
    padding:15px;
  }

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

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

  .filters{
    flex-direction:column;
  }

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

}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  display:none;
  justify-content:center;
  align-items:center;
  padding:20px;
  z-index:999;
}

.modal.show{
  display:flex;
}

.modal-box{
  background:#fff;
  width:100%;
  max-width:500px;
  border-radius:14px;
  padding:25px;
}

.modal-box h2{
  margin-bottom:15px;
}

#formLivro{
  display:flex;
  flex-direction:column;
  gap:12px;
}

#formLivro input,
#formLivro select,
#formLivro textarea{
  padding:12px;
  border:1px solid #ddd;
  border-radius:8px;
}

#formLivro textarea{
  min-height:100px;
  resize:none;
}

.modal-actions{
  display:flex;
  gap:10px;
}

.modal-actions button{
  flex:1;
  padding:12px;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

.modal-actions button:first-child{
  background:#ececec;
}

.modal-actions button:last-child{
  background:#0d1025;
  color:#fff;
}

@media(max-width:768px){

  .modal-box{
    padding:18px;
  }

  .modal-actions{
    flex-direction:column;
  }

}