/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-canvas);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, we scroll the canvas */
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* =========================================
   App Shell Layout
   ========================================= */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
  transition: grid-template-columns var(--transition-smooth);
}

/* =========================================
   Floating Sidebar
   ========================================= */
.sidebar {
  background: var(--color-bg-glass);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) 0;
  z-index: 50;
  position: relative;
}

.brand-mark {
  width: 48px;
  height: 48px;
  background: var(--color-brand-deep);
  color: var(--color-accent-gold);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  align-items: center;
}

.nav-item {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background: var(--color-brand-light);
  color: var(--color-brand-deep);
}

.nav-item.active {
  background: var(--color-brand-light);
  color: var(--color-brand-deep);
}

/* Active Indicator (Gold Pill) */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px; /* Outside the item, on the edge of sidebar */
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--color-accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icon {
  font-size: 20px;
}

/* =========================================
   Main Content Area (Canvas)
   ========================================= */
.main-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  height: 80px;
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

.breadcrumbs span.current {
  color: var(--color-text-main);
  font-weight: var(--weight-bold);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Scrollable Content Canvas */
.content-canvas {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-8);
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-brand-medium) transparent;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* =========================================
   Search Spotlight
   ========================================= */
.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-bg-surface);
  border: var(--border-subtle);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  min-width: 200px;
}

.search-trigger:hover {
  border-color: var(--color-brand-medium);
  box-shadow: var(--shadow-sm);
}

.kbd-shortcut {
  background: var(--color-bg-canvas);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  margin-left: auto;
}

/* =========================================
   User Profile Pill
   ========================================= */
.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  background: var(--color-bg-surface);
  border-radius: var(--radius-full);
  border: var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-pill:hover {
  box-shadow: var(--shadow-sm);
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-main);
  margin-right: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-brand-medium);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  padding-top: 1px;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .top-bar {
    height: 64px;
    padding: 0 var(--space-4);
  }

  .content-canvas {
    padding: var(--space-4);
  }

  .search-trigger {
    min-width: 150px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .user-pill {
    padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
  }

  .user-name {
    display: none; /* Hide name on mobile, show only avatar */
  }

  .kbd-shortcut {
    display: none; /* Hide keyboard shortcut on mobile */
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .top-bar {
    height: 56px;
    padding: 0 var(--space-3);
  }

  .content-canvas {
    padding: var(--space-3);
  }

  .search-trigger {
    min-width: 120px;
    padding: var(--space-1) var(--space-2);
  }

  .breadcrumbs {
    font-size: var(--text-xs);
  }
}
