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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

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

.header {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.logo i {
  font-size: 2.5rem;
  color: #667eea;
}

.logo h1 {
  color: #333;
  font-size: 2rem;
  font-weight: 700;
}

.nav-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: #667eea;
  color: white;
}

.tab-btn:hover:not(.active) {
  background: #f8f9ff;
  color: #667eea;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card h2 {
  color: #333;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h2 i {
  color: #667eea;
}

.import-section {
  margin-bottom: 30px;
}

#stockInput {
  width: 100%;
  height: 200px;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 15px;
  transition: border-color 0.3s ease;
}

#stockInput:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #edf2f7;
}

.btn-success {
  background: #38a169;
  color: white;
}

.btn-success:hover {
  background: #2f855a;
  transform: translateY(-2px);
}

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filters select,
.filters input {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: #667eea;
}

.table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

th {
  background: #f8f9ff;
  font-weight: 600;
  color: #4a5568;
}

tr:hover {
  background: #f8f9ff;
}

.results {
  margin-top: 20px;
}

.result-item {
  padding: 10px 15px;
  margin: 5px 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-success {
  background: #f0fff4;
  color: #22543d;
  border-left: 4px solid #38a169;
}

.result-error {
  background: #fff5f5;
  color: #742a2a;
  border-left: 4px solid #e53e3e;
}

.label-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.labels-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.label {
  border: 2px solid #333;
  padding: 15px;
  background: white;
  border-radius: 8px;
  font-family: Arial, sans-serif;
}

.label-header {
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  color: #667eea;
}

.label-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.label-info div {
  display: flex;
  justify-content: space-between;
}

.label-barcode {
  text-align: center;
  margin-top: 10px;
}

.label-barcode svg {
  max-width: 100%;
  height: 40px;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.selected-products {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.product-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.product-checkbox:last-child {
  border-bottom: none;
}

.pdf-success {
  text-align: center;
  padding: 30px;
  background: #f0fff4;
  border: 2px solid #38a169;
  border-radius: 10px;
  margin: 20px 0;
}

.pdf-success i {
  font-size: 3rem;
  color: #38a169;
  margin-bottom: 15px;
}

.pdf-success h3 {
  color: #22543d;
  margin-bottom: 10px;
}

.pdf-success p {
  color: #2d3748;
  margin-bottom: 20px;
}

@media print {
  body * {
    visibility: hidden;
  }

  .labels-preview,
  .labels-preview * {
    visibility: visible;
  }

  .labels-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .label {
    page-break-inside: avoid;
    margin-bottom: 10px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .nav-tabs {
    flex-wrap: wrap;
  }

  .filters {
    flex-direction: column;
  }

  .filters select,
  .filters input {
    width: 100%;
  }

  .labels-preview {
    grid-template-columns: 1fr;
  }
}
