﻿/* ============================================
   SNFX Admin â€” My Space Styles
   ============================================ */

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

:root {
  --bg: #0c0c14;
  --bg2: #12121c;
  --bg3: #1a1a28;
  --text: #e2e0dd;
  --muted: #666;
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --danger: #ff4757;
  --border: rgba(108, 99, 255, 0.15);
  --card: rgba(18, 18, 28, 0.9);
  --font: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --glow: 0 0 30px rgba(108, 99, 255, 0.2);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---- LOGIN ---- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(108, 99, 255, 0.05) 0%, var(--bg) 70%);
}

.login-container {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--glow);
}

.login-logo {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-container h1 {
  font-family: var(--font);
  font-size: 24px;
  margin-bottom: 4px;
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 32px;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.input, input[type="text"], input[type="email"], input[type="password"], textarea, select.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color 0.3s;
  outline: none;
}

.input:focus, input:focus, textarea:focus, select.input:focus {
  border-color: var(--accent);
}

.input-color {
  width: 50px;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  cursor: pointer;
}

textarea { resize: vertical; }

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a52d5);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-danger {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 71, 87, 0.25);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.status-msg {
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.status-msg.success { color: var(--accent2); }
.status-msg.error { color: var(--danger); }

/* ---- ADMIN LAYOUT ---- */
#admin-dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-logo {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--bg3);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid var(--border);
}

.sidebar-link .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 0 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---- MAIN CONTENT ---- */
.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 40px;
  max-width: 1000px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel h2 {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.panel-desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

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

/* Sticky header for content editor panel */
.panel-header-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin: -16px 0 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.panel-header-sticky h2 {
  margin: 0;
}

.panel-header-sticky .panel-desc {
  margin: 4px 0 0;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.panel-header-actions .status-msg {
  white-space: nowrap;
}

/* ---- DASHBOARD ---- */
#panel-dashboard {
  position: relative;
  overflow: hidden;
}

.dash-mesh-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

#panel-dashboard > *:not(.dash-mesh-bg) {
  position: relative;
  z-index: 1;
}

/* Glass card base */
.glass-card {
  background: rgba(18, 18, 28, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(108, 99, 255, 0.3);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.12), 0 0 0 1px rgba(108, 99, 255, 0.08);
}

/* Hero */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-hero-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
  animation: fadeSlideIn 0.6s ease;
}

.dash-hero-sub {
  color: var(--muted);
  font-size: 14px;
  animation: fadeSlideIn 0.6s ease 0.1s both;
}

.dash-gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dash-server-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 18, 28, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--muted);
  animation: fadeSlideIn 0.6s ease 0.2s both;
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.dash-dot.pulse {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

.dash-uptime {
  color: var(--text);
  font-weight: 600;
  font-family: var(--font);
}

/* Stat cards grid */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-stat-card {
  position: relative;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  animation: cardEntrance 0.5s ease both;
  transform-style: preserve-3d;
  will-change: transform;
}

.dash-stat-card:nth-child(1) { animation-delay: 0.1s; }
.dash-stat-card:nth-child(2) { animation-delay: 0.2s; }
.dash-stat-card:nth-child(3) { animation-delay: 0.3s; }
.dash-stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dash-stat-spark {
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 0.5;
  pointer-events: none;
}

.dash-stat-ring {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.dash-stat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dash-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 3;
}

.dash-ring-fill {
  fill: none;
  stroke: var(--ring-color, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--ring-color, var(--accent)));
}

.dash-stat-info {
  display: flex;
  flex-direction: column;
}

.dash-stat-number {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.dash-stat-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Charts row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dash-chart-card {
  padding: 24px;
  animation: cardEntrance 0.5s ease 0.5s both;
}

.dash-chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.dash-chart-wrap {
  height: 220px;
  position: relative;
}

/* Resource bars */
.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.dash-bar-value {
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
}

.dash-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  position: relative;
}

.dash-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: barShimmer 2s ease infinite;
}

@keyframes barShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gradient-bar {
  background: linear-gradient(90deg, #6c63ff, #a78bfa);
}

.gradient-bar-alt {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.gradient-bar-green {
  background: linear-gradient(90deg, #4ade80, #00d4aa);
}

/* Server info chips */
.dash-server-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-info-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
}

.dash-info-key {
  color: var(--muted);
}

.dash-info-val {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font);
}

/* Bottom row */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.dash-recent, .dash-quick-actions {
  padding: 24px;
  animation: cardEntrance 0.5s ease 0.7s both;
}

.dash-recent h3, .dash-quick-actions h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.dash-recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  animation: fadeSlideIn 0.4s ease both;
}

.dash-recent-item:hover {
  background: rgba(108, 99, 255, 0.06);
}

