/* ===================================================================
   VFAI Community â€” Design System (matches VFAIBrowser webapp)
   =================================================================== */

/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: rgba(184,134,11,0.15);
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --text-sidebar: #94a3b8;
  --border: #e2e8f0;
  --gold: #B8860B;
  --gold-lt: #FFF8E1;
  --green: #16a34a;
  --green-lt: #dcfce7;
  --red: #dc2626;
  --red-lt: #fee2e2;
  --orange: #ea580c;
  --orange-lt: #fff7ed;
  --blue: #2563eb;
  --blue-lt: #dbeafe;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== App Layout ===== */
.app { display: flex; height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.2s ease;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand .brand-icon { font-size: 24px; }
.sidebar-brand .brand-name {
  font-size: 18px; font-weight: 800; color: #FFD700;
  letter-spacing: 1px;
}
.sidebar-brand .brand-tag {
  font-size: 9px; color: var(--text-sidebar);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 2px;
  border-radius: var(--r); cursor: pointer;
  color: var(--text-sidebar); font-size: 13px; font-weight: 500;
  transition: all 0.15s ease; text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #FFD700; font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 14px; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px; color: var(--text-sidebar);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-footer a { color: #FFD700; font-size: 11px; }

/* ===== Main ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ===== Topbar ===== */
.topbar {
  height: 56px; min-height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--text);
  padding: 4px 8px; border-radius: 4px;
}
.menu-toggle:hover { background: var(--bg-3); }
.page-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.connection-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
  background: var(--red-lt); color: var(--red);
}
.connection-badge.connected { background: var(--green-lt); color: var(--green); }
.conn-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}
.connection-badge.connected .conn-dot { background: var(--green); }
.auth-user { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ===== Content Area ===== */
.content { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg-2); }
.view { display: none; animation: viewFadeIn 0.2s ease; }
.view.active { display: block; }
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s ease; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover:not(:disabled) { background: #9a7209; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  padding: 6px; background: none; border: none; cursor: pointer;
  color: var(--text-2); border-radius: 4px; font-size: 16px;
}
.btn-icon:hover { background: var(--bg-3); color: var(--text); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--bg); transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }

/* ===== Cards ===== */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow); transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow-lg); }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-gold { background: var(--gold-lt); color: var(--gold); }
.badge-green { background: var(--green-lt); color: var(--green); }
.badge-red { background: var(--red-lt); color: var(--red); }
.badge-blue { background: var(--blue-lt); color: var(--blue); }
.badge-orange { background: var(--orange-lt); color: var(--orange); }

/* ===== View Headers ===== */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.view-header h2 { font-size: 20px; font-weight: 800; }
.view-header-actions { display: flex; gap: 8px; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.filter-bar .form-input { flex: 2; }
.filter-bar .form-select { flex: 1; max-width: 220px; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-2);
}
.empty-state p { margin-bottom: 8px; }
.empty-state-sm {
  text-align: center; padding: 20px;
  color: var(--text-3); font-size: 13px;
}

/* ============================================= */
/* VIEW: Dashboard                               */
/* ============================================= */
.dash-welcome {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--r-lg); padding: 32px;
  color: #fff; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.dash-welcome::after {
  content: 'ðŸŒ'; position: absolute; right: 24px; top: 50%;
  transform: translateY(-50%); font-size: 64px; opacity: 0.15;
}
.dash-welcome h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.dash-welcome p { color: #94a3b8; font-size: 14px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-icon.gold { background: var(--gold-lt); }
.stat-icon.green { background: var(--green-lt); }
.stat-icon.blue { background: var(--blue-lt); }
.stat-icon.orange { background: var(--orange-lt); }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-2); }

.quick-actions { margin-bottom: 24px; }
.quick-actions h3 {
  font-size: 14px; font-weight: 700; color: var(--text-2);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; }
.action-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 20px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); flex: 1; min-width: 180px;
}
.action-card:hover {
  border-color: var(--gold); box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.action-card .ac-icon { font-size: 24px; }
.action-card .ac-label { font-size: 13px; font-weight: 600; color: var(--text); }
.action-card .ac-desc { font-size: 11px; color: var(--text-2); }

/* ============================================= */
/* VIEW: Chat                                    */
/* ============================================= */
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 16px;
  height: calc(100vh - 56px - 48px);
}

