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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
}

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

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  color: #16213e;
}

header p {
  color: #555;
  margin-top: 0.5rem;
}

.upload-section {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.upload-slots {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.upload-box {
  width: 100%;
}

.upload-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.upload-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.upload-label input[type="file"] {
  display: none;
}

.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #0f3460;
  background: #e8f0fe;
}

.drop-zone.has-file {
  border-color: #4caf50;
  background: #e8f5e9;
}

.drop-text {
  color: #666;
  font-size: 0.85rem;
}

.file-name {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #4caf50;
}

.btn-remove {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: #ffebee;
  border-color: #e53935;
  color: #e53935;
}

.upload-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 2rem;
  background: #0f3460;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: #16213e;
}

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

.btn-secondary {
  padding: 0.6rem 1.5rem;
  background: #fff;
  color: #0f3460;
  border: 2px dashed #0f3460;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

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

.hidden {
  display: none !important;
}

#loading {
  text-align: center;
  margin: 2rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top-color: #0f3460;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#results {
  margin-top: 2rem;
}

.summary-bar {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 0.95rem;
}

.summary-bar small {
  display: block;
  margin-top: 0.3rem;
  color: #666;
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.tab.active {
  background: #0f3460;
  color: #fff;
}

.tab-content {
  display: none;
}

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

.items-table-wrapper {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow-x: auto;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.items-table th, .items-table td {
  border: 1px solid #ddd;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.items-table th {
  background: #0f3460;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.items-table tbody tr:hover {
  opacity: 0.9;
}

.row-match { background: #f1f8e9; }
.row-name-diff { background: #fff8e1; }
.row-only-some { background: #fff3e0; }
.row-only-a { background: #ffebee; }
.row-only-b { background: #fff3e0; }
.cell-name-diff { background: #fff3cd; }

.ia-container {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ia-container h3 {
  color: #0f3460;
  margin-bottom: 0.75rem;
}

.ia-section {
  margin-bottom: 1.25rem;
}

.ia-section h4 {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ia-section p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.ia-section ul {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.95rem;
}

.ia-section li {
  margin-bottom: 0.3rem;
}

.export-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-export {
  padding: 0.4rem 1rem;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: #fff;
  color: #0f3460;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-export:hover {
  background: #0f3460;
  color: #fff;
}

.ia-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ia-badge.high { color: #e53935; }
.ia-badge.medium { color: #fb8c00; }
.ia-badge.low { color: #43a047; }
