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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  min-height: 100vh;
}

/* Header */
.header {
  background: #4f46e5;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-left { flex: 1; }
.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.9;
}
.btn-logout {
  color: white;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 0.375rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.25); }
.header h1 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.header p {
  font-size: 0.8125rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}

/* Layout */
.container {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  padding: 2rem;
}

/* Section titles */
.section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}
.section-title:not(:first-child) {
  margin-top: 1.75rem;
}

/* Form elements */
.form-group {
  margin-bottom: 1.125rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
label .req {
  color: #ef4444;
  margin-left: 2px;
}
.field-hint {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1f2937;
  background: white;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2.25rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

/* Price field */
.price-wrap {
  position: relative;
}
.price-wrap input {
  padding-left: 2rem;
}
.price-symbol {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
  font-size: 0.9375rem;
}

/* Two-column grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 1.25rem; }
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: #4f46e5;
  background: #f5f3ff;
}
.upload-icon { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.upload-link {
  background: none;
  border: none;
  color: #4f46e5;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100px;
}
.preview-item img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}
.preview-name {
  font-size: 0.7rem;
  color: #6b7280;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}
.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Submit button */
.btn-submit {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.8125rem 1.5rem;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-submit:hover:not(:disabled) { background: #4338ca; }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alert */
.alert {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  display: none;
}
.alert.show { display: block; }
.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert strong { display: block; margin-bottom: 0.2rem; }

/* Another BA button */
.btn-new {
  margin-top: 0.875rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  color: #4f46e5;
  border: 1.5px solid #4f46e5;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  display: none;
}
.btn-new:hover { background: #ede9fe; }
.btn-new.show { display: inline-block; }
