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

body {
  font-family: 'Outfit', sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

.admin-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 100px;
}

/* ---------- Login screen ---------- */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(30, 41, 59, 0.08);
  border: 1px solid #e2e8f0;
}

.login-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  margin-bottom: 6px;
}

.login-card p {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 24px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  font-family: inherit;
}

.login-card input:focus {
  outline: none;
  border-color: #6366f1;
}

.login-card button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.login-card button:hover { background: #4f46e5; }
.login-card button:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
}
.back-link:hover { color: #6366f1; }

/* ---------- Editor ---------- */
#editorScreen { display: none; }

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar h1 {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
}

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #f1f5f9; color: #1e293b; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #ef4444; }
.btn-danger:hover { background: #fee2e2; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

#saveStatus {
  font-size: 13px;
  color: #22c55e;
  margin-right: 6px;
  display: none;
}

.admin-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
}

.admin-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  margin-bottom: 4px;
}

.admin-section .hint {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 18px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
}
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.repeat-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  background: #fafbfc;
}

.repeat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.repeat-item-header span { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tag-chip {
  display: flex; align-items: center; gap: 6px;
  background: #eef2ff; color: #4338ca;
  padding: 5px 10px; border-radius: 999px; font-size: 13px;
}
.tag-chip button {
  background: none; border: none; color: #4338ca; cursor: pointer; font-size: 14px; line-height: 1;
}
.tag-chip.hot { background: #6366f1; color: #fff; }
.tag-chip.hot button { color: #fff; }

.mini-add {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.mini-add input { flex: 1; }

.add-row-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  background: transparent;
  color: #6366f1;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.add-row-btn:hover { background: #f5f5ff; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
  display: none;
}
.toast.error { background: #ef4444; }
