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

:root {
  --bg-main: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-card: #111827;
  --accent-gold: #FFD700;
  --accent-gold-glow: rgba(255, 215, 0, 0.4);
  --accent-primary: #FFD700;
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-light: #ffffff;
  --border-light: #1f2937;
  --glass-nav: rgba(10, 10, 15, 0.8);
  --glass-border: rgba(255, 255, 255, 0.05);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-nav {
  background: rgba(10, 10, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.glass-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
}

/* Dashboard Side Modal (Phase 2) */
.side-modal {
  position: fixed;
  top: 0;
  right: -100%;
  width: 450px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  z-index: 100;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem;
  box-shadow: -20px 0 50px rgba(0,0,0,0.5);
}

.side-modal.open {
  right: 0;
}

/* Kanban Board (Phase 2) */
.kanban-container {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.kanban-column {
  min-width: 320px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.kanban-header {
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1.25rem;
  cursor: grab;
  transition: all 0.2s;
}

.kanban-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.kanban-card:active {
  cursor: grabbing;
}

/* Buttons */
.btn-primary-theme {
  background: var(--accent-primary);
  color: #000;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: 2px solid var(--accent-primary);
}

.btn-primary-theme:hover {
  background: #e6c200;
  border-color: #e6c200;
  transform: scale(1.05);
}

.btn-outline-primary-theme {
  background: transparent;
  color: var(--text-light);
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 215, 0, 0.5);
  transition: all 0.2s;
}

.btn-outline-primary-theme:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Typography */
.text-primary-theme {
  color: var(--accent-primary);
}

.heading-hero {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  font-weight: 700;
}

/* Dashboard Mockup Container */
.dashboard-mockup {
  border: 1px solid var(--accent-primary);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.15);
  background: #0d0d12;
}

/* Sidebar Utilities */
.sidebar {
  background: rgba(10, 10, 20, 0.95);
  border-right: 1px solid var(--glass-border);
  min-height: calc(100vh - 72px);
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255, 215, 0, 0.1);
  color: var(--accent-primary);
}

.sidebar-icon {
  margin-right: 0.75rem;
  width: 20px;
}

/* Activity Timeline (Phase 2) */
.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 4px solid var(--bg-main);
  z-index: 2;
}

/* Automation Flow (Phase 2) */
.flow-step {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  opacity: 0.6;
  transition: all 0.3s;
}

.flow-step.active {
  opacity: 1;
  border-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.03);
}

.flow-step.completed {
  opacity: 1;
  border-color: #22c55e;
}
/* Cosmic Background & Starfield */
.cosmic-bg {
  background: radial-gradient(circle at 50% 50%, #050515 0%, #000000 100%);
  overflow: hidden;
}

.milky-way {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vmax;
  height: 150vmax;
  background: radial-gradient(ellipse at center, 
    rgba(255, 215, 0, 0.03) 0%, 
    rgba(100, 50, 200, 0.05) 20%, 
    rgba(0, 20, 60, 0.05) 50%, 
    transparent 70%);
  transform: translate(-50%, -50%) rotate(-15deg);
  filter: blur(60px);
  z-index: 1;
  animation: cosmicDrift 180s linear infinite;
}

.nebula-glow {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 40%;
  height: 60%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.02) 0%, transparent 70%);
  filter: blur(100px);
  z-index: 1;
  animation: pulseGlow 15s ease-in-out infinite;
}

@keyframes cosmicDrift {
  0% { transform: translate(-50%, -50%) rotate(-15deg) scale(1); }
  50% { transform: translate(-52%, -48%) rotate(-10deg) scale(1.1); }
  100% { transform: translate(-50%, -50%) rotate(-15deg) scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

/* Starfield using box-shadow (efficient single-element rendering) */
#stars, #stars2, #stars3 {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background: transparent;
  z-index: 2;
}

#stars {
  width: 1px;
  height: 1px;
  box-shadow: 1744px 174px #FFF, 134px 1314px #FFF, 544px 444px #FFF, 1544px 154px #FFF, 844px 844px #FFF, 104px 104px #FFF, 1244px 124px #FFF, 1844px 184px #FFF, 344px 344px #FFF, 644px 644px #FFF, 944px 944px #FFF, 1144px 1144px #FFF, 1444px 1444px #FFF, 1644px 1644px #FFF, 1944px 1944px #FFF, 244px 1244px #FFF, 444px 1444px #FFF, 744px 1744px #FFF, 1044px 144px #FFF, 1344px 444px #FFF, 1644px 744px #FFF, 1944px 1044px #FFF, 144px 1344px #FFF, 444px 1644px #FFF, 744px 1944px #FFF, 1044px 244px #FFF, 1344px 544px #FFF, 1644px 844px #FFF, 1944px 1144px #FFF;
  animation: animStar 150s linear infinite;
}

