* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f6f9;
  color: #333;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

header {
  background: linear-gradient(135deg, #1a5276, #2e86c1);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 1.5rem; }

nav { display: flex; gap: 10px; }

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #2ecc71; color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-sm { padding: 5px 12px; font-size: 0.85rem; }

main { padding: 30px 0; }

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.search-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.select {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.product-card:hover { transform: translateY(-3px); }

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #ecf0f1;
}

.product-card .no-image {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ecf0f1;
  font-size: 3rem;
}

.product-info { padding: 15px; }
.product-info h3 { font-size: 1.1rem; margin-bottom: 5px; }
.product-info .price { color: #2ecc71; font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; }
.product-info .category { color: #7f8c8d; font-size: 0.85rem; margin-bottom: 8px; }
.product-info .stock { font-size: 0.85rem; color: #34495e; }
.product-info .description { font-size: 0.9rem; color: #555; margin-bottom: 10px; }

.product-actions {
  display: flex;
  gap: 8px;
  padding: 0 15px 15px;
}

.loading { text-align: center; padding: 40px; color: #7f8c8d; font-size: 1.1rem; }

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 { margin-bottom: 20px; }

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-content label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 8px;
}

.modal-content input,
.modal-content textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .product-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  header .container { flex-direction: column; gap: 10px; }
}
