/* ========== HIDE OLD SIDEBAR & TOPBAR ========== */
.app-shell {
 display: block !important;
}

.app-sidebar,
.sidebar-inner,
.sidebar-logo,
.sidebar-nav,
.sidebar-footer,
.app-topbar,
.topbar-left,
.topbar-right,
.app-title {
 display: none !important;
}

.app-main {
 width: 100% !important;
 margin-left: 0 !important;
}

/* ========== DROPDOWN DIVIDER ========== */
.pill-nav__dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
 margin: 0.5rem 0;
    border: none;
}

[data-theme="light"] .pill-nav__dropdown-divider {
    background: rgba(0, 0, 0, 0.1);
}

/* ========== USER DROPDOWN LOGOUT BUTTON FIX ========== */
.pill-nav__dropdown-menu form {
    margin: 0 !important;
    padding: 0 !important;
}

.pill-nav__dropdown-menu form button.pill-nav__dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font: inherit;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 400;
}

.pill-nav__dropdown-menu form button.pill-nav__dropdown-item:hover {
    background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav__dropdown-menu form button.pill-nav__dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Mobile sidebar logout button */
.pill-nav-sidebar__nav form {
    margin: 0;
    padding: 0;
}

.pill-nav-sidebar__nav form button.pill-nav-sidebar__item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font: inherit;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
}

.pill-nav-sidebar__nav form button.pill-nav-sidebar__item:hover {
    background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav-sidebar__nav form button.pill-nav-sidebar__item i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

/* ============================================
   PILL NAVIGATION - FLOATING DESIGN
   Modern floating pill navigation with mobile support
 ============================================ */

.pill-nav {
    position: fixed;
    top: 0.35rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
  
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    
    background: var(--color-surface);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    box-shadow: var(--theme-shadow-lg);
    
    backdrop-filter: blur(var(--theme-blur, 12px)) saturate(var(--theme-saturation, 100%));
    -webkit-backdrop-filter: blur(var(--theme-blur, 12px)) saturate(var(--theme-saturation, 100%));
    
    max-width: min(95vw, 1400px);
  width: auto;
    
    transition: all 0.3s ease;
}

/* Mobile Menu Toggle Button */
.pill-nav__toggle {
 display: none;
    flex-direction: column;
  justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
  padding: 0;
    z-index: 1001;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.pill-nav__toggle:hover {
    background: var(--color-surface-subtle);
}

.pill-nav__toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.pill-nav__toggle span:not(:last-child) {
margin-bottom: 4px;
}

/* Hamburger animation when active */
.pill-nav__toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.pill-nav__toggle.active span:nth-child(2) {
    opacity: 0;
}

.pill-nav__toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Brand */
.pill-nav__brand {
    flex-shrink: 0;
    padding-right: 1rem;
    border-right: 1px solid var(--border-light);
    display: flex;
    align-items: center;
}

.pill-nav__logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
 color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: opacity 0.2s ease;
}

.pill-nav__logo:hover {
    opacity: 0.8;
}

.pill-nav__logo-img {
    width: 48px;
    height: 48px;
  object-fit: contain;
    border-radius: 25px;
    box-shadow: 0 0 12px rgba(66, 133, 244, 0.2);
}

.pill-nav__logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--google-blue), var(--google-blue-dark));
    color: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    box-shadow: 0 0 12px var(--google-blue-subtle);
}

.pill-nav__logo-text {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
    font-size: 1.125rem;
}

/* Navigation Items Container */
.pill-nav__items {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex: 0 1 auto;
    min-width: 0;
}

/* Navigation Item */
.pill-nav__item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
  padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: transparent;
  border: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.pill-nav__item:hover {
    background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav__item.active {
    background: var(--google-blue-subtle);
    color: var(--google-blue);
    font-weight: 600;
}

.pill-nav__item i {
    font-size: 0.9375rem;
    flex-shrink: 0;
}

/* Dropdown */
.pill-nav__dropdown {
    position: relative;
    flex-shrink: 0;
    z-index: 10001;
}

.pill-nav__dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--color-surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 0.5rem;
  opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10002;
}

/* Right-aligned dropdown (for user menu) */
.pill-nav__dropdown-menu--right {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-8px);
}

.pill-nav__dropdown-menu--right.show {
    transform: translateX(0) translateY(0);
}

.pill-nav__dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

/* Override for right-aligned menus — must come after the generic .show rule */
.pill-nav__dropdown-menu.pill-nav__dropdown-menu--right.show {
    transform: translateX(0) translateY(0);
}

.pill-nav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
  transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.pill-nav__dropdown-item:hover {
  background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav__dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* User Actions */
.pill-nav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-light);
  flex-shrink: 0;
}

.pill-nav__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--google-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
}

.pill-nav__user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

/* App Shell Padding */
.app-shell {
    padding-top: 64px;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    min-height: calc(100vh - 64px);
}

/* Mobile Sidebar Overlay */
.pill-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
  left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pill-nav-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile Sidebar */
.pill-nav-sidebar {
    position: fixed;
    top: 0;
left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--color-surface);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: none;
}

.pill-nav-sidebar.show {
    transform: translateX(0);
}

.pill-nav-sidebar__header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
 align-items: center;
    justify-content: space-between;
}

