/* ============================================
   COSMOBASE v2 — Design System
   Palette: #212D3B #4A90E4 #DE7AE8 #EBEBEB #143356
   Fonts: Lato (UI) · Syne (headings/display)
   Style: Glassmorphism · Futuristic · Dark
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Syne:wght@400;600;700;800&display=swap');

/* === TOKENS === */
:root {
  --bg-deep:        #0d1520;
  --bg-mid:         #212D3B;
  --navy:           #143356;
  --accent-blue:    #4A90E4;
  --accent-purple:  #DE7AE8;
  --text-light:     #EBEBEB;

  --glass-bg:       rgba(33, 45, 59, 0.55);
  --glass-border:   rgba(74, 144, 228, 0.18);
  --glass-hover:    rgba(74, 144, 228, 0.10);

  --font-ui:        'Lato', sans-serif;
  --font-display:   'Syne', sans-serif;

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;

  --tab-height:     64px;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-ui); }

/* === BASE === */
body {
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* === AMBIENT ORBS === */
.orb-blue {
  position: fixed; top: -20vh; left: -10vw;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(74,144,228,0.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.orb-purple {
  position: fixed; bottom: -20vh; right: -10vw;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(222,122,232,0.10) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.grid-lines {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(74,144,228,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,144,228,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
}

/* === FIXED TAB BAR === */
.tab-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--tab-height);
  background: rgba(13, 21, 32, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 0;
  z-index: 1000;
}

.tab-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: 2.5rem;
  flex-shrink: 0;
}
.tab-logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(235,235,235,0.45);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tab-btn:hover {
  color: var(--text-light);
  background: var(--glass-hover);
  border-color: var(--glass-border);
}
.tab-btn.active {
  color: var(--accent-blue);
  background: rgba(74, 144, 228, 0.12);
  border-color: rgba(74, 144, 228, 0.28);
}
.tab-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.tab-btn.active svg { opacity: 1; }

.tab-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.tab-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: rgba(235,235,235,0.3);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.tab-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}

/* === PAGE BODY === */
.page-body {
  margin-top: var(--tab-height);
  padding: 2rem 2.5rem;
  min-height: calc(100vh - var(--tab-height));
  position: relative;
  z-index: 1;
}

/* === GLASS CARD === */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,144,228,0.35), transparent);
}
.glass-card:hover {
  border-color: rgba(74,144,228,0.32);
}
.glass-card.purple::before {
  background: linear-gradient(90deg, transparent, rgba(222,122,232,0.35), transparent);
}

/* === STAT CARD === */
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,144,228,0.4), transparent);
}
.stat-card.purple::before {
  background: linear-gradient(90deg, transparent, rgba(222,122,232,0.4), transparent);
}
.stat-card:hover { border-color: rgba(74,144,228,0.35); transform: translateY(-2px); }
.stat-card.purple:hover { border-color: rgba(222,122,232,0.35); }

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(235,235,235,0.38);
  margin-bottom: 0.5rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-value.blue   { color: var(--accent-blue); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.green  { color: #4ade80; }
.stat-value.amber  { color: #fbbf24; }
.stat-delta {
  font-size: 0.73rem;
  color: rgba(235,235,235,0.32);
  display: flex; align-items: center; gap: 4px;
}
.delta-up   { color: #4ade80; }
.delta-down { color: #f87171; }

/* === SECTION HEADER === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-action {
  font-size: 0.78rem;
  color: var(--accent-blue);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.section-action:hover { opacity: 1; }

/* === TABLE === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(235,235,235,0.28);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: 0.85rem 0.75rem;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(74,144,228,0.06);
  vertical-align: middle;
  color: rgba(235,235,235,0.78);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(74,144,228,0.04); }

/* === BADGE === */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.badge-blue   { background: rgba(74,144,228,0.14);  color: var(--accent-blue);   border: 1px solid rgba(74,144,228,0.25); }
.badge-purple { background: rgba(222,122,232,0.14); color: var(--accent-purple); border: 1px solid rgba(222,122,232,0.25); }
.badge-green  { background: rgba(74,222,128,0.12);  color: #4ade80;              border: 1px solid rgba(74,222,128,0.2); }
.badge-amber  { background: rgba(251,191,36,0.12);  color: #fbbf24;              border: 1px solid rgba(251,191,36,0.2); }
.badge-gray   { background: rgba(235,235,235,0.08); color: rgba(235,235,235,0.5);border: 1px solid rgba(235,235,235,0.12); }

/* === USER CELL === */
.user-cell { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.ua-blue   { background: rgba(74,144,228,0.18);  color: var(--accent-blue);   border: 1px solid rgba(74,144,228,0.28); }
.ua-purple { background: rgba(222,122,232,0.18); color: var(--accent-purple); border: 1px solid rgba(222,122,232,0.28); }
.ua-green  { background: rgba(74,222,128,0.14);  color: #4ade80;              border: 1px solid rgba(74,222,128,0.22); }
.user-name  { font-size: 0.84rem; font-weight: 700; color: var(--text-light); }
.user-email { font-size: 0.71rem; color: rgba(235,235,235,0.32); }

/* === ACTIVITY === */
.activity-item {
  display: flex; gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(74,144,228,0.06);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.dot-blue   { background: var(--accent-blue);  box-shadow: 0 0 6px rgba(74,144,228,0.5); }
.dot-purple { background: var(--accent-purple);box-shadow: 0 0 6px rgba(222,122,232,0.5); }
.dot-green  { background: #4ade80;             box-shadow: 0 0 6px rgba(74,222,128,0.4); }
.dot-amber  { background: #fbbf24;             box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.activity-text { font-size: 0.81rem; color: rgba(235,235,235,0.68); line-height: 1.5; }
.activity-text strong { color: var(--text-light); font-weight: 700; }
.activity-time { font-size: 0.67rem; color: rgba(235,235,235,0.28); margin-top: 2px; }

/* === WIP PAGE === */
.wip-container {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: calc(100vh - var(--tab-height) - 4rem);
  gap: 1.5rem;
  text-align: center;
}
.wip-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(74,144,228,0.1);
  border: 1px solid rgba(74,144,228,0.2);
  display: flex; align-items: center; justify-content: center;
}
.wip-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wip-sub {
  font-size: 0.85rem;
  color: rgba(235,235,235,0.35);
  max-width: 320px;
  line-height: 1.7;
}
.wip-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(74,144,228,0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(74,144,228,0.22);
}

/* === ANIMATIONS === */
.fade-in { animation: fadeIn 0.45s ease forwards; opacity: 0; }
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.10s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.20s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === UTILITY === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
