/* ============================================
   TSUNAGU — GLOBAL STYLES
   ============================================ */

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

:root {
  --primary: #6C47FF;
  --primary-dark: #5235D4;
  --primary-light: #EEE9FF;
  --accent: #FF6B6B;
  --accent2: #FFB547;
  --success: #22C55E;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  --bg: #F4F6FB;
  --bg2: #ECEEF5;
  --sidebar-bg: #0F0F1A;
  --sidebar-text: #B0B3C6;
  --sidebar-active: #FFFFFF;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-accent: #6C47FF;
  --card: #FFFFFF;
  --card-border: #E8EAF2;
  --text: #1A1C2E;
  --text-2: #4A4D65;
  --text-3: #8B8FA8;
  --text-4: #B0B3C6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15), 0 16px 48px rgba(0,0,0,0.08);
  --sidebar-w: 248px;
  --header-h: 64px;
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
}

html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.83rem; }
.text-xs { font-size: 0.73rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.3rem; }
.text-2xl { font-size: 1.6rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 999px; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid { display: grid; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

/* ============================================
   LANDING PAGE
   ============================================ */
#landing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F0F1A 0%, #1a1040 50%, #0F0F1A 100%);
  color: #fff;
}

.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 70px;
  background: rgba(15,15,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.landing-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.landing-nav-links {
  display: flex; align-items: center; gap: 32px;
  list-style: none;
}

.landing-nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
}
.landing-nav-links a:hover { color: #fff; }

.landing-nav-actions { display: flex; align-items: center; gap: 12px; }

/* Hero */
.landing-hero {
  padding: 140px 40px 80px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(108,71,255,0.2);
  border: 1px solid rgba(108,71,255,0.4);
  color: #a78bfa;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-badge .dot {
  width: 7px; height: 7px;
  background: #a78bfa;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #6C47FF, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 40px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-platforms {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 48px;
}

.platform-chip {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  cursor: default;
}

.platform-chip:hover {
  background: rgba(108,71,255,0.15);
  border-color: rgba(108,71,255,0.4);
  color: #fff;
}

.platform-chip .platform-icon {
  width: 18px; height: 18px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}

/* Landing features */
.landing-section {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  background: rgba(108,71,255,0.15);
  color: #a78bfa;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  max-width: 540px;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.25s;
}

.feature-card:hover {
  background: rgba(108,71,255,0.08);
  border-color: rgba(108,71,255,0.25);
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-desc { color: rgba(255,255,255,0.55); font-size: 0.875rem; line-height: 1.6; }

/* Stats */
.landing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 60px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.stat-label { color: rgba(255,255,255,0.5); font-size: 0.85rem; margin-top: 4px; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.pricing-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 32px 28px;
  position: relative;
  transition: all 0.25s;
}

.pricing-card.featured {
  background: linear-gradient(135deg, rgba(108,71,255,0.2), rgba(168,85,247,0.1));
  border-color: rgba(108,71,255,0.5);
}

.pricing-card .badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  color: #fff;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.pricing-name { font-size: 0.9rem; font-weight: 700; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.pricing-price { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.03em; }
.pricing-price span { font-size: 1rem; font-weight: 500; color: rgba(255,255,255,0.5); }
.pricing-desc { color: rgba(255,255,255,0.5); font-size: 0.85rem; margin: 10px 0 20px; }
.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.875rem; color: rgba(255,255,255,0.75); border-bottom: 1px solid rgba(255,255,255,0.05); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li i { color: var(--success); font-size: 0.75rem; width: 16px; }

/* Landing footer */
.landing-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 40px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
}

.landing-footer .footer-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
  display: block;
}

/* ============================================
   AUTH PAGES
   ============================================ */
#auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F0F1A 0%, #1a1040 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

#auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,71,255,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}

#auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 900; color: #fff; cursor: pointer;
}

.auth-logo .logo-mark .icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 8px 24px rgba(108,71,255,0.4);
}

.auth-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 36px;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.45);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.social-auth-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.social-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input::placeholder { color: rgba(255,255,255,0.25); }
.form-input:focus { border-color: rgba(108,71,255,0.6); background: rgba(108,71,255,0.05); }

.form-input-light {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input-light:focus { border-color: var(--primary); background: #fff; }
.form-input-light::placeholder { color: var(--text-3); }

.form-select {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
.form-select:focus { border-color: var(--primary); }

.form-textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
  transition: border-color 0.2s;
}
.form-textarea:focus { border-color: var(--primary); background: #fff; }
.form-textarea::placeholder { color: var(--text-3); }

.auth-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

.auth-footer-text a, .auth-link {
  color: #a78bfa;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.auth-footer-text a:hover, .auth-link:hover { color: #fff; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.975); }

.btn-primary {
  background: linear-gradient(135deg, #6C47FF, #8B5CF6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108,71,255,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,71,255,0.45); }

.btn-secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1.5px solid var(--card-border);
}
.btn-secondary:hover { background: var(--card-border); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--card-border);
}
.btn-ghost:hover { background: var(--bg2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); color: #fff; }
.btn-white {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.btn-white:hover { background: rgba(255,255,255,0.18); }

.btn-outline-white {
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.08); color: #fff; }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-xs { padding: 5px 10px; font-size: 0.75rem; }
.btn-icon { padding: 9px; width: 36px; height: 36px; }
.btn-icon-sm { padding: 6px; width: 28px; height: 28px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ============================================
   APP SHELL
   ============================================ */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 50;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
  cursor: pointer;
}

.sidebar-logo-icon {
  width: 36px; height: 36px; min-width: 36px;
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(108,71,255,0.3);
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  line-height: 1.1;
}

.sidebar-logo-text small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 12px;
  overflow-y: auto;
}

.sidebar-section {
  padding: 12px 8px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.22);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }

.nav-item.active {
  background: rgba(108,71,255,0.18);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  width: 18px;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.8;
}

.nav-item.active i { opacity: 1; color: var(--primary); }
.nav-item:hover i { opacity: 1; }

.nav-label { font-size: 0.855rem; font-weight: 500; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
}

.nav-badge-primary {
  background: rgba(108,71,255,0.25);
  color: var(--primary);
}

/* Workspace selector */
.workspace-selector {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}

.workspace-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.workspace-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.workspace-avatar {
  width: 30px; height: 30px; min-width: 30px;
  background: linear-gradient(135deg, #6C47FF, #a855f7);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.workspace-name { font-size: 0.83rem; font-weight: 600; flex: 1; min-width: 0; }
.workspace-plan { font-size: 0.68rem; color: rgba(255,255,255,0.35); white-space: nowrap; }

/* User section */
.sidebar-user {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.user-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C47FF, #ec4899);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  min-width: 32px;
  overflow: hidden;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.83rem; font-weight: 600; color: rgba(255,255,255,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.7rem; color: rgba(255,255,255,0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244,246,251,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-3);
}

.breadcrumb span { color: var(--text-2); font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 10px; }

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 38px;
  min-width: 220px;
  transition: border-color 0.2s;
}

.search-bar input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  flex: 1;
}

.search-bar input::placeholder { color: var(--text-3); }
.search-bar:focus-within { border-color: var(--primary); }
.search-bar i { color: var(--text-3); font-size: 0.8rem; }

/* Notification badge */
.notif-btn {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
  font-size: 0.9rem;
}
.notif-btn:hover { background: var(--bg2); color: var(--primary); border-color: var(--primary); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card);
}

/* Page wrapper */
.page-wrapper {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 2px;
}

.card-body { padding: 18px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card-light {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.stat-label-s {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 4px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
}

.stat-change.up { background: var(--success-bg); color: var(--success); }
.stat-change.down { background: var(--danger-bg); color: var(--danger); }
.stat-change.neutral { background: var(--bg2); color: var(--text-3); }

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
  gap: 16px;
}

.dashboard-grid .col-span-2 { grid-column: span 2; }
.dashboard-grid .col-span-3 { grid-column: span 3; }
.dashboard-grid .col-span-full { grid-column: 1 / -1; }

/* Quick actions */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.quick-action-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  box-shadow: var(--shadow);
}

.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.quick-action-btn i { font-size: 0.9rem; }

/* Recent posts */
.post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg2);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
}

.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--bg); padding-left: 8px; }

