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

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  color: #1A1A1A;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  background: white;
}

.header {
  background: #000000;
  color: white;
  padding: 20px;
  text-align: center;
}

.header img {
  max-width: 200px;
  height: auto;
  margin-bottom: 10px;
  background: white;
  padding: 12px;
  border-radius: 8px;
}

.header h1 {
  font-size: 24px;
  margin: 10px 0 5px 0;
}

.header p {
  font-size: 14px;
  opacity: 0.9;
}

.card {
  background: white;
  padding: 20px;
  margin: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
  color: #1F4E79;
  font-size: 18px;
  margin-bottom: 15px;
}

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

label {
  display: block;
  color: #2E75B6;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-input, input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-input:focus, input[type="text"]:focus {
  outline: none;
  border-color: #E8473F;
}

.vendor-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid #ddd;
  border-radius: 4px;
}

.vendor-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.vendor-item:hover {
  background: #f8f8f8;
}

.vendor-item.selected {
  background: #E8473F;
  color: white;
}

.vendor-item.selected .vendor-name {
  color: white;
}

.vendor-item.selected .vendor-email {
  color: rgba(255,255,255,0.9);
}

.vendor-name {
  font-weight: bold;
  font-size: 16px;
  color: #1F4E79;
  margin-bottom: 4px;
}

.vendor-email {
  font-size: 13px;
  color: #666;
}

.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

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

.btn-primary:hover {
  background: #d63b31;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-success:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #E8473F;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px auto;
}

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

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.status-badge.active {
  background: #28a745;
  color: white;
}

.counter {
  background: #2E75B6;
  color: white;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 20px;
}

.counter-number {
  font-size: 48px;
  font-weight: bold;
  display: block;
}

.counter-label {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.scan-section h3 {
  color: #1F4E79;
  font-size: 16px;
  margin-bottom: 10px;
}

#html5-qrcode-button-camera-stop {
  background: #dc3545 !important;
}

.item-list {
  max-height: 400px;
  overflow-y: auto;
}

.item-card {
  background: #f8f8f8;
  border-left: 4px solid #2E75B6;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: bold;
  color: #1F4E79;
  margin-bottom: 4px;
}

.item-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.item-badge.products {
  background: #ffffff;
  color: #1F4E79;
  border: 1px solid #2E75B6;
}

.item-badge.vendor {
  background: #f59e0b;
  color: white;
}

.item-badge.unknown {
  background: #ef4444;
  color: white;
}

.item-details {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

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

.item-qty {
  background: #2E75B6;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 16px;
}

.item-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s;
}

.item-btn:hover {
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
  }
  
  .card {
    margin: 10px;
  }
}

/* Source badges (shared by scanner + signature; markup from utils.js sourceBadgeHtml) */
.badge-po { display: inline-block; background: #f59e0b; color: white; font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: normal; margin-left: 6px; }
.badge-unknown { display: inline-block; background: #ef4444; color: white; font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: normal; margin-left: 6px; }
