/* ─── Root Variables - Professional Dark ─── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111116;
  --bg-card: #16161d;
  --bg-card-hover: #1c1c26;
  --bg-input: #0f0f14;
  --bg-sidebar: #0d0d12;
  --bg-elevated: #1a1a24;
  --border-color: #1e1e2a;
  --border-light: #2a2a3a;
  --text-primary: #ffffff;
  --text-primary-glow: 0 0 12px rgba(255, 255, 255, 0.25);
  --text-secondary: #9898a8;
  --text-muted: #68687a;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.12);
  --primary-glow: rgba(59, 130, 246, 0.25);
  --secondary: #6366f1;
  --secondary-hover: #4f46e5;
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.12);
  --info: #06b6d4;
  --info-light: rgba(6, 182, 212, 0.12);
  --accent: #8b5cf6;
  --accent-light: rgba(139, 92, 246, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-width: 260px;
  --topbar-height: 56px;
}

/* ─── Root Variables - Light (opt-in via [data-theme="light"]) ─── */
:root[data-theme="light"] {
  --bg-primary: #f3f6fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f6fb;
  --bg-input: #f7f9fc;
  --bg-sidebar: #ffffff;
  --bg-elevated: #ffffff;
  --border-color: #e3e8f0;
  --border-light: #d3dbe6;
  --text-primary: #10131c;
  --text-primary-glow: none;
  --text-secondary: #545b6e;
  --text-muted: #848da3;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37,99,235,0.10);
  --primary-glow: rgba(37,99,235,0.20);
  --secondary: #6366f1;
  --secondary-hover: #4f46e5;
  --success: #16a34a;
  --success-light: rgba(22,163,74,0.10);
  --warning: #d97706;
  --warning-light: rgba(217,119,6,0.10);
  --error: #dc2626;
  --error-light: rgba(220,38,38,0.10);
  --info: #0891b2;
  --info-light: rgba(8,145,178,0.10);
  --accent: #7c3aed;
  --accent-light: rgba(124,58,237,0.10);
  --shadow: 0 8px 24px rgba(16,20,35,0.08);
  --shadow-lg: 0 12px 40px rgba(16,20,35,0.10);
  --shadow-sm: 0 2px 8px rgba(16,20,35,0.06);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

code {
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--primary);
  border: 1px solid var(--border-color);
}

/* ─── Container ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }


/* ─── App Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-layout-full {
  display: block;
}

.sidebar-spacer {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-width: auto;
  width: 100%;
  padding-top: 24px;
  padding-bottom: 40px;
  min-height: calc(100vh - 48px);
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-title span { color: var(--primary); }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.sidebar-close:hover { color: var(--text-primary); background: var(--bg-card); }

.sidebar-user {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-user-link:hover {
  background: var(--bg-card);
}

.sidebar-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.sidebar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  border: 2px solid var(--bg-sidebar);
}

.sidebar-status.online { background: var(--success); color: white; }
.sidebar-status.admin { background: var(--accent); color: white; }

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-username {
  font-weight: 600;
  font-size: 0.85rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 10px 4px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: transparent;
  transition: var(--transition);
}

.sidebar-link.active .sidebar-link-icon {
  background: var(--primary);
  color: white;
}

.sidebar-link:hover .sidebar-link-icon {
  color: var(--primary);
}

.sidebar-link.active:hover .sidebar-link-icon {
  color: white;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--error);
}

/* ─── Submenú desplegable de "APIs" (Descargas / Stickers) ─── */
.sidebar-link-caret {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

#apisNavToggle.open .sidebar-link-caret {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.25s ease;
  margin: 0 0 0 14px;
  border-left: 1px dashed var(--border-color);
}

.sidebar-submenu.open {
  grid-template-rows: 1fr;
}

.sidebar-submenu > * {
  overflow: hidden;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 16px;
  margin: 2px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-sublink:hover {
  background: var(--bg-card);
  color: var(--primary);
  transform: translateX(3px);
}

.sidebar-sublink i {
  width: 16px;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 8px 10px 14px;
  border-top: 1px solid var(--border-color);
}

.sidebar-link-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.sidebar-logout:hover {
  color: var(--error) !important;
  background: var(--error-light) !important;
}

/* ─── Sidebar Overlay (mobile) ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.show { display: block; }

/* ─── Top Mobile Bar ─── */
.topbar-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  padding: 0 12px;
  z-index: 100;
  gap: 12px;
}

.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.topbar-menu-btn:hover { background: var(--bg-card); }

.topbar-mobile-brand {
  flex: 1;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-mobile-brand span { color: var(--primary); }

.topbar-mobile-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.topbar-mobile-logo {
  height: 28px;
  width: auto;
  border-radius: 6px;
}

.nav-auth { display: flex; gap: 8px; justify-content: center; padding: 40px 20px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(37,99,235,0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 25px rgba(37,99,235,0.4); color: white; }

.btn-secondary { background: #3b82f6; color: white; }
.btn-secondary:hover { background: #2563eb; transform: translateY(-2px); color: white; }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--primary); }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; color: white; transform: translateY(-1px); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-social { justify-content: center; width: 100%; margin-bottom: 8px; }
.btn-google { background: white; color: #333; border: 1px solid #ddd; }
.btn-google:hover { background: #f5f5f5; color: #333; }
.btn-github { background: #24292e; color: white; border: 1px solid #1b1f23; }
.btn-github:hover { background: #1b1f23; color: white; }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-help {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-with-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.input-prefix {
  padding: 12px 8px 12px 16px;
  background: var(--bg-card);
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  border-right: 1px solid var(--border-color);
}

.input-with-prefix input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.input-mono { font-family: var(--font-mono) !important; font-size: 0.85rem !important; }
.input-sm { padding: 8px 12px; font-size: 0.85rem; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); }

/* ─── Alerts ─── */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-error { background: var(--error-light); color: var(--error); border: 1px solid rgba(239,68,68,0.2); }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { border-color: rgba(124,58,237,0.3); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 24px; }

.card-danger { border-color: rgba(239,68,68,0.3); }
.card-danger .card-header { border-color: rgba(239,68,68,0.3); }
.card-danger h2 { color: var(--error); }

/* ─── Grids ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-4px); border-color: rgba(124,58,237,0.3); box-shadow: var(--shadow); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 12px;
}

.stat-icon.purple { background: rgba(124,58,237,0.15); color: #a855f7; }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: #fbbf24; }

.stat-number { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; color: var(--text-primary); text-shadow: var(--text-primary-glow); }
.stat-label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 40px 0;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary-light);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-shadow: var(--text-primary-glow);
}

.hero-title span { color: var(--primary); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ─── Feature Cards ─── */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}

.feature-card:hover { transform: translateY(-4px); border-color: rgba(124,58,237,0.3); box-shadow: var(--shadow); }

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ─── Section Titles ─── */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 32px;
  padding-top: 40px;
  color: var(--text-primary);
  text-shadow: var(--text-primary-glow);
}

.section-action { text-align: center; padding: 24px 0; }

/* ─── Marketplace Grid ─── */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); color: var(--text-primary); }

.market-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.market-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 50px;
}

.market-stats-top { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-muted); }
.market-stats-top i { margin-right: 4px; }

