/* ============================================================
   EQUALA Platform UI - style.css
   Consistent with Landing Page identity:
   Fonts: Space Mono + Syne
   Colors: --black #020305, --accent #1a6cff, --accent2 #00d4ff
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core palette (matches landing page) */
  --black:     #020305;
  --dark:      #080c12;
  --card:      #0d1420;
  --card2:     #111827;
  --border:    rgba(255, 255, 255, 0.07);
  --accent:    #1a6cff;
  --accent2:   #00d4ff;
  --text:      #e8edf5;
  --muted:     #4a5568;
  --muted2:    #8899aa;

  /* AI category colors */
  --gold:      #e8b84b;
  --green:     #00c896;
  --blue:      #1a6cff;
  --silver:    #8899aa;

  /* Layout */
  --sidebar-w: 220px;
  --ticker-h:  36px;
  --topbar-h:  64px;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;
}

html, body {
  height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================================
   TICKER BAR (fixed bottom)
   ============================================================ */
#ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--ticker-h);
  background: var(--dark);
  border-top: 1px solid var(--border);
  overflow: hidden;
  z-index: 200;
  display: flex;
  align-items: center;
}

#ticker-track {
  display: flex;
  gap: 80px;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-msg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticker-msg::before {
  content: '\2726';
  margin-right: 12px;
  opacity: 0.6;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding-bottom: var(--ticker-h);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--border);
}

.logo-css {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}

.logo-eqa {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(26, 108, 255, 0.5);
}

.logo-equala {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(232, 184, 75, 0.4);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted2);
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(26, 108, 255, 0.15);
  color: var(--accent2);
}

.nav-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

/* Messages envelope needs slightly larger size */
.nav-item[data-section="messages"] .nav-icon {
  font-size: 14px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.user-tier {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding-bottom: calc(var(--ticker-h) + 24px);
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOPBAR
   ============================================================ */
#topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.page-subtitle {
  font-size: 11px;
  color: var(--muted2);
  font-family: var(--font-mono);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.eqa-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(0, 200, 150, 0.1);
  border: 1px solid rgba(0, 200, 150, 0.25);
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--green);
  letter-spacing: 0.04em;
}

.eqa-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Notification bell */
.notif-bell {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}

.notif-bell:hover {
  border-color: rgba(26,108,255,0.4);
  color: var(--accent2);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--dark);
}

.btn-primary {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.06em;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--accent2);
  color: var(--black);
  transform: translateY(-1px);
}

.btn-ghost {
  padding: 7px 16px;
  border: 1px solid var(--border);
  color: var(--muted2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ============================================================
   STATS ROW
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  background: var(--dark);
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.token-value {
  color: var(--gold);
}

.stat-used {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted2);
  margin-left: 2px;
}

.stat-token-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
  width: 100%;
}

.stat-token-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #f0c96a);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.stat-token-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
  padding: 28px 32px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
}

.panel-link {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent2);
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}

.panel-link:hover { opacity: 0.7; }

.panel-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Empty state */
.empty-state {
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 24px;
  color: var(--muted);
  opacity: 0.5;
}

.empty-state p {
  font-size: 13px;
  color: var(--muted2);
}

/* ============================================================
   AI COLLABORATORS PANEL
   ============================================================ */
.ai-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card2);
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-dot.gold   { background: var(--gold); }
.ai-dot.green  { background: var(--green); }
.ai-dot.blue   { background: var(--blue); }
.ai-dot.silver { background: var(--silver); }

.ai-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ai-name {
  font-size: 13px;
  font-weight: 700;
}

.ai-provider {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.ai-category {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   TOKEN USAGE PANEL
   ============================================================ */
.token-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
}

.token-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.token-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.token-tier-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}