.post-platform-icon {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.post-content { flex: 1; min-width: 0; }
.post-text { font-size: 0.85rem; color: var(--text); font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; }
.post-meta span { display: flex; align-items: center; gap: 4px; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-neutral { background: var(--bg2); color: var(--text-2); }
.badge-purple { background: #F3F0FF; color: #6C47FF; }

/* ============================================
   CALENDAR
   ============================================ */
.calendar-wrapper {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.calendar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-nav { display: flex; gap: 6px; }
.cal-nav-btn {
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-2);
  transition: all 0.2s;
  font-family: inherit;
}

.cal-nav-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--card-border);
}

.cal-day-header {
  padding: 10px 4px;
  text-align: center;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.cal-day {
  min-height: 110px;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.cal-day:hover { background: var(--bg); }
.cal-day.today { background: #FFF8FF; }
.cal-day.today .cal-day-num { background: var(--primary); color: #fff; }
.cal-day.other-month { background: var(--bg); opacity: 0.5; }

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.cal-post-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cal-post-pill:hover { opacity: 0.85; }
.cal-post-pill.published { background: var(--success-bg); color: var(--success); }
.cal-post-pill.scheduled { background: var(--info-bg); color: var(--info); }
.cal-post-pill.draft { background: var(--bg2); color: var(--text-3); }
.cal-post-pill.failed { background: var(--danger-bg); color: var(--danger); }
.cal-post-pill.pending { background: var(--warning-bg); color: var(--warning); }

.cal-more {
  font-size: 0.68rem;
  color: var(--text-3);
  padding: 2px 4px;
  cursor: pointer;
}

/* ============================================
   POST COMPOSER
   ============================================ */
.composer-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

.composer-main { /* main compose area */ }

.platform-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--card-border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s;
  font-family: inherit;
}

.platform-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.platform-btn.selected { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.platform-btn .picon { font-size: 0.85rem; }

.compose-area {
  padding: 16px 20px;
}

.compose-textarea {
  width: 100%;
  min-height: 160px;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--text);
  background: transparent;
  line-height: 1.7;
}

.compose-textarea::placeholder { color: var(--text-3); }

.char-counter {
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: right;
  margin-top: 4px;
}

.char-counter.warning { color: var(--warning); }
.char-counter.danger { color: var(--danger); }

.compose-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border-top: 1px solid var(--card-border);
}

.toolbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: all 0.2s;
}

.toolbar-btn:hover { background: var(--bg2); color: var(--primary); }

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  background: var(--bg);
}

/* Preview card */
.preview-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg);
  overflow-x: auto;
}

.preview-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.preview-tab:hover { color: var(--text); }
.preview-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.preview-content { padding: 16px; }

/* ============================================
   ANALYTICS
   ============================================ */
.analytics-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.date-range-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.date-range-btn:hover { border-color: var(--primary); color: var(--primary); }
.date-range-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.chart-wrapper {
  position: relative;
  height: 280px;
}

.chart-wrapper canvas { max-height: 100%; }

/* Platform breakdown */
.platform-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg2);
}

.platform-row:last-child { border-bottom: none; }

.platform-row-icon {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.platform-row-info { flex: 1; min-width: 0; }
.platform-row-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.platform-row-meta { font-size: 0.75rem; color: var(--text-3); }

.platform-bar-wrap {
  width: 100px;
}

.platform-bar {
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}

.platform-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.platform-row-value { font-size: 0.85rem; font-weight: 700; color: var(--text); width: 60px; text-align: right; }

/* Top posts table */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--bg2);
  color: var(--text-2);
  vertical-align: middle;
}

tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }

.td-post { max-width: 300px; }
.td-post .post-preview-text { font-size: 0.82rem; color: var(--text); font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ============================================
   SOCIAL ACCOUNTS / CHANNELS
   ============================================ */
.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.channel-card {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  position: relative;
}

.channel-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

.channel-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }

.channel-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 0.95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-handle { font-size: 0.78rem; color: var(--text-3); margin-top: 1px; }

