﻿/* ============================================
   SNFX Admin â€” My Space Styles
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Utility classes */
.ml-sm { margin-left: 8px; }
.ml-md { margin-left: 16px; }
.mt-md { margin-top: 12px; }
.form-group--row { display: flex; gap: 8px; flex-wrap: wrap; }

: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.glowing-eyes-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-group.glowing-eyes-group > label { margin: 0; }

.form-group.music-song-group { display: none; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.label-hint { color: var(--muted); font-weight: normal; text-transform: none; }

.template-picker-label {
  margin-bottom: 8px;
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.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);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-ms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ms:hover {
  border-color: var(--accent);
  background: var(--bg2);
  transform: translateY(-1px);
}

.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); }

/* Save button states */
.btn-saved {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: #22c55e !important;
}

/* Highlight flash for scroll-to targets */
@keyframes highlightFlash {
  0% { box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.5); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.highlight-flash {
  animation: highlightFlash 1.5s ease-out;
  border-radius: 8px;
}

/* ---- 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);
  -webkit-backdrop-filter: blur(16px);
  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);
  -webkit-backdrop-filter: blur(12px);
  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.ring-accent { --ring-color: var(--accent); }
.dash-stat-ring.ring-green { --ring-color: #4ade80; }
.dash-stat-ring.ring-amber { --ring-color: #f59e0b; }
.dash-stat-ring.ring-blue { --ring-color: #38bdf8; }

.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 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.dash-bottom-row--equal {
  grid-template-columns: 1fr 1fr;
}

.dash-recent, .dash-quick-actions, .dash-db-status {
  padding: 24px;
  animation: cardEntrance 0.5s ease 0.7s both;
}

.dash-recent h3, .dash-quick-actions h3, .dash-db-status 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;
}

/* Dashboard DB status */
.dash-db-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-db-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.dash-db-item:hover {
  background: rgba(108, 99, 255, 0.06);
}
.dash-db-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.dash-db-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dash-db-name {
  font-size: 13px;
  font-weight: 500;
}
.dash-db-state {
  font-size: 11px;
  color: var(--muted);
}
.dash-db-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.dash-db-dot.green { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }
.dash-db-dot.yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
.dash-db-dot.red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }

.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;
  cursor: grab;
}
.page-row[draggable]:active { cursor: grabbing; }
.page-row--dragging {
  opacity: 0.4;
  border-style: dashed;
}
.page-row--drag-over {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.15);
}
.page-row--header {
  background: transparent;
  border: none;
  padding: 4px 14px 2px;
  cursor: default;
}

.page-drag-handle {
  font-size: 16px;
  opacity: 0.3;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: -1px;
}
.page-row:hover .page-drag-handle { opacity: 0.7; }

.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;
  transition: color 0.2s;
}
.page-row-left:hover .page-label {
  color: var(--accent);
}

.page-row-right {
  display: flex;
  align-items: center;
  gap: 0;
}
.page-col-move {
  display: flex;
  gap: 4px;
  width: 64px;
  justify-content: center;
}
.page-col-vis {
  width: 48px;
  display: flex;
  justify-content: center;
}
.page-col-auth {
  width: 48px;
  display: flex;
  justify-content: center;
}
.page-col-del {
  width: 32px;
  display: flex;
  justify-content: center;
}
.page-header-col {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
}
.page-header-col.page-col-move { width: 64px; }
.page-header-col.page-col-vis { width: 48px; }
.page-header-col.page-col-auth { width: 48px; }
.page-header-col.page-col-del { width: 32px; }

/* Auth-only toggle slider variant */
.toggle-slider--auth {
  background: var(--surface) !important;
  border: 1px solid var(--border);
}
input:checked + .toggle-slider--auth {
  background: #f5a623 !important;
  border-color: #f5a623;
}

/* Icon toggle buttons for page manager */
.btn-icon-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--muted);
  opacity: 0.4;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-toggle:hover {
  opacity: 0.8;
  background: rgba(255,255,255,0.05);
}
.btn-icon-toggle.active {
  opacity: 1;
}
.btn-eye.active {
  color: #4a9eff;
}
.btn-lock.active {
  color: #f5a623;
}
.page-header-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  opacity: 0.6;
}

.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;
  -webkit-user-select: none;
  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;
}