.dash-recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-recent-dot.live { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }
.dash-recent-dot.draft { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }

.dash-recent-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-recent-date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.dash-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.dash-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  margin-bottom: 8px;
}

.dash-action-btn:last-child { margin-bottom: 0; }

.dash-action-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
  transform: translateX(4px);
}

.dash-action-icon { font-size: 16px; }

.dash-action-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.25s ease, color 0.25s ease;
}

.dash-action-btn:hover .dash-action-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ---- INFRA PANEL ---- */
.infra-live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.infra-editor-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* ---- INFRA GRID (shared cards) ---- */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.infra-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text);
}

.infra-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.infra-card .infra-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.infra-card .infra-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}

.infra-card .infra-url {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-all;
}

.infra-card.empty {
  border-style: dashed;
  opacity: 0.4;
}

/* ---- QUICK STATS ---- */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.quick-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.qs-number {
  font-family: var(--font);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.qs-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---- CONTENT EDITOR ---- */
.content-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 32px;
}

.content-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.content-block h3 {
  font-family: var(--font);
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--accent);
}

.block-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Social link rows */
.social-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.social-row .btn { padding: 8px 12px; font-size: 12px; }

/* ---- PAGE MANAGER ---- */
.page-manager {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.page-row.page-hidden {
  opacity: 0.4;
}

.page-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-icon {
  font-size: 18px;
}

.page-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.5px;
}

.page-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

.btn-icon:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: var(--muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: white;
}

/* Infra editor rows */
.infra-row {
  display: grid;
  grid-template-columns: 28px 50px 1fr 2fr 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 4px 0;
  transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.infra-row--dragging {
  opacity: 0.4;
}

.infra-row--over {
  box-shadow: 0 -2px 0 0 var(--accent);
}

.infra-drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  user-select: none;
  letter-spacing: -1px;
  transition: color 0.2s;
}

.infra-drag-handle:hover { color: var(--text); }
.infra-drag-handle:active { cursor: grabbing; }

.infra-input-icon {
  text-align: center;
}

.infra-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.infra-remove-btn:hover {
  color: var(--danger);
  background: rgba(255, 71, 87, 0.1);
}

.infra-row input { padding: 10px 12px; font-size: 13px; }

/* ---- BLOG POSTS LIST ---- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.post-item:hover { border-color: var(--accent); }

.post-item-info h4 {
  font-family: var(--font);
  font-size: 15px;
  margin-bottom: 4px;
}

.post-item-info span {
  font-size: 12px;
  color: var(--muted);
}

.post-item-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.post-item-status.published {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent2);
}

.post-item-status.draft {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.post-item-actions {
  display: flex;
  gap: 8px;
}

.post-item-actions button {
  padding: 6px 12px;
  font-size: 12px;
}

/* ---- POST EDITOR ---- */
.post-editor {
  margin-top: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.post-editor h3 {
  font-family: var(--font);
  font-size: 18px;
  margin-bottom: 20px;
}

/* Post editor WYSIWYG - taller with media support */
.post-editor .ql-container {
  min-height: 400px;
}

.post-editor .ql-editor {
  min-height: 380px;
}

.post-editor .ql-editor img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

.post-editor .ql-editor video {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input { width: auto; }

/* ---- QUILL EDITOR ---- */
.ql-toolbar {
  border-color: var(--border) !important;
  border-radius: 8px 8px 0 0;
  background: var(--bg3);
}

.ql-container {
  border-color: var(--border) !important;
  border-radius: 0 0 8px 8px;
  min-height: 200px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

.ql-editor {
  min-height: 180px;
  color: var(--text);
}

/* Pixel size dropdown â€” show values properly */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
  content: attr(data-value) !important;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=""]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=""]::before {
  content: 'Size' !important;
}
.ql-snow .ql-picker.ql-size {
  width: 70px !important;
}


/* ---- Per-editor WYSIWYG preview styles (match front page) ---- */

/* Hero Main Title - large bold heading (e.g. SNFX) */
#ce-hero-main-title .ql-container {
  min-height: 80px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}
#ce-hero-main-title .ql-editor {
  min-height: 60px;
  padding: 16px;
}
#ce-hero-main-title .ql-editor h1,
#ce-hero-main-title .ql-editor h2,
#ce-hero-main-title .ql-editor p {
  margin: 0;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* Hero Title - secondary heading (e.g. Joris Haverkort) */
#ce-hero-title .ql-container {
  min-height: 60px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}
#ce-hero-title .ql-editor {
  min-height: 40px;
  padding: 16px;
}
#ce-hero-title .ql-editor h1,
#ce-hero-title .ql-editor h2,
#ce-hero-title .ql-editor p {
  margin: 0;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* Hero Subtitle - small uppercase tracking */
