*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #1b2430;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3fb 100%);
  min-height: 100vh;
}

button {
  cursor: pointer;
  font: inherit;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  transition: background .15s;
}
button:hover { background: #1d4ed8; }
button.secondary { background: #e5e7eb; color: #1b2430; }
button.secondary:hover { background: #d1d5db; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #2563eb33; border-color: #2563eb; }

.producer-link {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 14px;
  color: #2563eb;
  text-decoration: none;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.producer-link:hover { background: #f1f5f9; }

/* Home */
.home {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  text-align: center;
}
.logo { margin-bottom: 40px; }
.logo-mark {
  width: 260px; height: 260px;
  margin: 0 auto 16px;
  object-fit: contain;
  display: block;
}
.logo h1 { margin: 0; font-size: 32px; letter-spacing: -.5px; }
.tagline { color: #5b6876; margin: 8px 0 0; }

.check-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 15px;
}
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; font-size: 18px; letter-spacing: 1px; }
.input-row button { flex: 0 0 auto; padding: 10px 20px; }

.result {
  margin-top: 28px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  text-align: left;
}
.result.ok { border-left: 4px solid #10b981; }
.result.bad { border-left: 4px solid #dc2626; }
.result.warn { border-left: 4px solid #f59e0b; }
.result h3 { margin: 0 0 10px; }
.result .product { display: flex; gap: 16px; align-items: flex-start; }
.result .product img {
  width: 96px; height: 96px;
  object-fit: cover; border-radius: 8px; background: #f1f5f9;
}
.result dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.result dt { color: #64748b; font-size: 14px; }
.result dd { margin: 0; font-weight: 500; }

/* Producer */
.producer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 20px 40px;
}
.login-box {
  max-width: 380px;
  margin: 60px auto;
  background: #fff;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.login-box h2 { margin: 0 0 20px; text-align: center; }
.login-box label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.login-box input { margin-top: 6px; }
.login-box button { width: 100%; margin-top: 8px; }
.error { color: #dc2626; font-size: 14px; margin: 10px 0 0; }
.success {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin: 0 0 14px;
}

.auth-tabs { margin-bottom: 18px; }
.auth-tabs .tab { flex: 1; width: auto; margin-top: 0; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-ok { background: #d1fae5; color: #047857; }
.badge-warn { background: #fee2e2; color: #b91c1c; }

.producer-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 12px 14px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
}

.hint { color: #64748b; font-size: 12px; font-weight: 400; display: block; margin-top: 4px; }
.image-preview {
  margin-bottom: 12px;
  padding: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
}
.image-preview img { max-width: 100%; max-height: 160px; border-radius: 6px; }

.table-footer { display: flex; justify-content: center; margin-top: 12px; }

.producer-card {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.producer-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #475569;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.producer-body { display: flex; gap: 14px; align-items: flex-start; }
.producer-logo {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.producer-name { font-weight: 600; margin-bottom: 4px; }
.producer-desc { margin: 0; color: #475569; font-size: 14px; line-height: 1.5; }

.desc-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.dash-header h2 { margin: 0; }
.dash-actions { display: flex; gap: 8px; }

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  margin-bottom: 24px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.panel-head h3 { margin: 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
.tab {
  background: transparent; color: #64748b; padding: 8px 16px;
  border-radius: 0; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tab:hover { background: transparent; color: #1b2430; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.data-table th { font-size: 13px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.data-table .empty { text-align: center; color: #94a3b8; padding: 24px 10px; }
.data-table .thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: #f1f5f9; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button { padding: 6px 10px; font-size: 13px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  display: grid; place-items: center;
  z-index: 10;
  padding: 20px;
}
[hidden] { display: none !important; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-box h3 { margin: 0 0 16px; }
.modal-box label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.modal-box label input, .modal-box label select, .modal-box label textarea { margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Mobile: keep input above the virtual keyboard */
@media (max-width: 600px) {
  .home { padding: 24px 16px 40px; }
  .logo { margin-bottom: 20px; }
  .logo-mark { width: 160px; height: 160px; margin-bottom: 8px; }
  .logo h1 { font-size: 26px; }
  .check-form input { scroll-margin-top: 16px; scroll-margin-bottom: 16px; }
}
