/* ============================================
   APP SHELL - SIDEBAR NAVIGATION LAYOUT
   ============================================ */

/* App Shell Container */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg-app);
}

/* Fixed Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Sidebar Brand Section */
.sidebar__brand {
    padding: 24px 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar__nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(163, 105, 82, 0.1); /* Clay tint background */
}

/* Navigation Icons */
.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Navigation Badge */
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.nav-item .nav-badge.hidden {
    display: none;
}

/* Sidebar Footer - User Section */
.sidebar__footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-pill:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main Content Area */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    padding: 32px;
    width: calc(100% - 240px);
}

.main-content__inner {
    max-width: 1000px;
    margin: 0 auto;
}

/* Page Container */
.page {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--chat-bubble-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(139, 111, 92, 0.3);
}

.theme-toggle:hover {
  background: var(--chat-bubble-hover);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 111, 92, 0.4);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-latte,
.theme-icon-espresso {
  display: block;
}
