:root {
  --bg-dark: #0d1018;
  --bg-panel: #161b28; /* Slightly lighter than main bg */
  --bg-card: rgba(30, 41, 59, 0.4); /* Glassmorphism base */
  --border-color: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6; /* Electric Blue */
  --primary-hover: #2563eb;
  --accent: #8b5cf6; /* Neon Purple */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #10b981;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 260px;
  --transition: all 0.25s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  /* Subtle ambient gradients */
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 16, 24, 0.8);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 3rem;
  color: var(--text-main);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent);
  border-left: 3px solid var(--primary);
}

.nav-icon { width: 20px; text-align: center; }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width); /* Offset for fixed sidebar */
  padding: 2.5rem;
  padding-bottom: 6rem;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.current-project-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #4b5563, #374151);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

/* Sections & Cards */
.section { display: none; animation: fadeIn 0.4s ease; }
.section.active { display: block; }

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}
button.secondary:hover { background: rgba(255, 255, 255, 0.1); }

button.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
button.danger:hover { background: rgba(239, 68, 68, 0.3); }

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* Mobile Preview */
.mobile-frame {
  background: #000;
  border: 8px solid #2d3748;
  border-radius: 36px;
  width: 300px;
  height: 600px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.mobile-notch {
  width: 120px;
  height: 24px;
  background: #2d3748;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 2;
}

.mobile-screen {
  background: #f3f4f6; /* Light screen explicitly */
  height: 100%;
  width: 100%;
  padding-top: 40px;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-popup {
  background: white;
  width: 90%;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  margin-top: 100px;
  animation: slideDown 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.preview-push {
  background: rgba(0,0,0,0.8);
  color: white;
  width: 95%;
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.8rem;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Lists */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255, 255, 255, 0.02); }

/* Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.muted { color: var(--text-muted); }
.flex { display: flex; gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .mobile-frame { margin-top: 2rem; }
}

@media (max-width: 768px) {
  .app-container { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0px;
  }
  .nav-item span:not(.nav-icon) { display: none; } /* Show only icons on mobile */
  .brand { margin-bottom: 0; font-size: 1rem; }
  .main-content { margin-left: 0; padding: 1.5rem; }
  .mobile-frame { width: 100%; height: 500px; }
}