/* Font family dropdown — show font names and render in own font */
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
  content: attr(data-value) !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=""]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=""]::before {
  content: 'Font' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value] {
  font-size: 14px;
}
/* Render each font option in its own typeface */
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Arial"] { font-family: Arial, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Georgia"] { font-family: Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Helvetica"] { font-family: Helvetica, Arial, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Times New Roman"] { font-family: 'Times New Roman', serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Courier New"] { font-family: 'Courier New', monospace; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Verdana"] { font-family: Verdana, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Inter"] { font-family: 'Inter', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Roboto"] { font-family: 'Roboto', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Open Sans"] { font-family: 'Open Sans', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Montserrat"] { font-family: 'Montserrat', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Poppins"] { font-family: 'Poppins', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Lato"] { font-family: 'Lato', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Space Grotesk"] { font-family: 'Space Grotesk', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Playfair Display"] { font-family: 'Playfair Display', serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="DM Sans"] { font-family: 'DM Sans', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="JetBrains Mono"] { font-family: 'JetBrains Mono', monospace; }
.ql-snow .ql-picker.ql-font {
  width: 150px !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-options {
  max-height: 300px;
  overflow-y: auto;
}


/* ---- Per-editor WYSIWYG preview styles (match front page) ---- */

/* Section shared toolbar */
.section-toolbar {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  margin-bottom: 16px;
}
.section-toolbar .ql-toolbar {
  border: none !important;
  border-radius: 8px;
}

/* Title editors: auto-height, no toolbar, minimal chrome */
.editor-title .ql-toolbar {
  display: none !important;
}
.editor-title .ql-container {
  min-height: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
}
.editor-title .ql-editor {
  min-height: 0 !important;
  padding: 8px 12px !important;
}

/* Hero Main Title styling */
#ce-hero-main-title .ql-container {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}
#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 */
#ce-hero-title .ql-container {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}
#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 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}
#ce-hero-subtitle .ql-editor {
  color: var(--muted);
}
#ce-hero-subtitle .ql-editor p {
  margin: 0;
}

/* About Title - section heading */
#ce-about-title .ql-container {
  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 {
  color: var(--accent);
}

/* Editors without their own toolbar get full border */
#ce-about-editor .ql-toolbar,
[id^="ce-custom-body-"] .ql-toolbar,
[id^="ce-split-left-"] .ql-toolbar,
[id^="ce-split-right-"] .ql-toolbar {
  display: none !important;
}
#ce-about-editor .ql-container,
[id^="ce-custom-body-"] .ql-container,
[id^="ce-split-left-"] .ql-container,
[id^="ce-split-right-"] .ql-container {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
}

/* 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: 50px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
#ce-shop-title .ql-editor {
  min-height: 36px;
  padding: 10px 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: 50px;
  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: 36px;
  padding: 10px 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;
}

/* Custom page title editors — auto-height, no toolbar */
[id^="ce-custom-title-"] .ql-toolbar {
  display: none !important;
}
[id^="ce-custom-title-"] .ql-container {
  min-height: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
}
[id^="ce-custom-title-"] .ql-editor {
  min-height: 0 !important;
  padding: 8px 12px !important;
}

.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);
  -webkit-backdrop-filter: blur(4px);
  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-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.custom-block-header h3 {
  margin: 0;
}

/* Inline visibility toggle in content-block headers */
.content-block-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.content-block-header h3 { margin: 0; }
.toggle-inline {
  margin-left: auto;
}

/* Dimmed state for hidden sections */
.content-block.section-hidden {
  opacity: 0.45;
  position: relative;
}
.content-block.section-hidden::after {
  content: 'HIDDEN';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.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;
}

/* ---- TIMELINE EDITOR ---- */
.timeline-items-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.timeline-item-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-item-fields .timeline-year {
  font-weight: 600;
  max-width: 200px;
}
.timeline-item-fields .timeline-desc {
  resize: vertical;
  min-height: 40px;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---- GALLERY EDITOR ---- */
.gallery-items-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery-item-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
}
.gallery-item-row .btn-danger {
  position: absolute;
  top: 8px;
  right: 8px;
}
.gallery-item-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-item-placeholder {
  font-size: 32px;
  color: var(--muted);
  opacity: 0.4;
}
.gallery-item-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-upload-btn {
  cursor: pointer;
  text-align: center;
}

