* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

.auth-box {
  max-width: 380px;
  margin: 80px auto;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.auth-box h1 { font-size: 1.3rem; margin-top: 0; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; margin-bottom: 14px; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
label.checkbox { flex-direction: row; align-items: center; }
label.checkbox input { width: auto; }

.btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.error { color: #dc2626; font-size: 0.85rem; }
.success { color: #16a34a; font-size: 0.85rem; }

.app { max-width: 1000px; margin: 0 auto; padding: 24px; }
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.tab-btn.active { background: #2563eb; color: #fff; }

.tab-panel { display: none; background: #fff; padding: 20px; border-radius: 12px; }
.tab-panel.active { display: block; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; }
.table button { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 0.85rem; }
.table button.danger { color: #dc2626; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.form-grid .btn { grid-column: 1 / -1; justify-self: start; }

dialog {
  border: none;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
}
dialog::backdrop { background: rgba(15, 23, 42, 0.5); }
.dialog-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

.logo-section { grid-column: 1 / -1; }
.logo-preview {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  background: #e2e8f0;
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #94a3b8;
  font-size: 0.8rem;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

.image-section { grid-column: 1 / -1; }
.image-section h3 { margin: 0 0 8px; font-size: 1rem; }
.images-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.images-grid .thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}
.images-grid .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.images-grid .thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
}
.hint { color: #64748b; font-size: 0.85rem; }