.channel-status { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 0.8rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.connected { background: var(--success); }
.status-dot.expiring { background: var(--warning); }
.status-dot.expired { background: var(--danger); }
.status-dot.reconnect { background: var(--danger); animation: blink 1.5s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.channel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }

.channel-stat {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.channel-stat-val { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.channel-stat-lbl { font-size: 0.68rem; color: var(--text-3); margin-top: 1px; }

/* Connect provider grid */
.providers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.provider-card {
  background: var(--card);
  border: 1.5px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.provider-card:hover {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.provider-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 10px;
}

.provider-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.provider-desc { font-size: 0.75rem; color: var(--text-3); margin-top: 3px; }

/* ============================================
   AI STUDIO
   ============================================ */
.ai-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px - 70px);
  min-height: 400px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }

.chat-avatar {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}

.chat-avatar.ai { background: linear-gradient(135deg, #6C47FF, #a855f7); color: #fff; }
.chat-avatar.user { background: linear-gradient(135deg, #3B82F6, #06b6d4); color: #fff; }

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 100%;
}

.chat-msg.ai .chat-bubble {
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #6C47FF, #8B5CF6);
  color: #fff;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
}

.chat-input-row {
  padding: 14px 16px;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg);
}

.chat-input {
  flex: 1;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--card);
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--primary); }

/* AI prompt suggestions */
.prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px;
}

.prompt-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}

.prompt-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================
   TEAM / MEMBERS
   ============================================ */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg2);
}

.member-row:last-child { border-bottom: none; }

.member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  min-width: 40px;
}

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.member-email { font-size: 0.78rem; color: var(--text-3); }
.member-role { font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* Role colors */
.role-owner { background: #FEF3C7; color: #D97706; }
.role-admin { background: var(--danger-bg); color: var(--danger); }
.role-manager { background: var(--info-bg); color: var(--info); }
.role-creator { background: var(--primary-light); color: var(--primary); }
.role-viewer { background: var(--bg2); color: var(--text-2); }

/* ============================================
   MEDIA LIBRARY
   ============================================ */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

.media-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--card-border);
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 1;
}

.media-item:hover { border-color: var(--primary); transform: scale(1.02); box-shadow: var(--shadow-md); }

.media-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.media-item .media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108,71,255,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.media-item:hover .media-overlay { display: flex; }

.media-item .media-type-icon {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 4px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideUp 0.2s ease;
}

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

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.modal-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  max-width: 360px;
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast-default .toast-icon { color: var(--primary); }

.toast-msg { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.toast-title { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.toast-close { margin-left: auto; color: var(--text-3); cursor: pointer; font-size: 0.8rem; }

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .tab-count { background: var(--bg2); color: var(--text-3); font-size: 0.7rem; padding: 2px 6px; border-radius: 999px; }
.tab.active .tab-count { background: var(--primary-light); color: var(--primary); }

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--card-border) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state-desc { font-size: 0.875rem; color: var(--text-3); margin-bottom: 20px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ============================================
   PROGRESS / STEPS
   ============================================ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--card-border);
  color: var(--text-3);
  background: var(--card);
  flex-shrink: 0;
  transition: all 0.2s;
}

.step.active .step-circle { border-color: var(--primary); color: var(--primary); }
.step.done .step-circle { border-color: var(--success); background: var(--success); color: #fff; }

.step-label { font-size: 0.75rem; font-weight: 600; color: var(--text-3); margin-left: 8px; white-space: nowrap; }
.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--success); }

.step-line { flex: 1; height: 2px; background: var(--card-border); margin: 0 8px; }
.step.done + .step .step-line { background: var(--success); }

/* ============================================
   DROPDOWN MENUS
   ============================================ */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
  animation: dropIn 0.15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-divider { height: 1px; background: var(--card-border); margin: 4px 0; }

/* ============================================
   PLATFORM COLORS
   ============================================ */
