:root {
  --bg-void: #070810;
  --bg-deep: #0D0F1A;
  --bg-surface: #131628;
  --bg-raised: #1A1E35;
  --bg-hover: #222744;

  --accent-primary: #4F6EF7;
  --accent-glow: #3D58D4;
  --accent-brain: #8B5CF6;
  --accent-shield: #10B981;
  --accent-affiliate: #F59E0B;
  --accent-partner: #EC4899;
  --accent-seo: #06B6D4;

  --text-primary: #F0F2FF;
  --text-secondary: #8B91B4;
  --text-muted: #4A4F6A;

  --border-subtle: rgba(255,255,255,0.06);
  --border-mid: rgba(255,255,255,0.12);
  --border-strong: rgba(79,110,247,0.4);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-main: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-w: 240px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg-void); color: var(--text-primary); font-family: var(--font-main); font-size: 14px; line-height: 1.6; overflow: hidden; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 2px; }

/* AUTH SCREENS */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-void); overflow: auto; padding: 2rem; }
.auth-card { background: var(--bg-surface); border: 0.5px solid var(--border-mid); border-radius: var(--radius-xl); padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; }
.auth-logo .logo-mark { width: 36px; height: 36px; background: var(--accent-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -1px; }
.auth-logo .logo-text { font-size: 18px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.3px; }
.auth-logo .logo-text span { color: var(--accent-primary); }
.auth-title { font-size: 22px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.4px; }
.auth-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 2rem; }
.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-field input { width: 100%; background: var(--bg-deep); border: 0.5px solid var(--border-mid); border-radius: var(--radius-md); padding: 10px 14px; color: var(--text-primary); font-size: 14px; font-family: var(--font-main); outline: none; transition: border-color 0.2s; }
.auth-field input:focus { border-color: var(--accent-primary); }
.auth-field input::placeholder { color: var(--text-muted); }
.btn-primary { width: 100%; padding: 11px; background: var(--accent-primary); border: none; border-radius: var(--radius-md); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; margin-top: 0.5rem; }
.btn-primary:hover { background: var(--accent-glow); }
.btn-primary:active { transform: scale(0.98); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent-primary); text-decoration: none; cursor: pointer; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 1.5rem 0; }
.auth-divider span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 0.5px; background: var(--border-subtle); }
.shield-badge { display: flex; align-items: center; gap: 6px; background: rgba(16,185,129,0.08); border: 0.5px solid rgba(16,185,129,0.2); border-radius: var(--radius-sm); padding: 6px 10px; margin-top: 1.5rem; font-size: 11px; color: #10B981; }
.shield-dot { width: 6px; height: 6px; border-radius: 50%; background: #10B981; animation: pulse-green 2s infinite; flex-shrink: 0; }
@keyframes pulse-green { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* PLATFORM SHELL */
.platform { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; height: 100vh; }

/* TOPBAR */
.topbar { grid-column: 1 / -1; background: var(--bg-deep); border-bottom: 0.5px solid var(--border-subtle); display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem; z-index: 100; }
.topbar-logo { display: flex; align-items: center; gap: 9px; min-width: calc(var(--sidebar-w) - 1.5rem); }
.logo-mark-sm { width: 28px; height: 28px; background: var(--accent-primary); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.logo-text-sm { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.logo-text-sm span { color: var(--accent-primary); }
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input { width: 100%; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); padding: 7px 14px 7px 36px; color: var(--text-primary); font-size: 13px; outline: none; transition: border-color 0.2s; }
.topbar-search input:focus { border-color: var(--border-mid); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.shield-pill { display: flex; align-items: center; gap: 5px; background: rgba(16,185,129,0.08); border: 0.5px solid rgba(16,185,129,0.2); border-radius: 999px; padding: 4px 10px; font-size: 11px; color: #10B981; cursor: pointer; }
.brain-pill { display: flex; align-items: center; gap: 5px; background: rgba(139,92,246,0.08); border: 0.5px solid rgba(139,92,246,0.2); border-radius: 999px; padding: 4px 10px; font-size: 11px; color: #8B5CF6; cursor: pointer; }
.topbar-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 0.5px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); font-size: 16px; transition: background 0.15s; }
.topbar-icon:hover { background: var(--bg-raised); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; }

/* SIDEBAR */
.sidebar { background: var(--bg-deep); border-right: 0.5px solid var(--border-subtle); overflow-y: auto; padding: 1rem 0; }
.sidebar-section { padding: 0 12px; margin-bottom: 1.5rem; }
.sidebar-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0 8px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: all 0.15s; position: relative; margin-bottom: 1px; }
.nav-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.nav-item.active { background: rgba(79,110,247,0.12); color: var(--accent-primary); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.badge-soon { background: var(--bg-raised); color: var(--text-muted); }
.badge-new { background: rgba(79,110,247,0.2); color: var(--accent-primary); }
.badge-live { background: rgba(16,185,129,0.15); color: #10B981; }
.nav-item .sub-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* MAIN CONTENT */
.main { overflow-y: auto; background: var(--bg-void); }
.main-inner { padding: 2rem; max-width: 1200px; }

/* PAGE HEADER */
.page-header { margin-bottom: 2rem; }
.page-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-primary); margin-bottom: 6px; }
.page-sub { font-size: 14px; color: var(--text-secondary); }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.stat-card { background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -1px; color: var(--text-primary); margin-bottom: 4px; }
.stat-delta { font-size: 12px; color: #10B981; }
.stat-delta.down { color: #EF4444; }

/* MODULE CARDS */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.module-card { background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.module-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; opacity: 0; transition: opacity 0.2s; }
.module-card:hover { border-color: var(--border-mid); background: var(--bg-raised); transform: translateY(-1px); }
.module-card:hover::before { opacity: 1; }
.module-card.affiliate::before { background: var(--accent-affiliate); }
.module-card.shield::before { background: var(--accent-shield); }
.module-card.partner::before { background: var(--accent-partner); }
.module-card.brain::before { background: var(--accent-brain); }
.module-card.seo::before { background: var(--accent-seo); }
.module-card.active-module { border-color: var(--border-strong); background: rgba(79,110,247,0.05); }
.module-card.active-module::before { opacity: 1; background: var(--accent-primary); }
.module-icon { font-size: 22px; margin-bottom: 10px; }
.module-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.module-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.module-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; }
.status-live { color: #10B981; }
.status-soon { color: var(--text-muted); }
.status-dot-live { width: 5px; height: 5px; border-radius: 50%; background: #10B981; }
.status-dot-soon { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }

/* BRAIN PANEL */
.brain-panel { position: fixed; right: 0; top: var(--topbar-h); width: 340px; height: calc(100vh - var(--topbar-h)); background: var(--bg-deep); border-left: 0.5px solid var(--border-subtle); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; z-index: 200; }
.brain-panel.open { transform: translateX(0); }
.brain-header { padding: 1rem 1.25rem; border-bottom: 0.5px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }
.brain-title { font-size: 14px; font-weight: 600; color: #8B5CF6; flex: 1; }
.brain-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; padding: 2px; }
.brain-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 10px; }
.brain-msg { max-width: 90%; }
.brain-msg.assistant { align-self: flex-start; }
.brain-msg.user { align-self: flex-end; }
.brain-bubble { padding: 9px 13px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; }
.brain-msg.assistant .brain-bubble { background: var(--bg-surface); border: 0.5px solid var(--border-subtle); color: var(--text-primary); border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md); }
.brain-msg.user .brain-bubble { background: rgba(79,110,247,0.15); border: 0.5px solid rgba(79,110,247,0.3); color: var(--text-primary); border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md); }
.brain-input-row { padding: 1rem; border-top: 0.5px solid var(--border-subtle); display: flex; gap: 8px; }
.brain-input-row input { flex: 1; background: var(--bg-surface); border: 0.5px solid var(--border-mid); border-radius: var(--radius-md); padding: 8px 12px; color: var(--text-primary); font-size: 13px; outline: none; }
.brain-input-row input:focus { border-color: rgba(139,92,246,0.5); }
.brain-send { background: var(--accent-brain); border: none; border-radius: var(--radius-sm); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 15px; flex-shrink: 0; }

/* QUICK ACTIONS */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2rem; }
.quick-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.quick-btn:hover { background: var(--bg-raised); color: var(--text-primary); border-color: var(--border-mid); }

/* ACTIVITY FEED */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.panel { background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; }
.panel-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid var(--border-subtle); }
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-text { font-size: 13px; color: var(--text-secondary); flex: 1; }
.activity-text strong { color: var(--text-primary); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid var(--border-subtle); }
.task-item:last-child { border-bottom: none; }
.task-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-mid); flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.task-check.done { background: var(--accent-shield); border-color: var(--accent-shield); }
.task-text { font-size: 13px; color: var(--text-secondary); flex: 1; }
.task-text.done { text-decoration: line-through; color: var(--text-muted); }
.task-tag { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 500; }

/* NOTIFICATION */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--bg-raised); border: 0.5px solid var(--border-mid); border-radius: var(--radius-md); padding: 12px 16px; font-size: 13px; color: var(--text-primary); z-index: 999; display: flex; align-items: center; gap: 10px; transform: translateY(80px); opacity: 0; transition: all 0.3s; max-width: 300px; }
.toast.show { transform: translateY(0); opacity: 1; }

/* UTILITY */
.hidden { display: none !important; }
.text-affiliate { color: var(--accent-affiliate); }
.text-shield { color: var(--accent-shield); }
.text-brain { color: var(--accent-brain); }
.text-partner { color: var(--accent-partner); }