.chat-sidebar, .chat-area, .chat-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Chat Sidebar */
.chat-sidebar-header, .chat-area-header, .chat-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-sidebar-header h3, .chat-area-header h3, .chat-panel-header h3 {
  font-size: 14px; font-weight: 700;
}

.chat-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1; background: transparent; border: none;
  color: var(--text-2); padding: 10px 8px; cursor: pointer;
  transition: all 0.15s; font-size: 12px; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tab-btn:hover { background: var(--bg-3); }
.tab-btn.active {
  color: var(--gold); border-bottom-color: var(--gold);
  background: var(--gold-lt);
}

.chat-sidebar-content {
  flex: 1; overflow-y: auto; padding: 8px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* User/Room Items */
.user-item, .room-item {
  padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.user-item:hover, .room-item:hover {
  border-color: var(--gold); background: var(--gold-lt);
}
.user-status {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}
.user-status.away { background: var(--orange); }
.user-status.offline, .user-status.busy { background: var(--text-3); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: var(--text); }
.user-plan { font-size: 10px; color: var(--orange); text-transform: uppercase; font-weight: 700; }

/* Chat Area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.welcome-message {
  text-align: center; padding: 40px 20px; color: var(--text-2);
}
.welcome-message h4 { color: var(--gold); font-size: 16px; margin-bottom: 6px; }

.message {
  padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); transition: border-color 0.15s;
}
.message:hover { border-color: var(--gold); }
.message-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.message-author { font-weight: 700; font-size: 13px; color: var(--gold); }
.message-time { font-size: 11px; color: var(--text-3); }
.message-text { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Chat Input */
.chat-inputbar {
  display: flex; align-items: center; padding: 12px 16px;
  border-top: 1px solid var(--border); gap: 8px;
}
.chat-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--gold); }
.chat-input:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-send {
  background: var(--gold); border: none; color: #fff;
  padding: 10px 16px; border-radius: var(--r);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.chat-send:hover:not(:disabled) { background: #9a7209; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-status { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
}
.status-dot.connected { background: var(--green); }

/* Chat Panel */
.chat-panel-content { flex: 1; overflow-y: auto; padding: 16px; }

/* ============================================= */
/* VIEW: Marketplace                             */
/* ============================================= */
.smart-contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.smart-contract-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow); transition: all 0.15s;
}
.smart-contract-card:hover { box-shadow: var(--shadow-lg); border-color: var(--gold); }
.smart-contract-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.smart-contract-title { font-size: 15px; font-weight: 700; color: var(--text); }
.smart-contract-category {
  font-size: 10px; color: var(--gold); background: var(--gold-lt);
  padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
  font-weight: 700;
}
.smart-contract-description {
  font-size: 13px; color: var(--text-2); margin-bottom: 12px; line-height: 1.5;
}
.smart-contract-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.smart-contract-author { font-size: 12px; color: var(--text-2); }
.smart-contract-stats { font-size: 12px; color: var(--text-2); }
.smart-contract-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.smart-contract-actions .btn { flex: 1; }

/* ============================================= */
/* VIEW: Communities                             */
/* ============================================= */
.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.community-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow); transition: all 0.15s;
}
.community-card:hover { box-shadow: var(--shadow-lg); border-color: var(--gold); }
.community-header {
  display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.community-avatar {
  font-size: 28px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border-radius: 50%;
}
.community-info { flex: 1; }
.community-name { font-size: 15px; font-weight: 700; color: var(--text); }
.community-meta { font-size: 12px; color: var(--text-2); }
.community-description {
  font-size: 13px; color: var(--text-2); margin-bottom: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.community-stats {
  display: flex; gap: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.community-stat { display: flex; align-items: center; gap: 4px; }
.community-actions { display: flex; gap: 8px; margin-top: 12px; }
.community-actions .btn { flex: 1; }

/* ============================================= */
/* VIEW: VFAI Sync                               */
/* ============================================= */
.sync-status-card {
  margin-bottom: 20px;
}
.sync-status-header {
  display: flex; align-items: center; gap: 16px;
}
.sync-status-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--bg-3);
  border: 2px solid var(--border);
}
.sync-status-icon.connected { background: var(--green-lt); border-color: var(--green); }
.sync-status-icon.error { background: var(--red-lt); border-color: var(--red); }
.sync-status-info { flex: 1; }
.sync-status-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.sync-status-info p { font-size: 13px; color: var(--text-2); margin: 0; }

.sync-status-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sync-detail-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--bg-2); border-radius: var(--r);
  font-size: 13px;
}
.sync-detail-item span:first-child { color: var(--text-2); }
.sync-detail-value { font-weight: 700; color: var(--text); }