.plat-instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.plat-facebook { background: #1877F2; color: #fff; }
.plat-twitter, .plat-x { background: #000; color: #fff; }
.plat-linkedin { background: #0A66C2; color: #fff; }
.plat-tiktok { background: #010101; color: #fff; }
.plat-youtube { background: #FF0000; color: #fff; }
.plat-pinterest { background: #E60023; color: #fff; }
.plat-reddit { background: #FF4500; color: #fff; }
.plat-bluesky { background: #0085FF; color: #fff; }
.plat-threads { background: #000; color: #fff; }
.plat-mastodon { background: #6364FF; color: #fff; }
.plat-discord { background: #5865F2; color: #fff; }
.plat-slack { background: #4A154B; color: #fff; }
.plat-telegram { background: #26A5E4; color: #fff; }
.plat-whatsapp { background: #25D366; color: #fff; }
.plat-google { background: #EA4335; color: #fff; }
.plat-default { background: var(--primary); color: #fff; }

/* platform icon light variants */
.plat-instagram-light { background: #FFF0F5; color: #E1306C; }
.plat-facebook-light { background: #EFF5FF; color: #1877F2; }
.plat-twitter-light, .plat-x-light { background: #F0F0F0; color: #000; }
.plat-linkedin-light { background: #EBF4FB; color: #0A66C2; }
.plat-tiktok-light { background: #F0F0F0; color: #010101; }
.plat-youtube-light { background: #FFF0F0; color: #FF0000; }

/* ============================================
   TAGS / PILLS
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--bg2);
  color: var(--text-2);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-removable { cursor: pointer; }
.tag-removable:hover { background: var(--danger-bg); color: var(--danger); }

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--card-border);
  border-radius: 999px;
  transition: 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================
   NOTIFICATIONS PANEL
   ============================================ */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg2);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #e6e0ff; }

.notif-icon {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

.notif-content .notif-title { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.notif-content .notif-text { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.notif-content .notif-time { font-size: 0.7rem; color: var(--text-4); margin-top: 4px; }

/* ============================================
   SETTINGS
   ============================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

.settings-nav {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
  height: fit-content;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.settings-nav-item i { width: 18px; text-align: center; font-size: 0.85rem; }

/* ============================================
   REPORT BUILDER
   ============================================ */
.report-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.report-header { margin-bottom: 20px; }
.report-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
.report-metric { text-align: center; padding: 16px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.report-metric .rm-value { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.report-metric .rm-label { font-size: 0.73rem; color: var(--text-3); margin-top: 3px; }

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(108,71,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-overlay .spinner { width: 40px; height: 40px; border-width: 3px; }
.loading-overlay span { font-size: 0.875rem; color: var(--text-2); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid .col-span-2 { grid-column: span 2; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .sidebar-logo-text, .nav-label, .nav-badge, .workspace-name, .workspace-plan, .user-info { display: none; }
  .sidebar-logo { justify-content: center; padding: 16px 10px; }
  .workspace-btn { justify-content: center; }
  .user-btn { justify-content: center; }
  .sidebar-section { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item::before { display: none; }
  .nav-item.active { background: rgba(108,71,255,0.15); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .col-span-2 { grid-column: span 1; }
  .composer-container { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .landing-hero { padding: 120px 20px 60px; }
  .landing-nav { padding: 0 20px; }
  .landing-nav-links { display: none; }
  .page-wrapper { padding: 16px 16px; }
  .top-header { padding: 0 16px; }
  .search-bar { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .analytics-filters { gap: 6px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   MISC
   ============================================ */
.divider-v { width: 1px; background: var(--card-border); align-self: stretch; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.chip-primary { background: var(--primary-light); color: var(--primary); }
.chip-success { background: var(--success-bg); color: var(--success); }
.chip-warning { background: var(--warning-bg); color: var(--warning); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-neutral { background: var(--bg2); color: var(--text-3); }

.hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.glass-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
}

.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, #6C47FF, #a855f7, #ec4899);
  z-index: -1;
}

/* Drag target */
.drag-target {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.drag-target:hover, .drag-target.dragging {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drag-target i { font-size: 2rem; color: var(--text-3); margin-bottom: 12px; display: block; }
.drag-target p { font-size: 0.875rem; color: var(--text-3); }
.drag-target p strong { color: var(--primary); }

/* Approval panel */
.approval-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s;
}

.approval-card:hover { box-shadow: var(--shadow-md); }
.approval-card.pending { border-left: 4px solid var(--warning); }
.approval-card.approved { border-left: 4px solid var(--success); }
.approval-card.rejected { border-left: 4px solid var(--danger); }

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 200;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  line-height: 1;
}

.lang-light .lang-btn {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.lang-light .lang-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lang-dark .lang-btn {
  background: var(--bg-secondary, #f0f0f4);
  border-color: var(--card-border, #e2e8f0);
  color: var(--text, #1a202c);
}

.lang-dark .lang-btn:hover {
  background: var(--bg-hover, #e8e8f0);
  border-color: var(--primary, #6366f1);
  box-shadow: 0 2px 8px rgba(99,102,241,0.15);
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-name {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-chevron {
  font-size: 0.6rem;
  margin-left: 2px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.lang-switcher.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--card, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  padding: 4px;
  z-index: 300;
  animation: langDropIn 0.15s ease;
}

@keyframes langDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.lang-dropdown.hidden {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text, #1a202c);
  transition: background 0.12s;
  white-space: nowrap;
}

.lang-option:hover {
  background: var(--bg-hover, #f0f0f8);
  color: var(--primary, #6366f1);
}

.lang-option.active {
  background: var(--primary-light, #eef2ff);
  color: var(--primary, #6366f1);
  font-weight: 600;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-enter {
  animation: pageEnter 0.2s ease;
}

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

/* ============================================
   DARK MODE — CSS VARIABLE OVERRIDES
   Applied by adding class="dark" to <html>
   ============================================ */
html.dark {
  --bg:           #0f0f18;
  --bg2:          #181824;
  --sidebar-bg:   #08080f;
  --sidebar-text: #9094ac;
  --sidebar-hover: rgba(255,255,255,0.06);
  --card:         #1a1a28;
  --card-border:  #2a2a40;
  --text:         #e8eaf2;
  --text-2:       #b0b3c8;
  --text-3:       #6b6e87;
  --text-4:       #4a4d65;
  --primary-light: #2a2060;
  --success-bg:   #0d2e1c;
  --warning-bg:   #2e200a;
  --danger-bg:    #2e0f0f;
  --info-bg:      #0a1e38;
  --shadow: 0 1px 4px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5), 0 16px 48px rgba(0,0,0,0.3);
}

html.dark body {
  background: var(--bg);
  color: var(--text);
}

/* Dark mode: cards and surfaces */
html.dark .card {
  background: var(--card);
  border-color: var(--card-border);
}

html.dark .card-header {
  background: var(--card);
  border-bottom-color: var(--card-border);
}

html.dark .card-footer {
  background: var(--card);
  border-top-color: var(--card-border);
}

/* Dark mode: form elements */
html.dark .form-input-light,
html.dark .form-select,
html.dark .form-textarea {
  background: var(--bg2);
  border-color: var(--card-border);
  color: var(--text);
}

html.dark .form-input-light:focus,
html.dark .form-select:focus,
html.dark .form-textarea:focus {
  border-color: var(--primary);
  background: var(--bg2);
}

html.dark .form-input-light::placeholder,
html.dark .form-textarea::placeholder {
  color: var(--text-4);
}

/* Dark mode: form select options (browser-native) */
html.dark select option {
  background: var(--bg2);
  color: var(--text);
}

/* Dark mode: shell header */
html.dark .shell-header {
  background: var(--card);
  border-bottom-color: var(--card-border);
}

/* Dark mode: shell main */
html.dark .shell-main {
  background: var(--bg);
}

/* Dark mode: sidebar */
html.dark .sidebar {
  background: var(--sidebar-bg);
}

/* Dark mode: header search */
html.dark .header-search {
  background: var(--bg2);
  border-color: var(--card-border);
}

html.dark .header-search input {
  color: var(--text);
  background: transparent;
}

html.dark .header-search input::placeholder {
  color: var(--text-4);
}

/* Dark mode: buttons */
html.dark .btn-ghost {
  color: var(--text-2);
}

html.dark .btn-ghost:hover {
  background: var(--bg2);
  color: var(--text);
}

html.dark .btn-white {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--card-border);
}

/* Dark mode: dropdowns */
html.dark .dropdown-menu {
  background: var(--card);
  border-color: var(--card-border);
  box-shadow: var(--shadow-md);
}

html.dark .dropdown-item {
  color: var(--text-2);
}

html.dark .dropdown-item:hover {
  background: var(--bg2);
  color: var(--text);
}

html.dark .dropdown-divider {
  border-color: var(--card-border);
}

/* Dark mode: modals */
html.dark .modal-backdrop {
  background: rgba(0,0,0,0.7);
}

html.dark .modal {
  background: var(--card);
  border-color: var(--card-border);
}

html.dark .modal-header {
  border-bottom-color: var(--card-border);
}

html.dark .modal-footer {
  border-top-color: var(--card-border);
  background: var(--bg2);
}

/* Dark mode: toast */
html.dark .toast {
  background: var(--card);
  border-color: var(--card-border);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

/* Dark mode: badges */
html.dark .badge-default {
  background: var(--bg2);
  color: var(--text-3);
}

/* Dark mode: settings nav */
html.dark .settings-nav {
  background: var(--card);
  border-color: var(--card-border);
}

html.dark .settings-nav-item {
  color: var(--text-3);
}

html.dark .settings-nav-item:hover {
  background: var(--bg2);
  color: var(--text);
}

html.dark .settings-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Dark mode: stat cards */
html.dark .stat-card {
  background: var(--card);
  border-color: var(--card-border);
}

/* Dark mode: table / media grid */
html.dark .media-item {
  background: var(--card);
  border-color: var(--card-border);
}

/* Dark mode: calendar */
html.dark .cal-grid .cal-day {
  background: var(--card);
  border-color: var(--card-border);
  color: var(--text);
}

html.dark .cal-grid .cal-day.other-month {
  background: var(--bg2);
  color: var(--text-4);
}

html.dark .cal-grid .cal-day.today {
  background: rgba(108, 71, 255, 0.15);
}

/* Dark mode: landing page sections */
html.dark .landing-nav {
  background: rgba(10, 10, 20, 0.95);
  border-color: var(--card-border);
}

html.dark .landing-footer {
  background: #06060e;
}

/* Dark mode: platform grid on landing */
html.dark .platform-badge {
  background: var(--bg2);
  border-color: var(--card-border);
  color: var(--text-2);
}

/* Dark mode: pricing cards */
html.dark .pricing-card {
  background: var(--card);
  border-color: var(--card-border);
}

/* Dark mode: code blocks */
html.dark code {
  background: var(--bg2);
  color: var(--text-2);
  border-color: var(--card-border);
}

/* Dark mode: hr / dividers */
html.dark hr {
  border-color: var(--card-border);
}

/* Dark mode: lang switcher */
html.dark .lang-dropdown {
  background: var(--card);
  border-color: var(--card-border);
  box-shadow: var(--shadow-md);
}

html.dark .lang-option {
  color: var(--text-2);
}

html.dark .lang-option:hover {
  background: var(--bg2);
  color: var(--primary);
}

html.dark .lang-option.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Dark mode: member rows */
html.dark .member-row {
  border-bottom-color: var(--card-border);
}

/* Dark mode: approval items */
html.dark .approval-item {
  background: var(--card);
  border-color: var(--card-border);
}

/* Dark mode: composer panels */
html.dark .composer-left,
html.dark .composer-right {
  background: var(--card);
  border-color: var(--card-border);
}

html.dark .platform-btn {
  background: var(--bg2);
  border-color: var(--card-border);
  color: var(--text-2);
}

html.dark .platform-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Dark mode: channel cards */
html.dark .channel-card {
  background: var(--card);
  border-color: var(--card-border);
}

/* Dark mode: AI Studio */
html.dark .chat-bubble-ai {
  background: var(--bg2);
  color: var(--text);
}

html.dark .chat-bubble-user {
  background: var(--primary);
  color: #fff;
}

/* Dark mode: notification panel */
html.dark .notif-panel {
  background: var(--card);
  border-color: var(--card-border);
  box-shadow: var(--shadow-md);
}

html.dark .notif-item {
  border-bottom-color: var(--card-border);
}

html.dark .notif-item:hover {
  background: var(--bg2);
}

/* Dark mode: password strength bar background */
html.dark #pass-strength-bar > div {
  background: var(--bg2);
}

/* Dark mode: toggle slider */
html.dark .toggle-slider {
  background: var(--bg2);
}

/* Smooth transition for dark mode toggle */
html, body, .card, .sidebar, .shell-header, .modal, .dropdown-menu {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ── Calendar: day highlight when posts exist ─────────────────── */
.cal-day.has-posts {
  background: var(--primary-light, #EEE9FF);
  border-radius: 6px;
}
.cal-day.has-posts .cal-day-num {
  color: var(--primary, #6C47FF);
  font-weight: 700;
}
.cal-day.has-posts:hover {
  background: var(--primary-light, #E4DCFF);
  cursor: pointer;
}
html.dark .cal-day.has-posts {
  background: rgba(108,71,255,0.18);
}
html.dark .cal-day.has-posts:hover {
  background: rgba(108,71,255,0.28);
}

/* ── Connect modal: already-connected provider state ─────────── */
.provider-card.provider-connected {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}
.provider-card.provider-connected .provider-connect-btn {
  background: var(--bg2, #f0f0f0);
  color: var(--text-3, #aaa);
  cursor: not-allowed;
}
.provider-card.provider-connected::after {
  content: '✓ Connected';
  display: block;
  font-size: 0.72rem;
  color: var(--success, #4CAF50);
  font-weight: 600;
  margin-top: 4px;
  text-align: center;
}
html.dark .provider-card.provider-connected {
  opacity: 0.35;
}

/* ── Help System ─────────────────────────────────────────────── */
/* Help button in header */
.help-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--bg2);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
}
.help-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* Help modal two-column layout */
#help-modal {
  max-width: 880px;
  width: 95vw;
}

.help-sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--bg2);
  border-right: 1px solid var(--card-border);
  overflow-y: auto;
  padding: 12px 0;
  flex-shrink: 0;
}

.help-toc-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  padding: 4px 16px 10px;
}

.help-toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.3;
}
.help-toc-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.help-toc-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.help-toc-arrow {
  font-size: 0.6rem;
  color: var(--text-3);
  flex-shrink: 0;
}
.help-toc-item.active .help-toc-arrow,
.help-toc-item:hover .help-toc-arrow {
  color: var(--primary);
}

/* Help main content area */
.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.help-page-content {}

.help-page-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.help-intro {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 18px;
  line-height: 1.55;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
}

/* Individual help sections */
.help-section {
  margin-bottom: 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.help-section-oauth {
  border-color: var(--primary);
  border-width: 1.5px;
}

.help-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  padding: 10px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--card-border);
}

.help-section-body {
  padding: 12px 14px;
  font-size: 0.825rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* Step list inside help section body */
.help-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.help-step:last-child { margin-bottom: 0; }

.help-step-num {
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-step-text {
  flex: 1;
  color: var(--text-2);
  line-height: 1.45;
}

.help-bullet {
  padding: 3px 0 3px 8px;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.4;
}

.help-para {
  margin: 0 0 6px;
  color: var(--text-2);
}

/* Dark mode overrides */
html.dark .help-sidebar {
  background: var(--bg2);
}
html.dark .help-section-title {
  background: var(--bg2);
}
html.dark .help-step-num {
  background: var(--primary);
}

/* Scrollbar styling for help panels */
.help-sidebar::-webkit-scrollbar,
.help-content::-webkit-scrollbar {
  width: 5px;
}
.help-sidebar::-webkit-scrollbar-thumb,
.help-content::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPETITOR ANALYSIS — dashboard section
   ═══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ── */
.comp-section {
  margin-top: 24px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 24px 24px;
}

/* ── Section header ── */
.comp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.comp-header-left { flex: 1; min-width: 0; }
.comp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.comp-subtitle {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0;
}
.comp-optional-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg2);
  color: var(--text-3);
  border: 1px solid var(--card-border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.comp-count-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(108,71,255,0.1);
  color: var(--primary, #6C47FF);
}
.comp-rank-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg2);
  color: var(--text-2);
}
.comp-rank-badge.rank-1 { background: #FFF8E0; color: #D97706; }
.comp-rank-badge.rank-2 { background: #F0F0F0; color: #6B7280; }
.comp-rank-badge.rank-3 { background: #FFF3ED; color: #C2410C; }
.comp-add-btn { white-space: nowrap; }

/* ── Empty state ── */
.comp-empty-state {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
}
.comp-empty-icon {
  font-size: 2.4rem;
  color: var(--text-3);
  margin-bottom: 12px;
  opacity: 0.6;
}
.comp-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.comp-empty-desc {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 18px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ── Competitor cards row ── */
.comp-cards-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.comp-card {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  background: var(--bg2, #f8f9fa);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.comp-card:hover {
  box-shadow: 0 4px 16px rgba(108,71,255,0.08);
  border-color: rgba(108,71,255,0.25);
}
.comp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.comp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.comp-card-info { flex: 1; min-width: 0; }
.comp-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-card-handle {
  font-size: 0.75rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-card-plat {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
}
.comp-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.comp-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--card-bg, #fff);
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.comp-action-btn:hover { background: var(--bg2); color: var(--text); }
.comp-action-btn.danger:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

/* ── Metrics row inside a card ── */
.comp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.comp-metric {
  text-align: center;
  padding: 6px 4px;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  border: 1px solid var(--card-border);
}
.comp-metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.comp-metric-lbl {
  font-size: 0.68rem;
  color: var(--text-3);
  margin: 2px 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Delta badge ── */
.comp-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}
.comp-delta.up { background: #dcfce7; color: #16a34a; }
.comp-delta.down { background: #fee2e2; color: #dc2626; }
.comp-delta.neutral { background: var(--bg2); color: var(--text-3); }

/* ── Bottom row: chart + insights ── */
.comp-bottom-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.comp-chart-col { flex: 1; min-width: 260px; }
.comp-insight-col {
  width: 340px;
  min-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Insights list ── */
.comp-insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comp-insight-list li {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--bg2, #f8f9fa);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.comp-insight-list li i { margin-top: 2px; flex-shrink: 0; }

/* ── Ranking table ── */
.comp-rank-wrap { overflow: hidden; }
.comp-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.comp-rank-table thead tr {
  background: var(--bg2, #f8f9fa);
  border-bottom: 1px solid var(--card-border);
}
.comp-rank-table th {
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
.comp-rank-table td {
  padding: 8px 10px;
  color: var(--text);
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}
.comp-rank-table tbody tr:last-child td { border-bottom: none; }
.comp-rank-you {
  background: rgba(108,71,255,0.04);
}
.comp-rank-you td { font-weight: 600; }
.comp-you-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(108,71,255,0.12);
  color: var(--primary, #6C47FF);
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Dark mode overrides ── */
.dark .comp-section { background: var(--card-bg); }
.dark .comp-card { background: var(--bg2); }
.dark .comp-metric { background: var(--card-bg); }
.dark .comp-action-btn { background: var(--bg2); }
.dark .comp-rank-table thead tr { background: var(--bg2); }
.dark .comp-rank-you { background: rgba(108,71,255,0.08); }
.dark .comp-insight-list li { background: var(--bg2); }
.dark .comp-empty-state { border-color: var(--card-border); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .comp-card { max-width: 100%; }
  .comp-insight-col { width: 100%; }
  .comp-chart-col { min-width: 100%; }
  .comp-header { flex-direction: column; align-items: flex-start; }
  .comp-rank-table th:nth-child(3),
  .comp-rank-table td:nth-child(3) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   COMPETITOR ADD / EDIT MODAL  (.ci-*)
   ═══════════════════════════════════════════════════════════════ */

/* Widen the modal shell */
.modal-comp {
  max-width: 520px !important;
  width: 95vw !important;
}

/* ── Outer wrapper ── */
.ci-modal {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Modal header ── */
.ci-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--card-border);
}
.ci-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(108,71,255,0.12);
  color: var(--primary, #6C47FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ci-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.ci-modal-sub {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 2px;
}
.ci-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ci-modal-close:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

/* ── Sections ── */
.ci-section {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--card-border);
}
.ci-section:last-of-type { border-bottom: none; }

.ci-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.ci-section-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary, #6C47FF);
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Field ── */
.ci-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ci-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ── Label ── */
.ci-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-2, #374151);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ci-required { color: #ef4444; font-weight: 700; }
.ci-optional {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-3);
  background: var(--bg2);
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  margin-left: 2px;
}

/* ── Input ── */
.ci-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}
.ci-input:focus {
  border-color: var(--primary, #6C47FF);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.1);
}
.ci-input::placeholder { color: var(--text-3); }
.ci-input.ci-input-prefixed { padding-left: 32px; }
.ci-input.ci-input-suffixed { padding-right: 42px; }

.ci-input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ci-input-icon-wrap .ci-input { flex: 1; }
.ci-input-prefix {
  position: absolute;
  left: 11px;
  font-size: 0.9rem;
  color: var(--text-3);
  pointer-events: none;
  z-index: 1;
  font-weight: 500;
}
.ci-input-suffix {
  position: absolute;
  right: 11px;
  font-size: 0.8rem;
  color: var(--text-3);
  pointer-events: none;
  font-weight: 500;
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--card-border);
}

/* ── Hint text ── */
.ci-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.ci-hint i {
  color: var(--primary, #6C47FF);
  opacity: 0.6;
  margin-top: 1px;
  flex-shrink: 0;
  font-size: 0.72rem;
}

/* ── Platform pills ── */
.ci-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ci-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--card-border);
  background: var(--bg2);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.ci-pill:hover {
  border-color: var(--primary, #6C47FF);
  color: var(--primary, #6C47FF);
  background: rgba(108,71,255,0.06);
}
.ci-pill.ci-pill-active {
  border-color: var(--primary, #6C47FF);
  background: rgba(108,71,255,0.1);
  color: var(--primary, #6C47FF);
  font-weight: 700;
}
.ci-pill span { font-size: 0.78rem; }

/* ── Metrics 3-col grid ── */
.ci-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .ci-metrics-grid { grid-template-columns: 1fr; }
}

/* ── Error banner ── */
.ci-err {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 24px;
  padding: 10px 14px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #fca5a5;
  margin-bottom: 4px;
}
.ci-err i { flex-shrink: 0; }

/* ── Modal footer ── */
.ci-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  background: var(--bg2, #f9fafb);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Dark mode ── */
html.dark .ci-input {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text);
}
html.dark .ci-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.18);
}
html.dark .ci-pill { background: var(--bg2); border-color: var(--card-border); color: var(--text-2); }
html.dark .ci-pill:hover { background: rgba(108,71,255,0.12); }
html.dark .ci-pill.ci-pill-active { background: rgba(108,71,255,0.18); }
html.dark .ci-modal-footer { background: var(--bg2); }
html.dark .ci-err { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.3); color: #fca5a5; }
html.dark .ci-input-suffix { background: var(--bg2); border-color: var(--card-border); }

/* ═══════════════════════════════════════════════════════════════
   CHANNEL CONNECTION GUIDE PAGE  (.cg-*)
   ═══════════════════════════════════════════════════════════════ */

/* Full-page wrapper */
.cg-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ── Top header bar ─────────────────────────────────────────── */
.cg-header {
  background: var(--sidebar-bg, #1a1040);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.cg-back-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cg-back-btn:hover { background: rgba(255,255,255,0.18); }
.cg-header-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}
.cg-header-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin-left: auto;
}

/* ── Body: sidenav + content ────────────────────────────────── */
.cg-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

/* ── Left sidebar nav ───────────────────────────────────────── */
.cg-sidenav {
  background: var(--bg2);
  border-right: 1px solid var(--card-border);
  padding: 16px 0;
  overflow-y: auto;
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
}
.cg-sidenav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0 16px 10px;
}
.cg-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s;
  border-left: 3px solid transparent;
  position: relative;
}
.cg-nav-item:hover {
  background: var(--bg);
}
.cg-nav-item.cg-nav-active {
  background: rgba(108,71,255,0.07);
  border-left-color: var(--plat-color, var(--primary));
}
.cg-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cg-nav-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cg-nav-auth-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-3);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Main content area ──────────────────────────────────────── */
.cg-content {
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 820px;
}

/* ── Platform pane ──────────────────────────────────────────── */
.cg-platform-pane {
  animation: cgFadeIn 0.2s ease;
}
@keyframes cgFadeIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Overview banner ────────────────────────────────────────── */
.cg-overview {
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.cg-overview-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cg-plat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.cg-overview-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}
.cg-overview-auth {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.cg-overview-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}
.cg-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 7px;
  padding: 6px 12px;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.cg-ext-link:hover { opacity: 0.85; }
.cg-ext-link-ghost {
  background: transparent;
  color: var(--primary);
}
.cg-ext-link-ghost:hover { background: rgba(108,71,255,0.07); }

/* ── Accordion sections ─────────────────────────────────────── */
.cg-sections { display: flex; flex-direction: column; gap: 12px; }
.cg-section {
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}
.cg-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  transition: background 0.13s;
}
.cg-section-head::-webkit-details-marker { display: none; }
.cg-section-head:hover { background: var(--bg); }
.cg-section-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.cg-section-title { flex: 1; }
.cg-chevron {
  font-size: 0.7rem;
  color: var(--text-3);
  transition: transform 0.2s;
}
details[open] .cg-chevron { transform: rotate(180deg); }
.cg-section-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--card-border);
}

/* ── Requirements list ──────────────────────────────────────── */
.cg-req-list { display: flex; flex-direction: column; gap: 10px; }
.cg-req-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cg-req-detail {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.5;
}

/* ── Scopes/Permissions tags ────────────────────────────────── */
.cg-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cg-scope-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: rgba(108,71,255,0.09);
  color: var(--primary);
  border: 1px solid rgba(108,71,255,0.2);
  border-radius: 6px;
  padding: 4px 9px;
  word-break: break-all;
}

/* ── Steps ──────────────────────────────────────────────────── */
.cg-steps { display: flex; flex-direction: column; gap: 14px; }
.cg-step {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.cg-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.cg-step-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(108,71,255,0.09);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.cg-step-body { flex: 1; }
.cg-step-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.cg-step-detail {
  font-size: 0.79rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── Tips ───────────────────────────────────────────────────── */
.cg-tips { display: flex; flex-direction: column; gap: 10px; }
.cg-tip {
  background: rgba(255,152,0,0.06);
  border: 1px solid rgba(255,152,0,0.2);
  border-radius: 8px;
  padding: 10px 13px;
}
.cg-tip-text {
  font-size: 0.81rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── Footer CTA ─────────────────────────────────────────────── */
.cg-platform-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}

/* ── Responsive: tablet ─────────────────────────────────────── */
@media (max-width: 900px) {
  .cg-body { grid-template-columns: 180px 1fr; }
  .cg-content { padding: 20px 20px; }
}

/* ── Responsive: mobile ─────────────────────────────────────── */
@media (max-width: 640px) {
  .cg-header { padding: 12px 16px; gap: 10px; }
  .cg-header-sub { display: none; }
  .cg-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cg-sidenav {
    position: static;
    height: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    -webkit-overflow-scrolling: touch;
  }
  .cg-sidenav-label { display: none; }
  .cg-nav-item {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cg-nav-item.cg-nav-active {
    background: rgba(108,71,255,0.09);
    border-left-color: transparent;
    border-bottom-color: var(--plat-color, var(--primary));
  }
  .cg-nav-auth-badge { display: none; }
  .cg-content { padding: 16px; }
  .cg-overview-head { gap: 10px; }
  .cg-step { gap: 10px; }
}

/* ── Dark mode tweaks ───────────────────────────────────────── */
[data-theme="dark"] .cg-header {
  background: #120d2e;
}
[data-theme="dark"] .cg-scope-tag {
  background: rgba(108,71,255,0.15);
  border-color: rgba(108,71,255,0.3);
}
[data-theme="dark"] .cg-tip {
  background: rgba(255,152,0,0.08);
  border-color: rgba(255,152,0,0.25);
}
[data-theme="dark"] .cg-section-head:hover {
  background: rgba(255,255,255,0.04);
}

/* ── AI TOOLS HUB ──────────────────────────────────────────────── */
.ath-hero {
  background: linear-gradient(135deg, #6C47FF 0%, #a855f7 50%, #ec4899 100%);
  border-radius: 16px;
  padding: 36px 32px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.ath-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.ath-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 40%;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.ath-hero h1 { font-size: 1.55rem; font-weight: 800; margin-bottom: 6px; }
.ath-hero p  { font-size: 0.88rem; opacity: 0.88; margin-bottom: 18px; max-width: 540px; }
.ath-search-wrap { display: flex; gap: 10px; max-width: 480px; }
.ath-search {
  flex: 1;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  color: #fff;
  padding: 10px 16px;
  font-size: 0.88rem;
  outline: none;
  backdrop-filter: blur(4px);
}
.ath-search::placeholder { color: rgba(255,255,255,0.65); }
.ath-search:focus { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.55); }

.ath-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ath-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.ath-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.ath-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ath-filter-btn .ath-filter-count {
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 700;
}
.ath-filter-btn:not(.active) .ath-filter-count {
  background: var(--bg);
  color: var(--text-3);
}

.ath-section { margin-bottom: 32px; }
.ath-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--card-border);
}
.ath-section-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ath-section-header h3 { font-size: 0.93rem; font-weight: 700; color: var(--text); margin-bottom: 1px; }
.ath-section-header p  { font-size: 0.75rem; color: var(--text-3); }

.ath-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.ath-tool-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.ath-tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(108,71,255,0.12);
  transform: translateY(-2px);
}
.ath-tool-card:hover .ath-tool-arrow { opacity: 1; transform: translateX(0); }
.ath-tool-card-top { display: flex; align-items: flex-start; gap: 10px; }
.ath-tool-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ath-tool-name { font-size: 0.84rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.ath-tool-desc { font-size: 0.75rem; color: var(--text-3); line-height: 1.4; }
.ath-tool-arrow {
  position: absolute;
  top: 14px; right: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.18s;
  color: var(--primary);
  font-size: 0.75rem;
}
.ath-tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  width: fit-content;
  margin-top: 2px;
}

/* Tool modal */
.ath-modal { width: 100%; max-width: 100%; box-sizing: border-box; }
.ath-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.ath-modal-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.ath-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; overflow-x: hidden; }

/* ── ATH modal field styles (light-mode safe) ── */
.ath-field-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ath-field-input,
.ath-field-select {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.ath-field-input::placeholder { color: var(--text-3); }
.ath-field-input:focus,
.ath-field-select:focus {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
}
.ath-field-select { cursor: pointer; -webkit-appearance: none; appearance: none; }
html.dark .ath-field-label  { color: rgba(255,255,255,0.7); }
html.dark .ath-field-input,
html.dark .ath-field-select {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
html.dark .ath-field-input::placeholder { color: rgba(255,255,255,0.3); }
html.dark .ath-field-input:focus,
html.dark .ath-field-select:focus {
  border-color: rgba(108,71,255,0.6);
  background: rgba(108,71,255,0.08);
}
.ath-modal-result {
  background: var(--bg);
  border: 1.5px solid var(--card-border);
  border-radius: 10px;
  padding: 16px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
}
.ath-modal-result.generating {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.ath-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}
.ath-empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.ath-empty-state i { font-size: 2.5rem; opacity: 0.25; display: block; margin-bottom: 14px; }
.ath-empty-state p { font-size: 0.85rem; }

/* Generating animation */
@keyframes ath-pulse { 0%,100%{opacity:0.3} 50%{opacity:1} }
.ath-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--primary); margin:0 2px; animation: ath-pulse 1.2s ease-in-out infinite; }
.ath-dot:nth-child(2) { animation-delay:0.2s; }
.ath-dot:nth-child(3) { animation-delay:0.4s; }

@media (max-width: 600px) {
  .ath-hero { padding: 22px 16px; }
  .ath-hero h1 { font-size: 1.15rem; }
  .ath-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ath-tool-card { padding: 12px; }
}

/* ── PUBLISH QUEUE ── */
.pq-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.pq-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: 1px solid var(--card-border);
  background: var(--bg);
}
.pq-section-title .badge {
  background: var(--card-border);
  color: var(--text-3);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}
.pq-section-title .badge-success { background: #dcfce7; color: #16a34a; }
.pq-section-title .badge-danger  { background: #fee2e2; color: #dc2626; }

.pq-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s;
}
.pq-item:last-child { border-bottom: none; }
.pq-item:hover { background: var(--bg); }

.pq-item-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.pq-item-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}
.pq-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pq-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pq-empty {
  text-align: center;
  padding: 36px 24px;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pq-empty i   { font-size: 2rem; opacity: 0.2; }
.pq-empty p   { font-size: 0.85rem; }

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  height: auto;
  line-height: 1.4;
}

/* Auth error box (light theme override inside dark auth bg) */
#auth-error {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}
