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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.version {
  font-size: 0.75rem;
  font-weight: 400;
  color: #9ca3af;
  vertical-align: super;
}

.action-buttons {
  width: 100%;
  max-width: 400px;
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.upload-area {
  flex: 1;
  background: #fff;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #2563eb;
}

.upload-area label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: #6b7280;
}

.upload-area label .icon {
  display: block;
  margin-bottom: 0.5rem;
  color: #9ca3af;
}

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

.spinner {
  display: none;
  margin: 2rem auto;
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.active {
  display: block;
}

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

.result-card {
  display: none;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-card.active {
  display: block;
}

.result-card .field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.result-card .field:last-child {
  border-bottom: none;
}

.result-card .field .label {
  font-size: 0.85rem;
  color: #6b7280;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.result-card .field .value {
  font-weight: 500;
  text-align: right;
}

.result-card select,
.result-card input {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  text-align: right;
  max-width: 200px;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-manual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
  transition: border-color 0.2s;
  font-weight: 400;
}

.btn-manual:hover {
  border-color: #2563eb;
}

.btn-manual svg {
  color: #9ca3af;
}

.btn-undo {
  background: #fee2e2;
  color: #dc2626;
}

.btn-new {
  background: #dbeafe;
  color: #2563eb;
}

.btn-cancel {
  background: #f3f4f6;
  color: #6b7280;
}

.btn-save {
  background: #059669;
  color: #fff;
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  display: none;
  color: #dc2626;
  background: #fee2e2;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.error-msg.active {
  display: block;
}

.success-badge {
  display: none;
  color: #059669;
  background: #d1fae5;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  font-size: 0.9rem;
}

.success-badge.active {
  display: block;
}

.provider-bar {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-content: flex-end;
}

.provider-bar label {
  font-size: 0.85rem;
  color: #6b7280;
}

.provider-bar select {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.login-screen {
  width: 100%;
  max-width: 400px;
  margin-top: 2rem;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-card label {
  display: block;
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.login-card input {
  width: 100%;
  font-size: 1.5rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-align: center;
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
}

.btn-login {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 500;
  background: #2563eb;
  color: #fff;
}

.login-card .error-msg {
  margin-top: 0.75rem;
  width: 100%;
}

.field-secondary .value {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 400;
}

.qr-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  text-align: center;
  margin-top: 0.5rem;
}

.qr-ok {
  color: #059669;
  background: #d1fae5;
}

.qr-warn {
  color: #d97706;
  background: #fef3c7;
}