.market-card-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
}

.market-name { font-size: 1.1rem; font-weight: 700; margin: 0; }

.market-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  flex-grow: 1;
  margin: 0;
}

.market-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ─── Marketplace Detail ─── */
.market-detail-grid { max-width: 800px; margin: 0 auto; }

.market-detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.market-detail-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
}

.market-meta { display: flex; gap: 8px; margin-top: 8px; }
.market-stats-bar { display: flex; gap: 24px; padding: 16px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); margin-bottom: 16px; }
.market-stat { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.9rem; }
.market-stat strong { color: var(--text-primary); }
.market-aliases { margin-bottom: 16px; font-size: 0.9rem; color: var(--text-secondary); }
.market-aliases code { margin: 0 4px; }
.market-response { margin: 20px 0; }
.market-response h3 { margin-bottom: 12px; font-size: 1rem; }
.market-actions { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.install-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.install-form select { min-width: 180px; }

/* ─── Marketplace Toolbar ─── */
.marketplace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.categories { display: flex; flex-wrap: wrap; gap: 8px; }

.category-chip {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.category-chip:hover, .category-chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.search-form { display: flex; gap: 8px; }
.search-input { padding: 8px 16px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.9rem; min-width: 200px; outline: none; }
.search-input:focus { border-color: var(--primary); }

/* ─── Table ─── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); }
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(42,42,90,0.5); font-size: 0.9rem; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.cell-name { font-weight: 600; }
.cell-mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); }
.cell-actions { display: flex; gap: 4px; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-error { background: var(--error-light); color: var(--error); }
.badge-info { background: rgba(6,182,212,0.15); color: #22d3ee; }
.badge-danger { background: var(--error-light); color: var(--error); }
.badge-secondary { background: var(--bg-card); color: var(--text-muted); }

.badge i { font-size: 0.55rem; }

/* ─── Auth Pages ─── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 32px 32px 0;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin: 0 auto 16px;
}

.auth-header h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-header p { color: var(--text-secondary); font-size: 0.9rem; }

.auth-body { padding: 24px 32px; }
.auth-footer { text-align: center; padding: 16px 32px; border-top: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); font-weight: 600; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  gap: 16px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span { color: var(--text-muted); font-size: 0.85rem; }

.auth-social { display: flex; gap: 8px; }

.auth-card { box-shadow: var(--shadow-lg); }

/* ─── Auth Split Layout (login) ─── */
.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
}

.auth-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--primary) 1px, transparent 1px),
    linear-gradient(90deg, var(--primary) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: .05;
  -webkit-mask-image: radial-gradient(circle at 28% 25%, black, transparent 72%);
  mask-image: radial-gradient(circle at 28% 25%, black, transparent 72%);
}

.auth-hero-glow {
  position: absolute;
  width: 560px; height: 560px;
  top: -200px; right: -200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: .22;
  filter: blur(10px);
}

.auth-brand-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.auth-brand-row .sidebar-logo-img,
.auth-brand-row img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.auth-brand-name { font-family: var(--font-mono); font-weight: 700; font-size: 18px; letter-spacing: .2px; color: var(--text-primary); }
.auth-brand-name span { color: var(--primary); }

.auth-core-stage { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 24px; margin: 10px 0; }

.auth-core-ring { position: relative; width: 220px; height: 220px; }
.auth-core-ring svg { width: 100%; height: 100%; display: block; }
.auth-ring-a { transform-origin: 50% 50%; animation: authSpin 22s linear infinite; }
.auth-ring-b { transform-origin: 50% 50%; animation: authSpin 34s linear infinite reverse; }
.auth-core-pulse { animation: authPulse 2.6s ease-in-out infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.auth-hero-copy { text-align: center; max-width: 360px; }
.auth-hero-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2.5px; color: var(--primary); text-transform: uppercase; margin-bottom: 10px; }
.auth-hero-title { font-size: 24px; font-weight: 700; line-height: 1.35; margin: 0 0 10px; color: var(--text-primary); }
.auth-hero-sub { font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); margin: 0; }

.auth-status-panel { position: relative; z-index: 2; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px 18px; }
.auth-status-row { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; }
.auth-status-row + .auth-status-row { margin-top: 10px; }
.auth-status-label { color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.auth-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.auth-status-value { color: var(--text-primary); }

.auth-barcode { display: flex; align-items: flex-end; gap: 2px; height: 24px; margin-top: 14px; opacity: .6; }
.auth-barcode i { display: block; width: 2px; background: var(--primary); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-panel .auth-card { width: 100%; max-width: 400px; background: transparent; border: none; box-shadow: none; }
.auth-panel-top { display: flex; justify-content: flex-end; max-width: 400px; margin: 0 auto 18px; }

.auth-theme-toggle { display: flex; align-items: center; gap: 4px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 999px; padding: 4px; }
.auth-theme-toggle button { all: unset; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; cursor: pointer; color: var(--text-muted); }
.auth-theme-toggle button.active { background: var(--primary); color: #fff; }
.auth-theme-toggle svg { width: 14px; height: 14px; }

@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 28px 18px; }
}

/* ─── Page Layout ─── */
.page { padding: 32px 0; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.page-header p { color: var(--text-secondary); font-size: 0.9rem; }

.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Detail Grid ─── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.info-grid { display: flex; flex-direction: column; gap: 16px; }

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.info-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.info-value { font-size: 0.9rem; font-weight: 500; }
.info-value.mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--primary); }

/* ─── Code Block ─── */
.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
}

.code-block.large { padding: 20px; }
.code-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.code-block code { background: none; border: none; padding: 0; font-size: 0.9rem; color: var(--primary); }

/* ─── SubBot Mini-List ─── */
.subbot-mini-list { display: flex; flex-direction: column; gap: 8px; }

.subbot-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}

.subbot-mini-card:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.subbot-mini-name { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.subbot-mini-prefix { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ─── Commands List ─── */
.commands-list { display: flex; flex-direction: column; gap: 12px; }

.command-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.command-card:hover { border-color: rgba(124,58,237,0.3); }
.command-card.installed { border-left: 3px solid var(--info); }

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
}

.command-name { display: flex; align-items: center; gap: 8px; }
.command-name code { font-size: 1rem; padding: 4px 12px; }
.command-actions { display: flex; gap: 4px; }

.command-body { padding: 12px 16px; }
.command-body p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 8px; }