/* ---- SPLIT COLUMN EDITOR ---- */
.split-editor-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.split-col-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.split-col-editor label {
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.split-col-editor .ql-container {
  min-height: 150px;
}

/* ---- Integrations Panel ---- */
.integration-status {
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.integration-status.connected {
  background: rgba(74, 222, 128, 0.06);
  border-color: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}
.integration-status.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}
.integration-status.error {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.green { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.status-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.int-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.int-status-configured {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.int-status-not-configured {
  background: rgba(160, 160, 180, 0.08);
  color: #888;
  border: 1px solid rgba(160, 160, 180, 0.15);
}
.int-status-testing {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.int-status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.input-secret-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-secret-wrap .input {
  flex: 1;
}
.btn-reveal {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
.btn-reveal:hover {
  background: rgba(255, 255, 255, 0.1);
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #666;
}

.btn-secondary {
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(108, 99, 255, 0.3);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.5);
}

.integrations-save-block {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
}
.integrations-save-block .btn-primary {
  font-size: 15px;
  padding: 12px 28px;
}

#panel-integrations .content-block {
  position: relative;
}
#panel-integrations .content-block h3 {
  margin-bottom: 4px;
}
#panel-integrations .block-desc {
  margin-bottom: 16px;
  opacity: 0.7;
  font-size: 13px;
}

.int-models-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.int-models-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.int-models-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px;
  letter-spacing: 0.5px;
}
.int-models-header .block-desc {
  margin: 0;
}
.int-models-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.int-models-section .block-desc {
  margin-bottom: 14px;
}
.int-models-section select {
  background: rgba(255, 255, 255, 0.04);
}

.btn-accent {
  background: linear-gradient(135deg, #00c9a7, #00a87d);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 201, 167, 0.35);
}

/* ---- ADMIN THEME TOGGLE ---- */
.admin-theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-size: 16px;
}
.admin-theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.15);
}
[data-admin-theme="light"] .admin-theme-toggle {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.06);
}
[data-admin-theme="light"] .admin-theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}
.admin-theme-icon--sun { display: none; }
.admin-theme-icon--moon { display: block; }

.dash-hero-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- QUICK ACTION BAR (top) ---- */
.dash-quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(108, 99, 255, 0.05);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.dash-quick-btn:hover {
  background: rgba(108, 99, 255, 0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.dash-quick-arrow {
  font-size: 11px;
  opacity: 0.6;
}

/* ---- DATABASE STORAGE ---- */
.dash-storage-card { min-width: 0; }
.dash-storage-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.dash-storage-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-storage-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.dash-storage-value {
  font-weight: 600;
  color: var(--text);
}
.dash-storage-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  font-size: 11px;
}
.dash-storage-chip {
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-storage-chip-name { color: var(--muted); }
.dash-storage-chip-val { color: var(--text); font-weight: 600; }

/* ---- USERS PANEL ---- */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.user-item-email {
  font-size: 13px;
  color: var(--text);
}
.user-item-date {
  font-size: 11px;
  color: var(--muted);
  margin-left: 12px;
}
.user-item-remove {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.user-item-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}
.users-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ---- ADMIN LIGHT MODE ---- */
[data-admin-theme="light"] {
  --bg: #f5f5fa;
  --bg2: #ededf4;
  --bg3: #e4e4ec;
  --text: #1a1a2e;
  --muted: #666;
  --border: rgba(108, 99, 255, 0.15);
  --card: rgba(255, 255, 255, 0.9);
}
[data-admin-theme="light"] .admin-theme-icon--sun { display: block; }
[data-admin-theme="light"] .admin-theme-icon--moon { display: none; }
[data-admin-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}
[data-admin-theme="light"] .sidebar {
  background: var(--bg2);
  border-right-color: var(--border);
}
[data-admin-theme="light"] .sidebar-link {
  color: var(--text);
}
[data-admin-theme="light"] .sidebar-link:hover,
[data-admin-theme="light"] .sidebar-link.active {
  background: rgba(108, 99, 255, 0.08);
}
[data-admin-theme="light"] .glass-card,
[data-admin-theme="light"] .dash-stat-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--border);
}
[data-admin-theme="light"] .content-block {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border);
}
[data-admin-theme="light"] .input,
[data-admin-theme="light"] select.input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}
[data-admin-theme="light"] .input:focus {
  border-color: var(--accent);
}
[data-admin-theme="light"] .dash-hero-title,
[data-admin-theme="light"] h2, [data-admin-theme="light"] h3 {
  color: var(--text);
}
[data-admin-theme="light"] .panel-desc,
[data-admin-theme="light"] .block-desc {
  color: var(--muted);
}
[data-admin-theme="light"] .dash-bar-track {
  background: rgba(0, 0, 0, 0.06);
}
[data-admin-theme="light"] .dash-info-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-admin-theme="light"] .btn-reveal {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}
[data-admin-theme="light"] .user-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-admin-theme="light"] .dash-quick-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-admin-theme="light"] .dash-quick-btn:hover {
  background: rgba(108, 99, 255, 0.08);
  border-color: var(--accent);
}

/* ---- ADMIN EFFECTS ---- */
.admin-effects {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 9999;
}
.admin-effect-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(108, 99, 255, 0.3);
  background: rgba(18, 18, 28, 0.85);
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.admin-effect-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
}
.admin-effect-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}
[data-admin-theme="light"] .admin-effect-btn {
  background: rgba(255, 255, 255, 0.8);
}
