:root {
  --primary-color: #10b981;
  --primary-hover: #059669;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --sidebar-width: 260px;
  --sidebar-bg: #ffffff;
  --nav-height: 64px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius-lg: 0.75rem;
}

[data-theme="dark"] {
  --bg-light: #111827;
  --bg-white: #1f2937;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --sidebar-bg: #111827;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.navbar {
  height: var(--nav-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.content-area {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Components */
.logo-container {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  padding: 1rem 0;
  overflow-y: auto;
  flex: 1;
}

.nav-group-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-light);
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(16, 185, 129, 0.1);
  border-right: 3px solid var(--primary-color);
}

.search-container {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-light);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary-color);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-color);
}

.tool-title {
  font-weight: 600;
  font-size: 1rem;
}

.tool-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.favorite-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.favorite-btn:hover {
  color: #ef4444;
}

/* Utils */
.flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .main-content {
    margin-left: 0;
  }
}