.command-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.cmd-badge { padding: 2px 8px; background: var(--bg-card); border-radius: 4px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--primary); }
.cmd-uses, .cmd-installs { display: flex; align-items: center; gap: 4px; }
.cmd-author { display: flex; align-items: center; gap: 4px; }

.command-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); }
.publish-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state.small { padding: 40px 20px; }
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }
.empty-state.full-width { grid-column: 1 / -1; }

/* ─── Steps ─── */
.steps { display: flex; flex-direction: column; gap: 20px; }

.step { display: flex; gap: 16px; align-items: flex-start; }

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}

.step-content h3 { font-size: 1rem; margin-bottom: 4px; }
.step-content p { color: var(--text-secondary); font-size: 0.85rem; }

/* ─── Marketplace CTA ─── */
.marketplace-cta { text-align: center; padding: 30px 20px; }
.marketplace-cta i { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; }
.marketplace-cta h3 { margin-bottom: 8px; }
.marketplace-cta p { color: var(--text-secondary); margin-bottom: 16px; }

/* ─── Linking Info ─── */
.linked-info, .unlinked-info { text-align: center; padding: 30px 20px; }
.linked-info h3, .unlinked-info h3 { margin: 12px 0 8px; }
.linked-info p, .unlinked-info p { color: var(--text-secondary); margin-bottom: 16px; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-center { text-align: center; }

/* ─── Pairing ─── */
.pairing-methods { display: flex; flex-direction: column; gap: 24px; padding: 24px 0; }
.pairing-method { text-align: center; }
.pairing-method h3 { margin: 12px 0 8px; }
.pairing-method p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }
.method-number { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.pairing-divider { display: flex; align-items: center; gap: 16px; color: var(--text-muted); }
.pairing-divider::before, .pairing-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.pairing-steps { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; text-align: left; max-width: 400px; margin-inline: auto; }
.pairing-steps .step { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.step-icon { font-size: 1.2rem; }
.pairing-note { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--primary-light); border-radius: var(--radius-sm); text-align: left; margin-bottom: 20px; }
.pairing-note i { color: var(--primary); font-size: 1.2rem; margin-top: 2px; }
.pairing-note p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* ─── Users Grid ─── */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 20px 0; }

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.user-card:hover { transform: translateY(-2px); border-color: rgba(124,58,237,0.3); }

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid var(--primary-light);
}

.user-card h4 { font-size: 0.95rem; margin-bottom: 8px; }
.user-stats { display: flex; justify-content: center; gap: 12px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }

/* ─── Error Page ─── */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.error-card { text-align: center; max-width: 500px; }

.error-icon {
  width: 80px;
  height: 80px;
  background: var(--error-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--error);
  margin: 0 auto 24px;
}

.error-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.error-message { color: var(--text-secondary); font-size: 1rem; margin-bottom: 32px; line-height: 1.6; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-brand { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.footer-brand i { color: var(--primary); }
.footer-version { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; padding: 2px 6px; background: var(--bg-card); border-radius: 4px; }

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--primary); }

.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Dashboard / Social Feed ─── */
.dashboard-page {
  padding: 0;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.feed-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}


/* ═══════════════════════════════════════
   DASHBOARD LAYOUT (Chat + Amigos)
   ═══════════════════════════════════════ */

.dash-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.dash-main {
  flex: 1;
  min-width: 0;
  max-width: 680px;
  width: 100%;
}

.dash-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

/* ─── DESTACADAS ─── */
.destacadas-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.destacadas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.destacadas-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.destacadas-title i {
  font-size: 1rem;
  filter: drop-shadow(0 0 6px rgba(245,158,11,0.4));
}

.create-post-btn {
  background: var(--primary-light);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.create-post-btn:hover {
  background: var(--primary);
  color: white;
}

.destacadas-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.destacadas-scroll::-webkit-scrollbar { display: none; }

.destacada-card {
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.destacada-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.destacada-badge {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.badge-official {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-pinned {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  border-radius: 4px;
}

.destacada-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.destacada-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.destacada-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destacadas-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.destacadas-empty i {
  font-size: 1.2rem;
  opacity: 0.3;
}

/* ─── QUICK POST ─── */
.quick-post {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.quick-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-post-input-wrap {
  flex: 1;
}

.quick-post-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font);
}

.quick-post-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.quick-post-input::placeholder {
  color: var(--text-muted);
}

.quick-post-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.quick-post-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* ─── AMIGOS SIDEBAR ─── */
.amigos-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(59,130,246,0.04), transparent);
}

.amigos-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amigos-header i {
  color: var(--primary);
  font-size: 0.95rem;
}

.amigos-count {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.amigos-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.01);
}

.amigos-search i {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.amigos-search:focus-within i {
  color: var(--primary);
}

.amigos-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  font-family: var(--font);
}

.amigos-search input::placeholder { color: var(--text-muted); }

.amigos-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.amigos-list::-webkit-scrollbar {
  width: 4px;
}

.amigos-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

.amigos-list::-webkit-scrollbar-track {
  background: transparent;
}

.amigo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-left: 3px solid transparent;
  margin: 1px 6px;
  border-radius: 8px;
}

.amigo-card:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--primary);
  transform: translateX(2px);
}

.amigo-card:active {
  transform: scale(0.98);
}

.amigo-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.amigo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s;
}

.amigo-card:hover .amigo-avatar {
  border-color: var(--primary);
}

.amigo-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.amigo-status.online { background: var(--success); }
.amigo-status.offline { background: var(--text-muted); }

.amigo-info {
  flex: 1;
  min-width: 0;
}

.amigo-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.amigo-card:hover .amigo-name {
  color: var(--primary);
}

.admin-shield {
  color: var(--accent);
  font-size: 0.65rem;
  margin-left: 3px;
  filter: drop-shadow(0 0 3px rgba(139,92,246,0.3));
}

.amigo-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.amigo-unread {
  background: var(--error);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
  animation: unreadPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes unreadPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.amigos-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.amigos-empty i {
  font-size: 2rem;
  opacity: 0.2;
  margin-bottom: 8px;
  display: block;
}

.amigos-empty p {
  font-size: 0.8rem;
}

.amigos-chats-link {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.amigos-chats-link:hover {
  background: var(--primary-light);
  border-color: rgba(59,130,246,0.3);
  color: var(--primary);
}

.amigos-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  transition: all 0.15s;
}

.amigos-view-all:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

/* ─── CHAT ATTACH PICKER ─── */
.chat-attach-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: none;
  flex-direction: column;
  max-height: 280px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
  z-index: 20;
  overflow: hidden;
}