#ce-hero-subtitle .ql-container {
  min-height: 50px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}
#ce-hero-subtitle .ql-editor {
  min-height: 30px;
  padding: 12px 16px;
  color: var(--muted);
}
#ce-hero-subtitle .ql-editor p {
  margin: 0;
}

/* About Title - section heading */
#ce-about-title .ql-container {
  min-height: 50px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}
#ce-about-title .ql-editor {
  min-height: 30px;
  padding: 12px 16px;
  color: var(--accent);
}

/* About Bio - body text, readable */
#ce-about-editor .ql-container {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,0.7);
}
#ce-about-editor .ql-editor {
  min-height: 180px;
  padding: 20px;
  color: rgba(255,255,255,0.7);
}
#ce-about-editor .ql-editor p {
  margin-bottom: 20px;
}
#ce-about-editor .ql-editor p:first-child {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
}

/* Shop Title - large gradient-style heading */
#ce-shop-title .ql-container {
  min-height: 60px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
#ce-shop-title .ql-editor {
  min-height: 50px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
#ce-shop-title .ql-editor h1,
#ce-shop-title .ql-editor h2,
#ce-shop-title .ql-editor p {
  margin: 0;
  font-weight: inherit;
}

/* Shop Message - muted body text, centered */
#ce-shop-message .ql-container {
  min-height: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}
#ce-shop-message .ql-editor {
  min-height: 40px;
  padding: 12px 16px;
  color: var(--muted);
}
#ce-shop-message .ql-editor p {
  margin: 0;
}

/* Contact Title - large bold heading */
#ce-contact-title .ql-container {
  min-height: 80px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  text-align: center;
}
#ce-contact-title .ql-editor {
  min-height: 60px;
  padding: 16px;
}
#ce-contact-title .ql-editor h1,
#ce-contact-title .ql-editor h2,
#ce-contact-title .ql-editor p {
  margin: 0;
  font-weight: inherit;
  line-height: inherit;
}


.ql-snow .ql-stroke { stroke: var(--muted) !important; }
.ql-snow .ql-fill { fill: var(--muted) !important; }
.ql-snow .ql-picker-label { color: var(--muted) !important; }

/* Gradient text format */
.text-gradient {
  background: linear-gradient(135deg, #6c63ff, #00d4aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient toolbar button */
.ql-gradient {
  width: 28px !important;
}
.ql-gradient svg {
  width: 18px;
  height: 18px;
}
.ql-gradient.ql-active {
  background: rgba(108, 99, 255, 0.15) !important;
  border-radius: 3px;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg3);
  color: var(--text);
}

/* ---- TEMPLATE GRID ---- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.template-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.template-card:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.05);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.template-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-top: 10px;
  color: var(--text);
}

.template-desc {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Template preview thumbnails */
.template-preview {
  height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
}

.tp-line {
  height: 4px;
  width: 80%;
  background: var(--border);
  border-radius: 2px;
}

.tp-line--title {
  width: 50%;
  height: 6px;
  background: var(--accent);
  margin-bottom: 4px;
}

.tp-line--short { width: 50%; }

.tp-line--big {
  width: 70%;
  height: 10px;
  background: var(--accent);
}

.tp-line--subtitle {
  width: 40%;
  height: 3px;
  background: var(--muted);
}

.template-preview--split {
  flex-direction: row;
  gap: 6px;
}

.tp-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-preview--cards {
  flex-direction: row;
  gap: 4px;
}

.tp-card {
  flex: 1;
  height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.template-preview--gallery {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 3px;
}

.tp-thumb {
  width: 22px;
  height: 22px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.tp-thumb--wide {
  width: 100%;
  height: 16px;
}

.template-preview--timeline {
  flex-direction: row;
  align-items: center;
  gap: 0;
}

.tp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.tp-line--tl {
  width: 16px;
  height: 2px;
  background: var(--border);
}

/* ---- CUSTOM PAGE EDITORS ---- */
.custom-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.custom-block-header h3 {
  margin: 0;
}

.page-template-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
}

.btn-icon--danger:hover:not(:disabled) {
  border-color: #ff4444;
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1200px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; padding: 16px 0; }
  .sidebar-logo { font-size: 14px; padding: 0 8px 16px; text-align: center; }
  .sidebar-link { padding: 12px; justify-content: center; }
  .sidebar-link span:not(.icon) { display: none; }
  .admin-main { margin-left: 60px; padding: 20px; }
  .infra-grid, .infra-live-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-stats-grid { grid-template-columns: 1fr; }
  .dash-bottom-row { grid-template-columns: 1fr; }
  .dash-charts-row { grid-template-columns: 1fr; }
}

/* ---- SETTINGS SECTIONS ---- */
.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