.pill-nav-sidebar__logo {
 display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.pill-nav-sidebar__logo img {
    width: 48px;
    height: 48px;
 object-fit: contain;
    border-radius: 25px;
}

.pill-nav-sidebar__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pill-nav-sidebar__close:hover {
    background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav-sidebar__nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pill-nav-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.pill-nav-sidebar__item:hover {
    background: var(--color-surface-subtle);
    color: var(--text-primary);
}

.pill-nav-sidebar__item.active {
    background: var(--google-blue-subtle);
    color: var(--google-blue);
    font-weight: 600;
}

.pill-nav-sidebar__item i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.pill-nav-sidebar__dropdown-content {
    margin-left: 2.5rem;
    margin-top: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
}

.pill-nav-sidebar__dropdown-content.show {
    display: flex;
}

.pill-nav-sidebar__divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0;
}


/* ============================================
   RESPONSIVE BREAKPOINTS
   Strategy:
     >= 1281px   -> Full labels + icons
     1101-1280px -> Icon-only nav items, logo text visible
     901-1100px  -> Icon-only nav items, logo text hidden
     <= 900px    -> Hamburger + slide-in sidebar
     <= 600px    -> Hide logo text on small phones
     <= 480px    -> Extra compact pill
============================================ */

/* Safety: dropdown menus bounded so they never bleed off screen */
.pill-nav__dropdown-menu {
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

/* -------------------------------------------------
   >= 1281px  Full nav: labels + icons
------------------------------------------------- */
@media (min-width: 1281px) {
    .pill-nav {
        gap: 0.375rem;
        padding: 0.5rem 1rem;
    }
    .pill-nav__item {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
        gap: 0.375rem;
    }
}

/* -------------------------------------------------
   1101-1280px  Icon-only items, logo text shown
   Hides text spans to prevent pill overflow
------------------------------------------------- */
@media (max-width: 1280px) and (min-width: 1101px) {
    .pill-nav {
        gap: 0.125rem;
        padding: 0.5rem 0.75rem;
    }
    .pill-nav__item {
        padding: 0.5rem 0.75rem;
        gap: 0;
    }
    .pill-nav__items .pill-nav__item > span {
        display: none;
    }
    .pill-nav__brand {
        padding-right: 0.625rem;
    }
    .pill-nav__actions {
        padding-left: 0.5rem;
    }
    .pill-nav__logo-img {
        width: 40px;
        height: 40px;
    }
    .pill-nav__logo-text {
        font-size: 0.9375rem;
    }
    .pill-nav__user-name {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* -------------------------------------------------
   901-1100px  Icon-only items + logo icon only
   Logo text hidden to maximise space for icons
------------------------------------------------- */
@media (max-width: 1100px) and (min-width: 901px) {
    .pill-nav {
        gap: 0.125rem;
        padding: 0.5rem 0.625rem;
    }
    .pill-nav__item {
        padding: 0.5rem 0.625rem;
        gap: 0;
    }
    .pill-nav__items .pill-nav__item > span {
        display: none;
    }
    .pill-nav__logo-text {
        display: none;
    }
    .pill-nav__brand {
        padding-right: 0.375rem;
        border-right-color: var(--border-light);
    }
    .pill-nav__actions {
        padding-left: 0.375rem;
    }
    .pill-nav__logo-img {
        width: 36px;
        height: 36px;
    }
    .pill-nav__user-name {
        display: none;
    }
}

/* -------------------------------------------------
   <= 900px  Hamburger + slide-in sidebar
------------------------------------------------- */
@media (max-width: 900px) {
    .pill-nav {
        padding: 0.4rem 0.625rem;
        gap: 0.375rem;
        max-width: calc(100vw - 1.5rem);
        transition: opacity 0.2s ease;
    }

    .pill-nav__toggle {
        display: flex;
    }

    .pill-nav__items {
        display: none !important;
    }

    .pill-nav__actions {
        border-left: none;
        padding-left: 0;
    }

    .pill-nav__logo-img {
        width: 34px;
        height: 34px;
    }

    .pill-nav__logo-text {
        font-size: 0.9375rem;
    }

    .pill-nav__user-name {
        display: none;
    }

    .pill-nav-sidebar {
        display: block;
    }

    .pill-nav.sidebar-open {
        opacity: 0.75;
    }

    .app-shell {
        padding-top: 60px;
    }
}

/* -------------------------------------------------
   <= 600px  Hide logo text to save space
------------------------------------------------- */
@media (max-width: 600px) {
    .pill-nav__logo-text {
        display: none;
    }
    .pill-nav__brand {
        border-right: none;
        padding-right: 0.125rem;
    }
    .pill-nav {
        gap: 0.25rem;
        padding: 0.375rem 0.5rem;
    }
}

/* -------------------------------------------------
   <= 480px  Very compact pill
------------------------------------------------- */
@media (max-width: 480px) {
    .pill-nav {
        top: 0.5rem;
        padding: 0.3rem 0.5rem;
        gap: 0.25rem;
        max-width: calc(100vw - 1rem);
    }

    .pill-nav__logo-img {
        width: 30px;
        height: 30px;
    }

    .pill-nav__logo-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8125rem;
    }

    .pill-nav__user-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.6875rem;
    }

    .pill-nav__toggle {
        width: 30px;
        height: 30px;
    }

    .pill-nav__toggle span {
        width: 15px;
    }

    .app-shell {
        padding-top: 60px;
    }
}