.attach-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.attach-picker-header span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.attach-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.attach-picker-close:hover {
  color: var(--error);
  background: var(--error-light);
}

.attach-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.attach-picker-loading, .attach-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  gap: 8px;
  text-align: center;
}

.attach-picker-empty i {
  font-size: 1.5rem;
  opacity: 0.3;
}

.attach-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid rgba(42,42,90,0.3);
}

.attach-picker-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.attach-picker-item:last-child {
  border-bottom: none;
}

.attach-picker-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.attach-picker-info {
  flex: 1;
  min-width: 0;
}

.attach-picker-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-picker-name code {
  font-size: 0.8rem;
  padding: 1px 6px;
}

.attach-picker-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  padding: 4px 8px;
  background: rgba(59,130,246,0.1);
  border-radius: 4px;
  font-size: 0.78rem;
}

.chat-attachment a {
  color: var(--primary);
  font-weight: 500;
}

.chat-attachment a:hover {
  text-decoration: underline;
}

/* ─── CHAT PANEL ─── */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 998;
}

.chat-panel {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 340px;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
  animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-panel.minimized {
  max-height: 48px;
  overflow: hidden;
}

@keyframes chatSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-username {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
}

.chat-userstatus {
  font-size: 0.65rem;
  color: var(--success);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.chat-min-btn, .chat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}

.chat-min-btn:hover, .chat-close-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.chat-close-btn:hover { color: var(--error); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 300px;
  background: var(--bg-primary);
}

.chat-loading, .chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.8rem;
  gap: 8px;
}

.chat-empty i {
  font-size: 2rem;
  opacity: 0.2;
}

.chat-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
}

.msg-me {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-other {
  align-self: flex-start;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 0.6rem;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border-color);
  position: relative;
  flex-shrink: 0;
}

.chat-attach-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  background: var(--bg-input);
  color: var(--primary);
}

.chat-attach-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.chat-attach-menu button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-family: var(--font);
  text-align: left;
  transition: var(--transition);
}

.chat-attach-menu button:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.chat-input-wrap {
  flex: 1;
}

.chat-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  font-family: var(--font);
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* ─── POST CHAT BUTTON ─── */
.chat-btn {
  color: var(--info) !important;
}

.chat-btn:hover {
  color: var(--info) !important;
  background: var(--info-light) !important;
}

/* ─── POST AUTHOR LINK ─── */
.post-author-link {
  color: var(--text-primary);
}

.post-author-link:hover {
  color: var(--primary);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .dash-sidebar {
    display: none;
  }
  .dash-main {
    max-width: 100%;
  }
  .chat-panel {
    right: 10px;
    width: calc(100% - 20px);
    max-height: 400px;
  }
}

/* ─── Stories Bar ─── */
.stories-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 16px 0 20px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

.story-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-secondary);
  min-width: 68px;
  flex-shrink: 0;
  transition: var(--transition);
}

.story-btn:hover .story-name {
  color: var(--primary);
}

.story-btn:active .story-avatar {
  transform: scale(0.92);
}

.story-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent), #ec4899, var(--warning));
  background-size: 300% 300%;
  animation: storyGradient 4s ease infinite;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.story-btn:hover .story-avatar {
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
  transform: scale(1.05);
}

@keyframes storyGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--bg-primary);
}

.story-add {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.6rem;
  position: absolute;
  bottom: 2px;
  right: 2px;
  border: 2.5px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--primary-glow);
  transition: transform 0.2s;
}

.story-btn:hover .story-add {
  transform: rotate(90deg);
}

.story-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* ─── Create Post Box ─── */
.create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.create-post-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.create-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.create-post-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font);
}

.create-post-input:focus {
  border-color: var(--primary);
}

.create-post-tools {
  display: flex;
  gap: 14px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

.create-post-tool {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.create-post-tool:hover { color: var(--primary); background: var(--primary-light); }

/* ─── Feed Post ─── */
.feed-post {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: var(--transition);
  width: 100%;
}

.feed-post.pinned {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-light);
}

.feed-post.official {
  border-color: var(--primary);
}

.feed-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.feed-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.feed-post-author {
  flex: 1;
  min-width: 0;
}

.feed-post-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed-post-badge {
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

.feed-post-badge.admin { background: var(--accent-light); color: var(--accent); }
.feed-post-badge.official { background: var(--primary-light); color: var(--primary); }
.feed-post-badge.pinned { background: var(--warning-light); color: var(--warning); }

.feed-post-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.feed-post-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.feed-post-menu:hover { background: var(--bg-card-hover); }

.feed-post-body {
  padding: 0 16px 12px;
}

.feed-post-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-post-text a {
  color: var(--primary);
  font-weight: 500;
}

.mention-link {
  color: var(--accent, #8b5cf6) !important;
  font-weight: 600 !important;
}

.mention-link:hover {
  text-decoration: underline !important;
}

.feed-post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 4px;
}

/* ─── Feed Post Actions ─── */
.feed-post-actions {
  display: flex;
  border-top: 1px solid var(--border-color);
  padding: 4px 8px;
}

.feed-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.feed-action-btn:hover { background: var(--bg-card-hover); }
.feed-action-btn.liked { color: var(--error); }
.feed-action-btn.liked i { font-weight: 900; }

.feed-action-btn.comment-btn:hover { color: var(--primary); }
.feed-action-btn.share-btn:hover { color: var(--success); }

.feed-action-count {
  font-size: 0.7rem;
  font-weight: 500;
}

/* ─── Comments Section ─── */
.feed-comments {
  padding: 0 16px 12px;
  border-top: 1px solid var(--border-color);
  display: none;
}

.feed-comments.open { display: block; }

.feed-comment {
  display: flex;
  gap: 8px;
  padding: 8px 0;
}

.feed-comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.feed-comment-body {
  flex: 1;
  font-size: 0.78rem;
}

.feed-comment-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 6px;
}

.feed-comment-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

.feed-comment-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.feed-comment-input-wrap {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  align-items: center;
}

.feed-comment-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
  font-family: var(--font);
}

.feed-comment-input:focus { border-color: var(--primary); }

