/* ============================================================
   ON SPOT HUB LLC — Admin Panel Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

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

:root {
  --navy:    #0A1628;
  --navy-2:  #0F2040;
  --gold:    #C9A84C;
  --gold-l:  #E8C96A;
  --gold-p:  #F5E9C8;
  --sidebar: #070f1e;
  --card:    #111d30;
  --border:  rgba(255,255,255,.08);
  --text:    rgba(255,255,255,.88);
  --muted:   rgba(255,255,255,.45);
  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --radius:  12px;
  --radius-sm: 8px;
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--navy); color: var(--text); -webkit-font-smoothing: antialiased; }

/* ── Layout ── */
.admin-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-hex {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.brand-text strong {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
}
.brand-text span { font-size: .72rem; color: var(--gold); letter-spacing: .5px; }

.sidebar-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 20px 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--gold); border-left-color: var(--gold); background: rgba(201,168,76,.07); }
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .8rem;
  text-decoration: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-footer a:hover { color: var(--text); background: rgba(255,255,255,.04); }

/* ── Main Content ── */
.admin-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ── */
.admin-topbar {
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 1rem; font-weight: 600; color: #fff; }
.topbar-subtitle { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.status-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50% { opacity:.7; transform:scale(.85); box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ── Content Area ── */
.admin-content { padding: 32px; flex: 1; }

/* ── Tabs ── */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Section Card ── */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.section-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .95rem;
  color: #fff;
}
.section-card-title .icon {
  width: 34px; height: 34px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.section-card-body { padding: 24px; }

/* ── Form Controls ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

.field { margin-bottom: 0; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  transition: var(--transition);
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,.05);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255,255,255,.2); }
.field textarea { resize: vertical; min-height: 90px; }
.field select option { background: var(--navy-2); color: var(--text); }

.field-hint { font-size: .75rem; color: var(--muted); margin-top: 5px; }

/* Toggle switch */
.toggle-field { display: flex; align-items: center; justify-content: space-between; }
.toggle-label { font-size: .9rem; color: var(--text); }
.toggle-label span { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  transition: var(--transition);
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: var(--gold); }
.toggle-switch input:checked + .toggle-track::after { left: 23px; }

/* ── Buttons ── */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: .2px;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-l)); color: var(--navy); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,.4); }
.btn-outline-gold { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline-gold:hover { background: rgba(201,168,76,.1); }
.btn-danger { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-ghost { background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.08); }
.btn-sm-admin { padding: 7px 14px; font-size: .8rem; }

.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(201,168,76,.06);
  border-top: 1px solid rgba(201,168,76,.15);
}
.save-hint { font-size: .8rem; color: var(--muted); }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-box .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.stat-box .value { font-size: 1.6rem; font-weight: 700; color: var(--gold); font-family: 'Playfair Display', serif; }
.stat-box .sub { font-size: .78rem; color: rgba(34,197,94,.9); margin-top: 4px; }

/* ── Trust Bar Items ── */
.trust-items-grid { display: grid; gap: 12px; }
.trust-item-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.trust-item-row input { padding: 6px 10px; }
.trust-remove { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 4px; transition: var(--transition); }
.trust-remove:hover { background: rgba(239,68,68,.1); }

/* ── Typed words ── */
.typed-words-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.typed-word-tag {
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.25);
  color: var(--gold);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.typed-word-tag button { background: none; border: none; color: var(--gold); cursor: pointer; font-size: .85rem; line-height: 1; }

/* ── Toast notification ── */
#admin-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--success);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}
#admin-toast.show { transform: translateY(0); opacity: 1; }
#admin-toast.error { background: var(--danger); }

/* ── Preview link ── */
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(201,168,76,.2);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: rgba(201,168,76,.07);
}
.preview-btn:hover { background: rgba(201,168,76,.15); }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 800px 600px at 50% 30%, rgba(201,168,76,.08) 0%, transparent 60%), var(--navy);
  position: relative;
  overflow: hidden;
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(201,168,76,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(201,168,76,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.login-box {
  background: var(--card);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 2;
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; justify-content: center; }
.login-logo .brand-hex { width: 48px; height: 48px; font-size: 14px; }
.login-logo .brand-text strong { font-size: 1.1rem; }
.login-title { font-size: 1.4rem; font-weight: 700; color: #fff; text-align: center; margin-bottom: 6px; }
.login-subtitle { font-size: .875rem; color: var(--muted); text-align: center; margin-bottom: 32px; }

.login-field { margin-bottom: 20px; }
.login-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.login-field input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.login-field input:focus { border-color: var(--gold); background: rgba(201,168,76,.05); box-shadow: 0 0 0 3px rgba(201,168,76,.12); }
.login-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  margin-top: 8px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,.45); }
.login-error { color: var(--danger); font-size: .82rem; text-align: center; margin-top: 12px; display: none; }
.login-back { display: flex; align-items: center; justify-content: center; margin-top: 24px; }
.login-back a { color: var(--muted); font-size: .82rem; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.login-back a:hover { color: var(--text); }

/* ── Password Change ── */
.security-notice { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); border-radius: var(--radius-sm); padding: 12px 16px; font-size: .82rem; color: #fbbf24; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}
