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

body {
  font-family: 'Segoe UI', 'Microsoft JhengHei', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.main-content {
  padding: 40px 30px;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
}

.progress-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 40px;
}

.progress-bar-large {
  background: #e0e0e0;
  border-radius: 15px;
  height: 25px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 15px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.money-input-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.input-group {
  display: flex;
  gap: 10px;
}

.money-field {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.money-field:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(86, 171, 47, 0.3);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-edit {
  background: #3182ce;
  color: white;
}

.btn-edit:hover {
  background: #2c5aa0;
}

.btn-delete {
  background: #e53e3e;
  color: white;
}

.btn-delete:hover {
  background: #c53030;
}

.btn-reorder {
  background: #6a5acd;
  color: white;
}

.btn-toggle-complete {
  background: #a0aec0;
  color: white;
}

.btn-toggle-complete:hover {
  background: #718096;
}

.btn-toggle-complete.completed {
  background: #48bb78;
  color: white;
}

.btn-toggle-complete.completed:hover {
  background: #38a169;
}

.btn-toggle-complete {
  background: #48bb78;
  color: white;
}

.btn-toggle-complete:hover {
  background: #38a169;
}

.btn-toggle-complete.uncompleted {
  background: #a0aec0;
}

.btn-toggle-complete.uncompleted:hover {
  background: #718096;
}

.section-title {
  font-size: 1.8rem;
  color: #2d3748;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #667eea;
}

.product-add-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 40px;
}

.product-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: flex-end;
}

.product-form input {
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  min-width: 0;
}

.product-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.components-grid {
  display: grid;
  gap: 20px;
}

.component-item {
  background: white;
  border: 2px solid #f0f0f0;
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s ease;
  position: relative;
}

.component-item:hover {
  border-color: #667eea;
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.15);
  transform: translateY(-3px);
}

.component-item.completed {
  background: linear-gradient(135deg, #f0fdf4 0%, #f0fdf4 100%);
  border-color: #48bb78;
}

.component-item.completed::before {
  content: '✓';
  position: absolute;
  top: 15px;
  right: 15px;
  background: #48bb78;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.component-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 15px;
}

.component-name {
  flex: 1;
}

.component-name a {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d3748;
  text-decoration: none;
  transition: color 0.3s ease;
}

.component-name a:hover {
  color: #667eea;
}

.component-name span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d3748;
}

.component-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.component-type {
  background: #667eea;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.component-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e53e3e;
}

.component-qty {
  color: #718096;
  font-size: 0.95rem;
}

.progress-bar-container {
  background: #e2e8f0;
  border-radius: 12px;
  height: 20px;
  margin-bottom: 15px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  transition: width 0.5s ease;
}

.progress-bar.completed {
  background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #4a5568;
}

.component-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 40px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.modal-actions button {
  flex: 1;
}

.btn-cancel {
  background: #cbd5e0;
  color: #2d3748;
}

.btn-cancel:hover {
  background: #a0aec0;
}

@media (max-width: 768px) {
  .money-input-section {
    grid-template-columns: 1fr;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .product-form {
    grid-template-columns: 1fr;
  }

  .product-form input,
  .product-form button {
    width: 100%;
  }

  .stat-card {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .main-content {
    padding: 20px 15px;
  }

  .progress-section {
    padding: 20px 15px;
  }

  .product-add-section {
    padding: 20px 15px;
  }
}