.feed-comment-send {
  background: var(--primary);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-comment-send:hover { background: var(--primary-hover); }

/* ─── Toast Notifications ─── */
.toast {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: toastIn 0.3s ease;
  transition: opacity 0.3s ease;
  min-width: 200px;
  text-align: center;
}

.toast.success { border-color: var(--success); box-shadow: 0 4px 20px rgba(34,197,94,0.3); }
.toast.error { border-color: var(--error); box-shadow: 0 4px 20px rgba(239,68,68,0.3); }
.toast.info { border-color: var(--info); box-shadow: 0 4px 20px rgba(6,182,212,0.3); }

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Neon Text Glow ─── */
.neon-glow {
  text-shadow:
    0 0 7px rgba(255,255,255,0.6),
    0 0 10px rgba(255,255,255,0.4),
    0 0 21px rgba(255,255,255,0.3),
    0 0 42px var(--primary-glow),
    0 0 82px var(--primary-glow),
    0 0 92px var(--primary-glow);
}

.neon-glow-cyan {
  text-shadow:
    0 0 7px rgba(6,182,212,0.6),
    0 0 10px rgba(6,182,212,0.4),
    0 0 21px rgba(6,182,212,0.3),
    0 0 42px rgba(6,182,212,0.3),
    0 0 82px rgba(6,182,212,0.2);
}

.neon-glow-purple {
  text-shadow:
    0 0 7px rgba(168,85,247,0.6),
    0 0 10px rgba(168,85,247,0.4),
    0 0 21px rgba(168,85,247,0.3),
    0 0 42px rgba(168,85,247,0.3),
    0 0 82px rgba(168,85,247,0.2);
}

.neon-glow-pink {
  text-shadow:
    0 0 7px rgba(236,72,153,0.6),
    0 0 10px rgba(236,72,153,0.4),
    0 0 21px rgba(236,72,153,0.3),
    0 0 42px rgba(236,72,153,0.3),
    0 0 82px rgba(236,72,153,0.2);
}

.neon-glow-gold {
  text-shadow:
    0 0 7px rgba(245,158,11,0.6),
    0 0 10px rgba(245,158,11,0.4),
    0 0 21px rgba(245,158,11,0.3),
    0 0 42px rgba(245,158,11,0.3),
    0 0 82px rgba(245,158,11,0.2);
}

.neon-glow-multi {
  text-shadow:
    0 0 7px #fff,
    0 0 10px #fff,
    0 0 21px #fff,
    0 0 42px #0fa,
    0 0 82px #0fa,
    0 0 92px #f0f,
    0 0 102px #f0f,
    0 0 151px #f0f;
}

/* ─── Story Viewer Enhanced Styles ─── */
.sv-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sv-animated-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(139,92,246,0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(236,72,153,0.1) 0%, transparent 50%);
  animation: svBgPulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes svBgPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.sv-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  max-height: 750px;
  background: #111;
  overflow: hidden;
  cursor: default;
  border-radius: 0;
}

@media (min-width: 500px) {
  .sv-container { border-radius: 16px; max-height: 80vh; }
}

.sv-tap-left, .sv-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  z-index: 10;
  cursor: pointer;
}
.sv-tap-left { left: 0; }
.sv-tap-right { right: 0; }

.sv-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
  padding: 12px 12px 40px;
}

.sv-progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.sv-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}

.sv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), #ec4899);
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  width: 0%;
  border-radius: 3px;
}

