:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --fg: #e5e5e5;
  --fg-muted: #888888;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-dim: #2563eb;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-muted);
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: rgba(18, 18, 18, 0.95);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo h1 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.5px;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 400;
  display: block;
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  position: relative;
  user-select: none;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}

.user-role {
  font-size: 11px;
  color: var(--fg-muted);
}

.main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--fg-muted);
}

.topbar-breadcrumb span {
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.topbar-btn:hover {
  border-color: var(--border-hover);
  color: var(--fg);
  background: rgba(255,255,255,0.03);
}

.topbar-btn svg {
  width: 16px;
  height: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity var(--transition);
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(59, 130, 246, 0.06), transparent 40%);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(59, 130, 246, 0.05);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.section-action {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  transition: color var(--transition);
  font-weight: 500;
}

.section-action:hover {
  color: var(--accent-dim);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.widget:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.widget-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.widget-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-icon svg {
  width: 16px;
  height: 16px;
}

.widget-icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}

.widget-icon.green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.widget-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.widget-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}

.widget-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.widget-change.up {
  color: var(--danger);
}

.widget-change.down {
  color: var(--success);
}

.weather-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.weather-widget::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.weather-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.weather-location {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}

.weather-time {
  font-size: 11px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.weather-icon-large {
  font-size: 48px;
  line-height: 1;
}

.weather-temp {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 300;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}

.weather-desc {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.weather-detail {
  text-align: center;
}

.weather-detail-label {
  font-size: 10px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.weather-detail-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.stock-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stock-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}

.stock-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}

.stock-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  font-family: var(--font-mono);
}

.stock-fullname {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.stock-price {
  text-align: right;
}

.stock-price-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.stock-price-change {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.stock-price-change.up {
  color: var(--danger);
}

.stock-price-change.down {
  color: var(--success);
}

.stock-sparkline {
  width: 80px;
  height: 32px;
  margin: 0 12px;
}

.prototype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.prototype-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.prototype-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.prototype-thumb {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prototype-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(26,26,26,0.8));
}

.prototype-thumb-icon {
  position: relative;
  z-index: 1;
  opacity: 0.4;
}

.prototype-thumb-icon svg {
  width: 40px;
  height: 40px;
  color: var(--fg);
}

.prototype-body {
  padding: 16px;
}

.prototype-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.prototype-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prototype-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.15);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.tag.green {
  background: rgba(34, 197, 94, 0.08);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.15);
}

.tag.amber {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.15);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
  position: relative;
}

.activity-dot::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: calc(100% + 24px);
  background: var(--border);
}

.activity-item:last-child .activity-dot::before {
  display: none;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 13px;
  color: var(--fg);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--accent);
  font-weight: 600;
}

.activity-time {
  font-size: 11px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--fg);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.search-input {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--transition);
  width: 200px;
}

.search-input::placeholder {
  color: var(--fg-muted);
}

.search-input:focus {
  border-color: var(--accent);
}

.page {
  display: none;
  padding: 32px;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger > * {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.stagger > *:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger > *:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger > *:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger > *:nth-child(4) {
  animation-delay: 0.2s;
}

.stagger > *:nth-child(5) {
  animation-delay: 0.25s;
}

.stagger > *:nth-child(6) {
  animation-delay: 0.3s;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.page-label {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  z-index: 200;
  opacity: 0.6;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
