/* Layout styles — Sidebar, app-layout grid, navigation */

/* ============================================
   APP LAYOUT GRID
   ============================================ */

.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
}

.app-main {
    min-width: 0;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}

.sidebar-inner {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
}

.sidebar-group {
    margin-bottom: 8px;
}

.sidebar-group-label {
    padding: 12px 24px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    opacity: 0.6;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    position: relative;
    white-space: nowrap;
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sidebar-item:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.sidebar-item.active {
    color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.08);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--accent-primary);
}

.sidebar-item.active i {
    color: var(--accent-primary);
}

/* ============================================
   SIDEBAR FOOTER
   ============================================ */

.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding: 16px;
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    padding: 2px 8px;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 10px;
    width: fit-content;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.sidebar-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar-action-btn:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.sidebar-action-btn.sidebar-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(255, 51, 102, 0.08);
}

/* ============================================
   HEADER — Desktop minimal
   ============================================ */

@media (min-width: 1025px) {
    .header-user {
        display: none !important;
    }
}

/* Hide nav-tabs — sidebar and mobile-bottom-nav handle navigation */
.nav-tabs {
    display: none !important;
}

/* Mobile-only elements — hidden globally, shown via responsive.css media queries */
.mobile-bottom-nav,
.mobile-nav-more-menu {
    display: none !important;
}

/* ============================================
   TABLET — Collapsed sidebar (icon-only)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 64px 1fr;
    }

    .sidebar {
        overflow: visible;
    }

    .sidebar-group-label {
        font-size: 0;
        padding: 8px 0 4px;
        text-align: center;
    }

    .sidebar-group-label::after {
        content: '';
        display: block;
        width: 24px;
        height: 1px;
        background: var(--glass-border);
        margin: 0 auto;
    }

    .sidebar-item {
        padding: 12px 0;
        justify-content: center;
        gap: 0;
    }

    .sidebar-item span {
        display: none;
    }

    .sidebar-item i {
        font-size: 1.15rem;
    }

    .sidebar-item.active::before {
        top: 6px;
        bottom: 6px;
    }

    /* Tooltip on hover */
    .sidebar-item {
        position: relative;
    }

    .sidebar-item::after {
        content: attr(data-tab);
        position: absolute;
        right: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-tertiary);
        color: var(--text-primary);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.8rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }

    .sidebar-item:hover::after {
        opacity: 1;
    }

    /* Sidebar footer - compact */
    .sidebar-footer {
        padding: 8px;
    }

    .sidebar-user {
        display: none;
    }

    .sidebar-actions {
        flex-direction: column;
    }
}

/* ============================================
   MOBILE — Sidebar hidden
   ============================================ */

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}