@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sv-progress.active .sv-progress-fill {
  animation: progressShimmer 2s linear infinite, progressFill 5s linear forwards;
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

.sv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sv-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.sv-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.sv-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.sv-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sv-counter {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.sv-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.sv-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sv-body {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sv-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sv-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: svImageIn 0.3s ease;
}

@keyframes svImageIn {
  from { opacity: 0; transform: scale(1.1); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Story Text with Neon Glow ─── */
.sv-text {
  position: absolute;
  bottom: 50px;
  left: 20px;
  right: 20px;
  font-size: 1.1rem;
  line-height: 1.6;
  text-align: center;
  padding: 18px 22px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  animation: svTextIn 0.4s ease;
  font-weight: 600;
}

.sv-text.glow-white {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px rgba(255,255,255,0.8),
    0 0 10px rgba(255,255,255,0.5),
    0 0 21px rgba(255,255,255,0.3),
    0 0 42px rgba(59,130,246,0.4),
    0 0 82px rgba(139,92,246,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

.sv-text.glow-cyan {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px rgba(6,182,212,0.8),
    0 0 10px rgba(6,182,212,0.5),
    0 0 21px rgba(6,182,212,0.3),
    0 0 42px rgba(6,182,212,0.4);
}

.sv-text.glow-purple {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px rgba(168,85,247,0.8),
    0 0 10px rgba(168,85,247,0.5),
    0 0 21px rgba(168,85,247,0.3),
    0 0 42px rgba(168,85,247,0.4);
}

.sv-text.glow-pink {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px rgba(236,72,153,0.8),
    0 0 10px rgba(236,72,153,0.5),
    0 0 21px rgba(236,72,153,0.3),
    0 0 42px rgba(236,72,153,0.4);
}

.sv-text.glow-gold {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px rgba(245,158,11,0.8),
    0 0 10px rgba(245,158,11,0.5),
    0 0 21px rgba(245,158,11,0.3),
    0 0 42px rgba(245,158,11,0.4);
}

.sv-text.glow-multi {
  color: #fff;
  background: rgba(0,0,0,0.35);
  text-shadow:
    0 0 7px #fff,
    0 0 10px #fff,
    0 0 21px #fff,
    0 0 42px #0fa,
    0 0 82px #f0f,
    0 0 102px #f0f;
  animation: svTextGlowPulse 2s ease-in-out infinite;
}

@keyframes svTextGlowPulse {
  0%, 100% { text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, 0 0 42px #0fa, 0 0 82px #f0f; }
  50% { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 50px #0fa, 0 0 100px #f0f, 0 0 120px #f0f; }
}

@keyframes svTextIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Enhanced Story Creator Modal ─── */
.sc-preview {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  text-align: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: background 0.5s ease;
}

.sc-preview.has-image {
  background-size: cover !important;
  background-position: center !important;
}

.sc-preview-text {
  position: relative;
  z-index: 2;
  font-weight: 600;
  line-height: 1.5;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.sc-bg-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sc-bg-opt {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  position: relative;
}

.sc-bg-opt:hover { transform: scale(1.15); }
.sc-bg-opt.active { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.4); }

.sc-bg-opt .check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  color: #fff;
  display: none;
}

.sc-bg-opt.active .check { display: block; }

/* ─── Emoji Quick Pick ─── */
.sc-emoji-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scrollbar-width: none;
}

.sc-emoji-bar::-webkit-scrollbar { display: none; }

.sc-emoji-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.sc-emoji-btn:hover {
  background: var(--bg-card-hover);
  transform: scale(1.2);
}

/* ─── Modal (shared) ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; display:flex;align-items:center;gap:8px; }
.modal-close { background:none;border:none;color:var(--text-secondary);font-size:1.3rem;cursor:pointer;padding:4px 8px;border-radius:4px; }
.modal-close:hover { background:var(--bg-card-hover); }
.modal-body { padding: 20px; }

/* ─── Glow Button ─── */
.btn-glow {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
  color: white;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: btnGlowShimmer 3s ease infinite;
}

@keyframes btnGlowShimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .sidebar-spacer { width: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .topbar-mobile { display: flex; }
  .main-content { padding-top: calc(var(--topbar-height) + 16px); }
  .app-layout { display: block; }
  .container { max-width: 100%; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .marketplace-toolbar { flex-direction: column; }
  .search-form { width: 100%; }
  .search-input { flex: 1; min-width: 0; }
  .install-form { flex-direction: column; align-items: stretch; }
  .install-form select { width: 100%; }
  .feed-post-actions { gap: 2px; }
  .feed-action-btn { font-size: 0.72rem; padding: 5px 6px; }
  .story-avatar { width: 52px; height: 52px; }
  .stories-bar { gap: 10px; }
  .create-post-tools { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-number { font-size: 1.3rem; }
  .create-post-card { border-radius: 0; margin-left: -16px; margin-right: -16px; }
  .feed-post { border-radius: 0; margin-left: -16px; margin-right: -16px; border-left: none; border-right: none; }
}

/* ─── Creadores: tira de tarjetas con scroll horizontal ───
   Mismo componente para landing y dashboard: funciona igual en PC
   (donde caben todas sin necesidad de scroll) y en celular (donde se
   desliza como las historias/stories-bar, que ya usa este mismo patrón). */
.creators-section { padding: 32px 16px 48px; }
.creators-section .section-title { text-align: center; margin-bottom: 18px; }

.creators-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px 2px 10px;
  max-width: 720px;
  margin: 0 auto;
  justify-content: flex-start;
}
.creators-strip::-webkit-scrollbar { display: none; }
@media (min-width: 640px) {
  .creators-strip { justify-content: center; flex-wrap: wrap; overflow: visible; }
}

.creator-tile {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.creator-tile:hover { border-color: var(--accent); transform: translateY(-2px); }

.creator-tile img.creator-tile-avatar {
  width: 84px;
  max-width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
}
.creator-tile-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.creator-tile-role {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.creator-tile-whatsapp {
  color: #25d366;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Historias: like / descarga / historial ─── */
.sv-bottom {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 5;
}
.sv-like-btn, .sv-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}
.sv-like-btn.liked { border-color: #ec4899; }
.sv-like-btn i, .sv-download-btn i { pointer-events: none; }

/* ═══ ELITE SKIN v2 ═══
   Capa de skin sobre el CSS base del panel Asta Bot.
   No modifica reglas existentes: se append al final para redefinir la
   apariencia (superficies, botones, inputs, tarjetas, nav, animaciones)
   con el "look profesional oscuro" elevado: azul-violeta (--primary /
   --accent) como acento, sombras suaves, bordes sutiles y micro-movimientos
   rápidos. Respeta prefers-reduced-motion. */

/* ─── Tokens del sistema de diseño ─── */
:root {
  --elite-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --elite-t: 160ms;
  --elite-t-slow: 300ms;
  --elite-surface-sheen: rgba(255, 255, 255, 0.022);
  --elite-border: rgba(255, 255, 255, 0.07);
  --elite-border-strong: rgba(255, 255, 255, 0.14);
  --elite-row-hover: rgba(99, 102, 241, 0.06);
  --elite-highlight: rgba(59, 130, 246, 0.08);
  --elite-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px -8px rgba(0, 0, 0, 0.4);
  --elite-shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 40px -12px rgba(0, 0, 0, 0.5);
  --elite-glow-primary: rgba(59, 130, 246, 0.35);
  --elite-glow-accent: rgba(139, 92, 246, 0.3);
  --elite-ring: 0 0 0 3px rgba(59, 130, 246, 0.28);
  --elite-nav-active: #7fb0ff;
  --elite-grad-accent: linear-gradient(135deg, #60a5fa 0%, var(--primary) 45%, var(--accent) 100%);
  --elite-bg-ambient-a: radial-gradient(620px 480px at 8% -6%, rgba(59, 130, 246, 0.07), transparent 65%);
  --elite-bg-ambient-b: radial-gradient(720px 540px at 102% 102%, rgba(139, 92, 246, 0.06), transparent 60%);
}

:root[data-theme="light"] {
  --elite-surface-sheen: rgba(255, 255, 255, 0.55);
  --elite-border: rgba(16, 20, 35, 0.08);
  --elite-border-strong: rgba(16, 20, 35, 0.16);
  --elite-row-hover: rgba(37, 99, 235, 0.05);
  --elite-highlight: rgba(37, 99, 235, 0.07);
  --elite-shadow-1: 0 1px 2px rgba(16, 20, 35, 0.05), 0 6px 18px -10px rgba(16, 20, 35, 0.14);
  --elite-shadow-2: 0 2px 6px rgba(16, 20, 35, 0.06), 0 20px 40px -16px rgba(16, 20, 35, 0.2);
  --elite-glow-primary: rgba(37, 99, 235, 0.25);
  --elite-glow-accent: rgba(124, 58, 237, 0.22);
  --elite-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --elite-nav-active: var(--primary-hover);
  --elite-bg-ambient-a: radial-gradient(620px 480px at 8% -6%, rgba(37, 99, 235, 0.05), transparent 65%);
  --elite-bg-ambient-b: radial-gradient(720px 540px at 102% 102%, rgba(124, 58, 237, 0.05), transparent 60%);
}

/* ─── Base: fondo, selección, scrollbar ─── */
body {
  background-color: var(--bg-primary);
  background-image: var(--elite-bg-ambient-a), var(--elite-bg-ambient-b);
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

::selection { background: var(--primary-light); color: var(--text-primary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  border: 2px solid transparent;
  background-clip: content-box;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ─── Utilidades de entrada al scroll (web.js) ─── */
.elite-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--elite-ease) var(--elite-delay, 0ms),
              transform 500ms var(--elite-ease) var(--elite-delay, 0ms);
  will-change: opacity, transform;
}
.elite-visible { opacity: 1; transform: none; }

/* Escalonado sutil para grillas */
.stats-grid > .elite-reveal:nth-child(2) { --elite-delay: 50ms; }
.stats-grid > .elite-reveal:nth-child(3) { --elite-delay: 100ms; }
.stats-grid > .elite-reveal:nth-child(4) { --elite-delay: 150ms; }
.commands-grid > .elite-reveal:nth-child(2) { --elite-delay: 40ms; }
.commands-grid > .elite-reveal:nth-child(3) { --elite-delay: 80ms; }
.commands-grid > .elite-reveal:nth-child(4) { --elite-delay: 120ms; }
.features-grid > .elite-reveal:nth-child(2) { --elite-delay: 40ms; }
.features-grid > .elite-reveal:nth-child(3) { --elite-delay: 80ms; }
.subbots-cards-grid > .elite-reveal:nth-child(2) { --elite-delay: 40ms; }
.subbots-cards-grid > .elite-reveal:nth-child(3) { --elite-delay: 80ms; }
.creators-strip > .elite-reveal:nth-child(2) { --elite-delay: 40ms; }
.creators-strip > .elite-reveal:nth-child(3) { --elite-delay: 80ms; }
.creators-strip > .elite-reveal:nth-child(4) { --elite-delay: 120ms; }
.destacadas-scroll > .elite-reveal:nth-child(2) { --elite-delay: 30ms; }
.destacadas-scroll > .elite-reveal:nth-child(3) { --elite-delay: 60ms; }
.feed-container > .elite-reveal:nth-child(2) { --elite-delay: 30ms; }
.feed-container > .elite-reveal:nth-child(3) { --elite-delay: 60ms; }
.feed-container > .elite-reveal:nth-child(4) { --elite-delay: 90ms; }
.feed-container > .elite-reveal:nth-child(5) { --elite-delay: 120ms; }

/* Feedback táctil al pulsar (web.js añade .elite-pressed) */
.elite-pressed {
  transform: scale(0.98) !important;
  transition: transform 90ms ease !important;
}

/* ─── Sidebar ─── */
.sidebar {
  background-image: linear-gradient(180deg, var(--elite-surface-sheen), rgba(0, 0, 0, 0) 30%);
}
.sidebar-brand { letter-spacing: 0.3px; }
.sidebar-logo {
  background-image: var(--elite-grad-accent);
  box-shadow: 0 6px 16px -4px var(--elite-glow-accent), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.sidebar-logo-img {
  box-shadow: 0 4px 14px -4px var(--elite-glow-primary), 0 0 0 1px var(--border-light);
}
.sidebar-section-label { letter-spacing: 1.1px; opacity: 0.9; }
.sidebar-link {
  transition: background-color var(--elite-t) ease, color var(--elite-t) ease,
              transform var(--elite-t) var(--elite-ease) !important;
}
.sidebar-link:hover { background: var(--elite-highlight); color: var(--text-primary); }
.sidebar-link.active {
  background-image: linear-gradient(90deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.05), transparent);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
  color: var(--elite-nav-active);
}
.sidebar-link.active::before {
  width: 4px;
  height: 22px;
  background-image: var(--elite-grad-accent);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px var(--elite-glow-primary);
}
.sidebar-link.active .sidebar-link-icon {
  background-image: linear-gradient(135deg, var(--primary), var(--secondary));
}
.sidebar-sublink { border-left-color: var(--elite-border); }
.sidebar-user-link:hover { background: var(--elite-highlight); }

/* ─── Top bar móvil ─── */
.topbar-mobile {
  background: rgba(var(--elite-topbar-rgba, 13, 13, 18), 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
:root[data-theme="light"] { --elite-topbar-rgba: 255, 255, 255; }

/* ─── Botones ─── */
.btn {
  transition: transform var(--elite-t) var(--elite-ease), background-color var(--elite-t) ease,
              background-image var(--elite-t) ease, border-color var(--elite-t) ease,
              color var(--elite-t) ease, box-shadow var(--elite-t) ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 16px -6px var(--elite-glow-primary);
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px -8px var(--elite-glow-primary);
}
.btn-secondary {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%);
  box-shadow: 0 4px 14px -7px var(--elite-glow-primary);
}
.btn-secondary:hover { filter: brightness(1.06); }
.btn-danger {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%);
  box-shadow: 0 4px 14px -7px rgba(239, 68, 68, 0.5);
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-ghost { background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--elite-border-strong);
  color: var(--text-primary);
}
.btn-glow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Formularios / inputs / selects / textarea ─── */
.form-group label { font-weight: 600; }
.form-group input, .form-group textarea, .form-group select,
.input-sm, .search-input, .create-post-input, .quick-post-input,
.chat-input, .feed-comment-input, .create-post-input-wrap input,
.install-form select {
  transition: border-color var(--elite-t) ease, box-shadow var(--elite-t) ease,
              background-color var(--elite-t) ease;
}
.form-group input:hover, .form-group textarea:hover, .form-group select:hover,
.input-sm:hover, .search-input:hover, .create-post-input:hover,
.quick-post-input:hover, .chat-input:hover, .feed-comment-input:hover {
  border-color: var(--elite-border-strong);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus,
.input-sm:focus, .search-input:focus, .create-post-input:focus,
.quick-post-input:focus, .chat-input:focus, .feed-comment-input:focus {
  border-color: var(--primary);
  box-shadow: var(--elite-ring);
}
.form-group input:focus-visible, .form-group textarea:focus-visible,
.form-group select:focus-visible, .input-sm:focus-visible,
.search-input:focus-visible, .quick-post-input:focus-visible,
.create-post-input:focus-visible, .chat-input:focus-visible,
.feed-comment-input:focus-visible, .amigos-search input:focus-visible {
  outline: none;
}
.input-with-prefix {
  transition: border-color var(--elite-t) ease, box-shadow var(--elite-t) ease;
}
.input-with-prefix:focus-within { box-shadow: var(--elite-ring); }
.input-prefix {
  background: var(--bg-card);
  background-image: linear-gradient(180deg, var(--elite-surface-sheen), transparent);
}

/* ─── Alertas ─── */
.alert {
  border-radius: var(--radius);
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.12), var(--elite-shadow-1);
  animation: eliteAlertIn 320ms var(--elite-ease);
}
@keyframes eliteAlertIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.alert-success {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 var(--success), var(--elite-shadow-1);
}
.alert-error {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 var(--error), var(--elite-shadow-1);
}

/* ─── Tarjetas ─── */
.card {
  background-image: linear-gradient(180deg, var(--elite-surface-sheen), rgba(0, 0, 0, 0) 55%);
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--elite-border-strong);
  box-shadow: var(--elite-shadow-2);
}
.card-header {
  background-image: linear-gradient(180deg, var(--elite-surface-sheen), rgba(0, 0, 0, 0));
}
.card-danger:hover { border-color: rgba(239, 68, 68, 0.4); }

/* ─── Stat cards ─── */
.stat-card {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(180deg, var(--elite-surface-sheen), rgba(0, 0, 0, 0) 60%);
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background-image: var(--elite-grad-accent);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left;
  transition: opacity var(--elite-t) ease, transform var(--elite-t-slow) var(--elite-ease);
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--elite-border-strong);
  box-shadow: var(--elite-shadow-2);
}
.stat-card:hover::before { opacity: 1; transform: scaleX(1); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .stat-number {
    background-image: linear-gradient(180deg, var(--text-primary) 30%, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* ─── Page header ─── */
.page-header h1 { letter-spacing: -0.02em; }
.page-header h1 i { color: var(--primary); }
.page-header p { letter-spacing: 0.01em; }

/* ─── Badges ─── */
.badge {
  border: 1px solid transparent;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
}
.badge-primary {
  background-image: linear-gradient(180deg, var(--primary-light), rgba(0, 0, 0, 0));
  border-color: rgba(59, 130, 246, 0.2);
}
.badge-success { border-color: rgba(34, 197, 94, 0.24); }
.badge-warning { border-color: rgba(245, 158, 11, 0.28); }
.badge-error, .badge-danger { border-color: rgba(239, 68, 68, 0.28); }
.badge-info { border-color: rgba(6, 182, 212, 0.28); }
.badge-secondary { border-color: var(--elite-border); }

/* ─── Tablas ─── */
.table th { letter-spacing: 0.06em; }
.table td { border-color: var(--elite-border); }
.table tr:hover td { background: var(--elite-row-hover); }
.table-responsive { scrollbar-width: thin; }
.page .card .admin-table th { letter-spacing: 0.05em; }
.page .card .admin-table tr:hover td { background: var(--elite-row-hover); }

/* ─── Cards de features / marketplace / usuarios ─── */
.feature-card, .user-card {
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.feature-card:hover, .user-card:hover {
  transform: translateY(-3px);
  border-color: var(--elite-border-strong);
  box-shadow: var(--elite-shadow-2);
}
.market-card {
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.market-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--elite-shadow-2);
}
.market-category { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.marketplace-toolbar { box-shadow: var(--elite-shadow-1); border-color: var(--elite-border); }

/* ─── Toolbar de mercado: chips ─── */
.category-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform var(--elite-t) var(--elite-ease), background-color var(--elite-t) ease,
              border-color var(--elite-t) ease, color var(--elite-t) ease;
}
.category-chip:hover { transform: translateY(-1px); }
.category-chip:active { transform: scale(0.96); }

/* ─── Command cards / subbot mini ─── */
.command-card {
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.command-card:hover {
  border-color: var(--elite-border-strong);
  box-shadow: var(--elite-shadow-2);
}
.subbot-mini-card { border: 1px solid var(--elite-border); }

/* ─── Feed / dashboard social ─── */
.feed-post {
  box-shadow: var(--elite-shadow-1);
  transition: transform var(--elite-t) var(--elite-ease), box-shadow var(--elite-t) ease,
              border-color var(--elite-t) ease;
}
.feed-post:hover {
  transform: translateY(-2px);
  border-color: var(--elite-border-strong);
  box-shadow: var(--elite-shadow-2);
}
.feed-post-avatar {
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3px var(--border-light);
}
.feed-post-image { box-shadow: 0 2px 12px -6px rgba(0, 0, 0, 0.4); }
.feed-action-btn {
  transition: background-color var(--elite-t) ease, color var(--elite-t) ease,
              transform var(--elite-t) ease;
}
.feed-action-btn:active { transform: scale(0.94); }
.feed-action-btn.liked { text-shadow: 0 0 10px rgba(239, 68, 68, 0.45); }
.feed-comment-send, .chat-send-btn, .quick-post-btn {
  box-shadow: 0 4px 12px -5px var(--elite-glow-primary);
}
.quick-post, .create-post-card, .destacadas-section, .dash-sidebar {
  border-color: var(--elite-border);
  box-shadow: var(--elite-shadow-1);
}
.amigo-card:hover { background: var(--elite-highlight); }
.story-btn .story-avatar {
  box-shadow: 0 6px 18px -8px var(--elite-glow-accent);
}
.destacada-card:hover { box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45); }

/* ─── Modal ─── */
.modal-overlay {
  background: rgba(6, 8, 14, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-card {
  border-color: var(--elite-border-strong);
  box-shadow: 0 24px 70px -16px rgba(0, 0, 0, 0.55);
  animation: eliteModalIn 220ms var(--elite-ease);
}
@keyframes eliteModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  transition: background-color var(--elite-t) ease, color var(--elite-t) ease;
}

/* ─── Toast ─── */
.toast { border-radius: var(--radius); }

/* ─── Empty state ─── */
.empty-state i {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
  background: var(--bg-input);
  border: 1px solid var(--elite-border);
  color: var(--text-muted);
  opacity: 1;
  box-shadow: inset 0 1px 0 var(--elite-surface-sheen);
}
.empty-state h3 { letter-spacing: -0.01em; }

/* ─── Steps / métodos ─── */
.step-number, .method-number {
  background-image: linear-gradient(160deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 12px -4px var(--elite-glow-primary);
}
.info-item { border: 1px solid var(--elite-border); }

/* ─── Code block ─── */
.code-block {
  border-color: var(--elite-border);
  box-shadow: inset 0 1px 0 var(--elite-surface-sheen);
}

/* ─── Tiles de creadores ─── */
.creator-tile {
  box-shadow: var(--elite-shadow-1);
  transition: border-color 160ms ease, transform var(--elite-t) var(--elite-ease),
              box-shadow var(--elite-t) ease;
}
.creator-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--elite-shadow-2);
}

/* ─── Auth ─── */
.auth-card { box-shadow: 0 24px 80px -20px rgba(0, 0, 0, 0.55) !important; }
:root[data-theme="light"] .auth-card { box-shadow: 0 24px 70px -24px rgba(16, 20, 35, 0.25) !important; }
.auth-theme-toggle button.active {
  background-image: linear-gradient(135deg, var(--primary), var(--secondary));
}
.auth-status-dot { box-shadow: 0 0 0 3px var(--success-light), 0 0 12px rgba(34, 197, 94, 0.4); }

/* ─── Footer ─── */
.footer { border-top-color: var(--elite-border); }
.footer-version { border: 1px solid var(--elite-border); }

/* ─── Acentos muy contenidos ─── */
.chat-btn:hover i { color: var(--info); }
.sidebar-footer {
  background-image: linear-gradient(180deg, transparent, var(--elite-surface-sheen));
}

/* ─── Responsive: ajustes para que la skin no estorbe en móvil ─── */
@media (max-width: 480px) {
  .card:hover, .feed-post:hover, .stat-card:hover, .market-card:hover,
  .feature-card:hover, .user-card:hover, .creator-tile:hover,
  .command-card:hover { transform: none; }
  .btn:hover { transform: none; }
}

/* ─── Accesibilidad: respeta prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .elite-reveal { opacity: 1 !important; transform: none !important; }
  .elite-visible { opacity: 1 !important; transform: none !important; }
}
