/* GLOBAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  display: flex;
  background: #f4f6f9;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ------------------------------------
   SIDEBAR
------------------------------------ */
.sidebar {
  width: 250px;
  background: #1e1e2f;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  padding-top: 25px;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease-in-out;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 35px;
  font-size: 1.4rem;
  font-weight: 600;
}

.sidebar a {
  padding: 14px 30px;
  font-size: 0.95rem;
  color: #e6e6e6;
  text-decoration: none;
  display: block;
}

.sidebar a:hover {
  background: #34344d;
  color: white;
  transition: 0.2s;
}

/* ------------------------------------
   MAIN CONTENT
------------------------------------ */
.main {
  margin-left: 250px;
  padding: 30px;
  width: calc(100% - 250px);
}

/* HEADER */
header {
  background: white;
  padding: 18px 22px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.06);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e1e2f;
}

.menu-toggle {
  display: none;
  font-size: 24px;
  background: #1e1e2f;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
}

/* Add Product Button */
#addproductbtn {
  background: #4e73df;
  padding: 10px 18px;
  color: white;
  font-size: 0.9rem;
  border-radius: 7px;
  text-decoration: none;
}

#addproductbtn:hover {
  background: #3b5cc5;
}

/* ------------------------------------
   PRODUCT TABLE
------------------------------------ */
#productTable {
  margin-top: 25px;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.06);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

#productTable th {
  background: #4e73df;
  color: white;
  padding: 14px;
  font-size: 0.9rem;
}

#productTable td {
  padding: 12px;
  font-size: 0.85rem;
  color: #333;
  border-bottom: 1px solid #eee;
}

#productTable tr:hover {
  background: #f7f9fc;
}

#productTable img {
  width: 55px;
  height: 55px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #ddd;
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
}

.editBtn {
  background: #1cc88a;
  padding: 6px 12px;
  color: white;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.editBtn:hover {
  background: #17a673;
}

.deleteBtn {
  background: #e74a3b;
  padding: 6px 12px;
  color: white;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.deleteBtn:hover {
  background: #c0392b;
}

/* ------------------------------------
   RESPONSIVE
------------------------------------ */
@media(max-width: 900px) {

  .menu-toggle {
    display: block;
  }

  .sidebar {
    left: -250px;
  }

  .sidebar.active {
    left: 0;
  }

  .main {
    margin-left: 0;
    width: 100%;
  }
}

/* Phones 500px */
@media(max-width: 500px) {
  header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  #addproductbtn {
    width: 100%;
    text-align: center;
  }

  #productTable td,
  #productTable th {
    font-size: 12px;
    padding: 9px;
  }

  #productTable img {
    width: 40px;
    height: 40px;
  }

  .actions {
    flex-direction: column;
  }
}

/* VERY SMALL screens 250–300px */
@media(max-width: 300px) {
  header h1 {
    font-size: 1rem;
  }

  #addproductbtn {
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  #productTable td,
  #productTable th {
    font-size: 10px;
    padding: 6px;
  }
}