#stars2 {
  width: 2px;
  height: 2px;
  box-shadow: 444px 444px #FFF, 1444px 1444px #FFF, 244px 1244px #FFF, 1244px 244px #FFF, 844px 844px #FFF, 1844px 1844px #FFF, 1044px 1044px #FFF, 2044px 2044px #FFF, 644px 644px #FFF, 1644px 1644px #FFF, 44px 1044px #FFF, 1044px 44px #FFF, 844px 44px #FFF, 44px 844px #FFF, 1244px 1244px #FFF, 244px 244px #FFF, 1644px 644px #FFF, 644px 1644px #FFF, 1444px 444px #FFF, 444px 1444px #FFF;
  animation: animStar 250s linear infinite;
}

#stars3 {
  width: 3px;
  height: 3px;
  box-shadow: 744px 744px #FFF, 1744px 1744px #FFF, 544px 1544px #FFF, 1544px 544px #FFF, 944px 944px #FFF, 1944px 1944px #FFF, 1144px 1144px #FFF, 2144px 2144px #FFF, 344px 344px #FFF, 1344px 1344px #FFF;
  animation: animStar 350s linear infinite;
}

@keyframes animStar {
  from { transform: translateY(0px); }
  to { transform: translateY(-2000px); }
}

/* Image Optimization for "8K" clarity */
.high-res-logo {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.05) brightness(1.02) saturate(1.05);
  backface-visibility: hidden;
}

/* Dashboard Phase 2 Enhancements */
.sidebar-section-title {
  padding: 1.5rem 1rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.focus-bar {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.focus-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.focus-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: center;
}

.pipeline-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  position: relative;
  transition: all 0.3s ease;
}

.pipeline-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.stage-prospecting { border-left: 3px solid #facc15; }
.stage-qualification { border-left: 3px solid #3b82f6; }
.stage-proposal { border-left: 3px solid #a855f7; }
.stage-negotiation { border-left: 3px solid #f97316; }
.stage-won { border-left: 3px solid #22c55e; }
.stage-lost { border-left: 3px solid #ef4444; }

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.pipeline-arrow {
  color: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  .pipeline-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .pipeline-grid {
    grid-template-columns: 1fr;
  }
}

/* Phase 2 Branding & Sidebar */
.brand-logo-box {
  width: 44px;
  height: 44px;
  background: #FFD700;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.1em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.brand-subtext {
  font-size: 0.65rem;
  font-weight: 800;
  color: #3b82f6; /* Deep Corporate Blue */
  letter-spacing: 0.15em;
  margin-top: 0.35rem;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: #9ca3af;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.125rem 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(255, 215, 0, 0.08);
  color: #FFD700;
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
  color: #FFD700;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  margin-right: 1rem;
  color: #4b5563;
}

.sidebar-section-title {
  padding: 1.75rem 1rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

/* --- Phase 2 Analytics Extensions --- */

/* Progress Bar Components */
.progress-container {
  margin-bottom: 1.25rem;
}
.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.progress-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
}
.progress-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}
.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* KPI Cards V2 */
.kpi-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.kpi-card-v2 {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.3s ease;
}
.kpi-card-v2:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
}
.kpi-icon-v2 {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* List Components */
.dashboard-list-container {
  display: flex;
  flex-direction: column;
}
.dashboard-list-item {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dashboard-list-item:last-child {
  border-bottom: none;
}

/* Revenue Trend Box */
.revenue-summary-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  gap: 1.5rem;
}
.summary-item {
  flex: 1;
}

/* Responsive Grid Adjustments */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}
