/* ===========================================================
   admin.css — styles for the no-code admin panel
   =========================================================== */
:root {
  --accent: #6366f1; --accent2: #ec4899;
  --bg: #0b0f1a; --surface: #131829; --surface2: #1b2238;
  --text: #e6e9f0; --muted: #9aa3b2; --border: rgba(255,255,255,.08);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid transparent; font-family: inherit; transition: transform .15s, background .2s, border-color .2s; }
.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { background: var(--surface2); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--text { background: none; color: var(--muted); }
.btn--text:hover { color: var(--text); }
.btn--danger { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); padding: 7px 12px; font-size: .82rem; }
.btn--danger:hover { background: rgba(239,68,68,.25); }
.btn--sm { padding: 8px 14px; font-size: .85rem; }
.full { width: 100%; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 20%, rgba(99,102,241,.25), transparent 40%), radial-gradient(circle at 80% 80%, rgba(236,72,153,.2), transparent 40%); }
.login__card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.login__logo { font-size: 3rem; margin-bottom: 10px; }
.login__card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.login__card p { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.login__card input { width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 1rem; margin-bottom: 14px; }
.login__card input:focus { outline: none; border-color: var(--accent); }
.login__hint { font-size: .82rem !important; margin-top: 16px !important; opacity: .8; }

/* Layout */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { font-weight: 800; font-size: 1.3rem; padding: 6px 12px 18px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.sidebar__nav button { text-align: left; background: none; border: 0; color: var(--muted); padding: 11px 14px; border-radius: 10px; font-size: .92rem; font-weight: 500; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.sidebar__nav button:hover { background: var(--surface2); color: var(--text); }
.sidebar__nav button.active { background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; }
.sidebar__foot { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 32px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); z-index: 10; }
.topbar h2 { font-size: 1.4rem; }
.topbar__actions { display: flex; align-items: center; gap: 14px; }
.muted { color: var(--muted); font-size: .9rem; }
.save-status { font-size: .85rem; color: #22c55e; }

.panel { padding: 28px 32px 80px; max-width: 880px; }

/* Form cards & fields */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.card__head h3 { font-size: 1.05rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field input[type="number"], .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: .95rem; transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }

/* Color row */
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] { width: 46px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: none; cursor: pointer; }
.color-row input[type="text"] { flex: 1; }

/* Range */
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-val { width: 52px; text-align: right; font-weight: 700; }

/* Repeatable item */
.item { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.item__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.item__head strong { font-size: .9rem; color: var(--muted); }
.add-row { display: flex; gap: 10px; margin-top: 6px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { width: 42px; height: 24px; appearance: none; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked::after { transform: translateX(18px); }

/* Data/publish boxes */
.note-box { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 16px; margin-bottom: 16px; font-size: .92rem; line-height: 1.6; }
.note-box b { color: var(--text); }
.code-inline { background: var(--bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-family: monospace; font-size: .85rem; }

/* Toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 13px 22px; border-radius: 12px; box-shadow: 0 20px 40px -15px rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(34,197,94,.4); }
.toast.err { border-color: rgba(239,68,68,.4); }

/* Responsive admin */
@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar__brand { width: 100%; padding-bottom: 10px; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar__nav button { padding: 8px 12px; font-size: .85rem; }
  .sidebar__foot { flex-direction: row; width: 100%; border-top: 0; padding-top: 8px; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar { padding: 16px; flex-wrap: wrap; }
  .panel { padding: 18px 16px 80px; }
}