.sync-controls {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}

.synced-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin: -20px -20px 20px; padding: 0 20px;
}
.sync-tab-btn {
  padding: 12px 16px; background: none; border: none;
  color: var(--text-2); cursor: pointer; font-size: 13px;
  font-weight: 600; border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.sync-tab-btn:hover { color: var(--text); }
.sync-tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.sync-tab-content { display: none; }
.sync-tab-content.active { display: block; }

.synced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.synced-item {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
  transition: all 0.15s;
}
.synced-item:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.synced-item-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.synced-item-info h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.synced-item-info p { font-size: 12px; color: var(--text-2); margin: 0; }
.synced-item-type {
  padding: 2px 8px; background: var(--gold-lt); color: var(--gold);
  border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.synced-item-description {
  font-size: 13px; color: var(--text-2); margin-bottom: 10px; line-height: 1.4;
}
.synced-item-meta {
  display: flex; gap: 12px; margin-bottom: 10px;
  font-size: 12px; color: var(--text-2);
}
.synced-item-actions { display: flex; gap: 8px; }
.synced-item-actions .btn { flex: 1; }

/* ============================================= */
/* VIEW: Friends                                 */
/* ============================================= */
.friend-item {
  display: flex; align-items: center;
  padding: 12px 16px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); transition: all 0.15s;
}
.friend-item:hover { border-color: var(--gold); }
.friend-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-lt); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; margin-right: 12px;
  position: relative;
}
.friend-online-indicator {
  position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  background: var(--green); border: 2px solid var(--bg);
  border-radius: 50%;
}
.friend-online-indicator.offline { background: var(--text-3); }
.friend-info { flex: 1; }
.friend-name { font-weight: 600; font-size: 13px; color: var(--text); }
.friend-status { font-size: 11px; color: var(--text-2); }
.friend-actions { display: flex; gap: 6px; }

.friend-request {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px;
}
.friend-request-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.friend-request-from { font-weight: 700; font-size: 13px; color: var(--gold); }
.friend-request-message { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.friend-request-actions { display: flex; gap: 8px; }

/* ============================================= */
/* VIEW: Settings                                */
/* ============================================= */
.settings-section {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.about-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: 6px 16px; font-size: 13px;
}
.about-label { color: var(--text-2); font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg); border-radius: var(--r-lg);
  padding: 24px; max-width: 500px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-footer {
  text-align: center; padding-top: 16px; margin-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.modal-footer a { color: var(--gold); }

/* Login Tabs */
.login-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.login-tab-btn {
  background: none; border: none; padding: 10px 16px;
  color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.login-tab-btn:hover { color: var(--text); }
.login-tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.login-tab-content { display: none; }
.login-tab-content.active { display: block; }

/* ===== Rating Stars ===== */
.rating-stars {
  display: flex; gap: 8px; font-size: 28px;
  margin: 12px 0; justify-content: center;
}
.rating-stars .star {
  cursor: pointer; transition: transform 0.15s; color: var(--text-3);
}
.rating-stars .star:hover { transform: scale(1.2); }

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 3000; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--sidebar-bg); color: #fff;
  border-radius: var(--r); padding: 12px 20px; min-width: 280px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
  font-size: 13px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--orange); }
.toast.info { border-left: 3px solid var(--blue); }
.toast-icon { font-size: 18px; }
.toast-message { flex: 1; }

/* ===== Path Modal (VFAI Sync) ===== */
.path-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 1001;
  display: flex; align-items: center; justify-content: center;
}
.path-modal-content {
  background: var(--bg); border-radius: var(--r-lg);
  padding: 24px; max-width: 560px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.path-input-group { margin-bottom: 20px; }
.path-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r); font-family: var(--mono); font-size: 13px;
  color: var(--text); background: var(--bg);
}
.path-input:focus { outline: none; border-color: var(--gold); }
.path-examples { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.path-examples code {
  background: var(--bg-3); padding: 1px 4px; border-radius: 3px;
  font-family: var(--mono); font-size: 11px;
}

/* ===== Scrollbar ===== */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .chat-layout { grid-template-columns: 220px 1fr; }
  .chat-panel { display: none; }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .filter-bar { flex-direction: column; }
}
